Repository navigation
refactor: implement active orchestrator model with unified rules API - #7
Merged
Merged
Conversation
for input When a Claude agent invokes AskUserQuestion or other interactive tools during execution, the worker now: 1. Detects the interactive tool use in the stream-json output 2. Immediately terminates the agent process (no hang/wait) 3. Sets InputBlocked=true on the result (for future needs-input status) 4. Returns clear error message with session ID for potential manual resume 5. Records separate "input_blocked" metric status This prevents: - False 'completed' status when agent is actually waiting - Infinite retry loops on input-blocked tasks - Wasted compute on tasks that can't proceed autonomously
When an agent pauses waiting for user input (InputBlocked=true), mark the task as 'needs-input' instead of 'failed'. This prevents the scheduler from re-picking up the task in a loop. Changes: - Add NeedsInput method to BeadsClient interface and implementations - Update HandleFailure to detect InputBlocked and use NeedsInput - Store session ID in notes for future resume support - Add 'needs-input' status color (orange) to dashboard - Add 'Paused' filter button to TaskList component
Add ConfigHandler with HTTP endpoints for querying repository configuration: - GET /api/config/rules - rules filter settings - GET /api/config/sandbox - sandbox configuration - GET /api/config/validation - validation steps Also adds TypeScript client functions and types for the new endpoints.
…ition mismatch (canopy-0aa8)
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 4 of daemon/orchestrator API factoring. Key changes: - Add OrchestratorState enum (IDLE, ACTIVE, PAUSED) for state machine - Add RepoOrchestrator struct to represent always-running orchestrators - Replace standaloneEngines sync.Map with orchestrators sync.Map - Implement RegisterRepo/UnregisterRepo for orchestrator lifecycle - StartRun now performs state transition (idle → active) instead of creating a new orchestrator - StopRun transitions orchestrator back to IDLE state - Orchestrator goroutine updates RepoOrchestrator state on completion The always-running model means: - Orchestrators start when a repo is registered with daemon - Orchestrators stop when a repo is unregistered - "Starting a run" = state transition, not object creation - "Stopping a run" = state transition, not object destruction For backwards compatibility, RunState and legacy run tracking are preserved alongside the new RepoOrchestrator model.
…-a7pj) Update URL structure to reflect ownership between daemon and orchestrator: New URL structure: - /api/repos/:repo_id/rules/* - orchestrator (repo-scoped rules) - /api/repos/:repo_id/config/* - orchestrator (repo-scoped config) - /api/daemon/runs/* - daemon (cross-repo run listing) - /api/daemon/repositories/* - daemon (repository management) Changes: - pkg/daemon/server.go: Add new routes and redirect handlers - pkg/daemon/rules_handlers.go: Add RouteRepoRules for new path pattern - pkg/daemon/config_handlers.go: Add RouteRepoConfig for new path pattern - web/dashboard/src/api/client.ts: Update API calls to use new URLs Backwards compatibility maintained via HTTP 307 redirects from old paths.
Proposes shifting from discrete 'runs' to 'repo has an orchestrator' model. Key changes: - Orchestrator is always-present per repo (idle/active/paused states) - 'Runs' become 'sessions' (work periods within orchestrator) - Rules/config tied to repo, not run - Clearer mental model for users Implementation epic: canopy-i4sm Tasks: canopy-rqcm, canopy-rxoz, canopy-wtnh, canopy-xchh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a significant architectural refactor to support an always-running orchestrator model:
/api/orchestrator/*for orchestrator-specific endpoints)Test plan
go test ./...)