Files
kandev/docs/plans/parent-child-task-stop/task-05-integration-regression.md
T
2026-08-02 20:42:57 +01:00

2.7 KiB

id, title, status, wave, depends_on, plan, spec
id title status wave depends_on plan spec
05-integration-regression Integrated stop regression done 5
01-execution-stop-semantics
02-coordinator-stop-operation
03-mcp-stop-handler
04-task-mcp-tool
plan.md ../../specs/tasks/parent-child-task-stop.md

Task 05: Integrated stop regression

Acceptance

  • Real orchestrator, dispatcher, and MCP backend-handler wiring lets a direct parent stop a long-running child without waiting for turn completion or dispatching a replacement prompt.
  • Action response returns promptly; child session becomes CANCELLED, eligible child task becomes REVIEW, and the simulated lifecycle reports the execution is no longer running. The test does not require simulated-manager map removal.
  • A repeat call returns not_running and changes no additional state.
  • The test does not claim to exercise the local task-mode MCP transport adapter; its exact action/payload forwarding is covered in Task 04.

Verification

cd apps/backend && go test ./internal/integration -run TestMCPStopTask

Files Likely Touched

  • apps/backend/internal/integration/mcp_stop_task_test.go

Dependencies

  • Tasks 01-04 complete the lifecycle, coordinator operation, backend action, and tool adapter.

Inputs

  • Spec scenarios for direct-parent success, no replacement prompt, and idempotent retry.
  • Existing orchestrator integration harness and mock-agent long-turn patterns.

Output Contract

Update this task to done, update plan.md, and report observed timing/state, files changed, tests run, blockers, and any unverified process-cleanup risks.

Completion

  • Added a real orchestrator, MCP-handler, and shared-dispatcher regression for a long-running direct child.
  • Deliberately blocked simulated runtime teardown and proved the response lands after session CANCELLED and task REVIEW, but before process stop finishes.
  • Verified no replacement prompt or queued message is created, runtime stop completes after release, and a repeat returns not_running without mutation.
  • Passed the focused test, 20 repeated runs, and the focused race-detector run.
  • After CI exposed a RUNNING-versus-stream ordering race, added a deterministic message.added barrier for the persisted initial tool call before capturing the pre-stop message baseline. The strict no-new-message assertion remains; no sleep, retry, or relaxed expectation was added.
  • Passed 300 race-detector repetitions across -cpu=1,2,4, the complete integration package, and the full 133-package shard-2 race test.
  • Remaining lifecycle boundary: the test proves the simulated runtime reaches stopped status, not operating-system cleanup for every production provider.