refactor(commands): migrate /plan command family to CommandHandler registry#2952
Merged
refactor(commands): migrate /plan command family to CommandHandler registry#2952
Conversation
…gistry Convert all sub-handlers in plan.rs to _as_string variants returning Result<String, AgentError>: goal, status, list, cancel, resume, retry. Add handle_plan_command_as_string dispatcher and dispatch_plan_command_as_string parser. Remove all old channel.send-based wrappers for those handlers. handle_plan_confirm and finalize_plan_execution remain channel-based (long-running interactive flows). The Confirm branch now carries a comment explaining the asymmetry and the CommandOutput::Silent mapping. Update agent_access_impl.rs to call dispatch_plan_command_as_string, clean up dead cfg branches in list_scheduled_tasks. Add three missing unit tests: plan_cancel_as_string_no_active_plan, plan_resume_as_string_no_paused_plan, dispatch_plan_command_as_string_invalid_subcommand. Closes #2948
…est modules plan.rs methods are gated by cfg(feature = "scheduler") via mod.rs, so all tests depending on them must carry the same guard. Previously the cfg was missing, causing 62 compile errors when building without the scheduler feature. Add cfg(feature = "scheduler") to agent_with_orchestration() helper and all plan/scheduler-dependent tests in mod compaction_e2e. Change mod inline_tool_loop_tests guard from cfg(test) to cfg(all(test, feature = "scheduler")). Without scheduler: 1325 tests pass, 0 errors. With full features: 8118/8118 pass.
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
/plansub-handlers inplan.rsto_as_stringvariants (goal,status,list,cancel,resume,retry) returningResult<String, AgentError>handle_plan_command_as_stringdispatcher anddispatch_plan_command_as_stringparser; remove all oldchannel.send-based wrappershandle_plan_confirmandfinalize_plan_executionremain channel-based (long-running interactive flows) — asymmetry documented with a comment#[cfg]branches inagent_access_impl.rs(list_scheduled_tasks)plan_cancel_as_string_no_active_plan,plan_resume_as_string_no_paused_plan,dispatch_plan_command_as_string_invalid_subcommandTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings— cleancargo nextest run --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 8118/8118 passedCloses #2948