AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-263
  5. plan
  6. plan.md
plan.md(2.3 KB)· Apr 3, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

Plan: Fix E2E failure on replan/restart plan invalidation (#263)#

Summary#

PR #261 (feat/issue-234) adds resetForReplan(), clearPlanArtefacts(), and restart PR cleanup. The CI E2E job was cancelled (timeout/infra), not a deterministic test failure. All 675 unit tests pass. The fix adds integration test coverage for the replan and restart directive lifecycles to validate the new state contracts, and re-triggers E2E CI to confirm no regression.

Files#

FileActionDescription
test/integration/replan-directive.integration.spec.tscreateIntegration test for /agent replan lifecycle: artefact cleanup, state reset, PR close, re-enqueue
test/integration/restart-directive.integration.spec.tscreateIntegration test for /agent restart lifecycle: PR close, state reset, re-enqueue (no artefact cleanup)
test/integration/blocked-persistent-to-refine.integration.spec.tsmodifyVerify ArtefactsService mock covers all methods called during directive processing

Steps#

  1. Create replan directive integration test — Wire DirectiveService with real TaskStateService + in-memory SQLite + mocked GitHub/ArtefactsService. Test: task with plan+PR → replan → artefacts cleared, prNumber/prBranch nullified, replanAttempt incremented, phases reset, refine enqueued, superseded comment posted.
  2. Create restart directive integration test — Same wiring. Test: task with open PR → restart → PR closed with superseded comment, prNumber/prBranch cleared, phases reset, refine enqueued, plan artefacts NOT cleared.
  3. Verify existing integration test — Confirm blocked-persistent-to-refine.integration.spec.ts ArtefactsService mock is complete (both clearPlanArtefacts and buildCentralTaskDir covered — already done in PR #261, verify no drift).
  4. Run full test suite — npm run test and npm run lint pass with zero regressions.

Verification#

  • npm run test — all tests pass including new integration tests
  • npm run lint — zero warnings
  • Re-trigger E2E CI on the PR branch to confirm the timeout was transient (not a code regression)

Risks#

  • The E2E timeout was infra-related (reviewer confirmed "likely-infra") — if it recurs, the issue is in CI runner capacity, not agent-core code. Flaky E2E timeouts should not block this PR.
ContextPrd