Skip to content

[Phase 5] Dynamic Configuration Reload During Batch Execution #402

@frankbria

Description

@frankbria

Summary

Watch for changes to AGENTS.md/CLAUDE.md/CODEFRAME.md during long-running batch executions and hot-reload configuration without restarting. Inspired by Symphony's dynamic WORKFLOW.md reload pattern.

Motivation

During multi-hour batch runs (cf work batch run --all-ready), operators may need to adjust agent behavior — change the prompt, adjust concurrency, modify gate configuration. Currently this requires killing and restarting the batch. Symphony solves this with filesystem watching and automatic config reload.

This is lower priority because single-task execution is short-lived, but it becomes important for Phase 4 multi-agent scenarios where batch runs may run for hours.

Design

Scope (single session)

  1. File watcher: Use watchdog or inotify to monitor config files for changes
  2. Reload logic in core/agents_config.py:
    • On file change: re-parse config
    • Validate new config (don't apply if invalid)
    • Log reload event with diff summary
    • Apply to future task dispatches (don't restart in-flight agents)
  3. Integration with conductor:
    • core/conductor.py checks for config updates between task dispatches
    • New concurrency/strategy settings apply to remaining tasks
    • New prompt/agent settings apply to next agent launch
  4. Safety:
    • Invalid config reload → keep last known good config, log error
    • Config reload during agent execution → queued, applied after current task

What reloads dynamically

  • Agent prompt / system prompt supplement
  • Concurrency limits (max_parallel)
  • Gate configuration
  • Hook scripts (for future tasks)
  • Stall timeout

What requires restart

  • Engine selection (react/plan)
  • Workspace path
  • Tech stack

Acceptance Criteria

  • Config file changes detected within 5 seconds during batch execution
  • Valid config changes applied to subsequent task dispatches
  • Invalid config changes logged as error, previous config retained
  • In-flight agent tasks not interrupted by config reload
  • cf work batch status shows "config reloaded at HH:MM:SS" if reload occurred
  • Integration test: modify config during batch, verify next task uses new config

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-5Phase 5: Advanced Features & Polishphase-5.3Phase 5.3: Polish & Advanced (TUI, debug/replay, dynamic config)symphony-inspiredInspired by OpenAI Symphony spec analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions