Skip to content

refactor(commands): migrate /plan command family to CommandHandler registry#2952

Merged
bug-ops merged 2 commits intomainfrom
2948-migrate-plan-to-commandhandler
Apr 13, 2026
Merged

refactor(commands): migrate /plan command family to CommandHandler registry#2952
bug-ops merged 2 commits intomainfrom
2948-migrate-plan-to-commandhandler

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 13, 2026

Summary

  • Convert all /plan sub-handlers in plan.rs to _as_string variants (goal, status, list, cancel, resume, retry) returning Result<String, AgentError>
  • Add handle_plan_command_as_string dispatcher and dispatch_plan_command_as_string parser; remove all old channel.send-based wrappers
  • handle_plan_confirm and finalize_plan_execution remain channel-based (long-running interactive flows) — asymmetry documented with a comment
  • Clean up dead #[cfg] branches in agent_access_impl.rs (list_scheduled_tasks)
  • Add 3 missing unit tests: plan_cancel_as_string_no_active_plan, plan_resume_as_string_no_paused_plan, dispatch_plan_command_as_string_invalid_subcommand

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings — clean
  • cargo nextest run --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 8118/8118 passed

Closes #2948

…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
@github-actions github-actions Bot added refactor Code refactoring without functional changes rust Rust code changes core zeph-core crate size/XL Extra large PR (500+ lines) and removed refactor Code refactoring without functional changes labels Apr 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 13, 2026 16:34
…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.
@github-actions github-actions Bot added the refactor Code refactoring without functional changes label Apr 13, 2026
@bug-ops bug-ops merged commit c7e6e5c into main Apr 13, 2026
30 checks passed
@bug-ops bug-ops deleted the 2948-migrate-plan-to-commandhandler branch April 13, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate refactor Code refactoring without functional changes rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(commands): migrate /plan command family to CommandHandler registry (remove channel.send wrappers)

1 participant