3.1 KiB
3.1 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-clear-idle-reset-dispatch-gate | Clear the idle reset dispatch gate | done | 1 | plan.md |
|
|
|
Task 01: Clear the Idle Reset Dispatch Gate
Summary
Clear the pending dispatch-only gate when a successful idle context reset removes its completion signal. Apply the correction to both provider-reset paths.
In scope
- Add a failing regression test for an idle ACP reset with a buffered dispatch-only completion.
- Prove that a follow-up dispatch-only prompt reaches agentctl after the reset.
- Add pending-gate coverage to the existing process-restart state test.
- Clear the old pending flag after both reset paths drain the old signal.
Out of scope
- Clear the gate when
waitForPendingDispatchedPrompttimes out. - Change cancellation escalation or active-turn reset behavior.
- Add frontend behavior or browser tests.
Acceptance
- An ACP session reset removes the old completion signal and clears its matching pending flag.
- The next prompt reaches agentctl without a predecessor timeout.
- The process-restart fallback clears the same signal and flag pair.
Verification
go test -race ./internal/agent/runtime/lifecycle -run 'TestManager_(ResetAgentContext_ClearsIdleDispatchGate|RestartAgentProcess_Success)$' -count=1
git diff --check
Run the commands from apps/backend and the repository root, respectively.
Files likely touched
apps/backend/internal/agent/runtime/lifecycle/manager_interaction.goapps/backend/internal/agent/runtime/lifecycle/manager_interaction_test.godocs/plans/idle-context-reset-dispatch-gate/plan.mddocs/plans/idle-context-reset-dispatch-gate/task-01-clear-idle-reset-dispatch-gate.md
Dependencies
None.
Risks
- A reset path that drains the signal without clearing the flag will keep the execution unusable.
- A flag clear before successful context replacement can release a valid active generation.
Parallelism
sequential
Inputs
REQ-TASKS-WORKFLOW-STEP-AGENT-START-OWNERSHIP-002docs/specs/tasks/system-design/workflow-step-agent-start-ownership.mddocs/decisions/2026-08-30-context-reset-quiesces-active-turn.md- GitHub issue
#3210 - Existing reset and pending-prompt tests in the lifecycle package.
Results
- RED: The focused command failed 2 tests before the production correction.
TestManager_RestartAgentProcess_Successfound that process replacement kept the stale gate.TestManager_ResetAgentContext_ClearsIdleDispatchGatefound the same state after an ACP reset.- GREEN: The focused command passed 2 tests after both reset paths cleared the gate.
- Final: The race-enabled verification passed 2 tests.
git diff --checkpassed. - Changed files:
manager_interaction.go,manager_interaction_test.go, and this plan package. - No known blockers remain.