Files
oh-my-pi/packages/coding-agent/test
cognitive 736ec807a5 test(coding-agent/plan-mode): cover compact-then-execute approval path
- Extend the existing selector-list assertion to include the new
  "Approve and compact context" entry in the expected five-choice array.
- Add three new cases that mock `handleCompactCommand` at the
  CompactionOutcome boundary (the contract `#approvePlan` consumes):
  - "ok" → asserts compactSpy called with the planning-specific
    custom instruction rendered from `plan-mode-compact-instructions.md`
    (matched by content: "Preparing to execute the approved plan" +
    the final plan file path); plan-approved synthetic prompt dispatched
    (discriminated by the `{ synthetic: true }` option flag);
    `markPlanReferenceSent` called once.
  - "cancelled" → no synthetic dispatch; `showWarning` surfaces the
    deferred-dispatch message; `setPlanReferencePath` IS called with the
    final path so the session knows the plan was approved; but
    `markPlanReferenceSent` is NOT called so the next operator turn
    re-injects the reference via #buildPlanReferenceMessage. This last
    assertion is the load-bearing regression guard for the asymmetric
    cancel/fail contract.
  - "failed" → plan-approved synthetic prompt IS dispatched
    (best-effort); markPlanReferenceSent fires.

Per AGENTS.md the tests use `vi.spyOn` + `vi.restoreAllMocks()` in
the existing afterEach; no `mock.module()`.

Op: extend
2026-05-12 23:01:31 +00:00
..
2026-05-12 04:09:33 +02:00
2026-05-12 04:09:33 +02:00
2026-03-14 10:46:26 +01:00
2026-05-12 04:09:33 +02:00
2026-05-02 07:01:57 +02:00
2026-05-12 04:09:33 +02:00
2026-05-12 04:09:33 +02:00