Commit Graph

5 Commits

Author SHA1 Message Date
can1357 78a94c5a93 feat(snapcompact): improved archive text preservation and continuity
- Unify `previousText` resolution to correctly concatenate `textHead` and `textTail` during re-compaction.
- Ensure summary fallback logic correctly handles non-text legacy archives.
- Add test coverage for cross-compaction text retention and legacy archive continuity.
- Enable snapcompact strategy in agent plan reference re-injection tests.
2026-06-21 00:11:02 +02:00
can1357 f8f8136021 refactor(coding-agent): privatized the legacy nextToolChoice method to
- Privatized the legacy `nextToolChoice` method to `#nextHardToolChoice` to ensure all tool-choice directives flow through the unified `nextToolChoiceDirective` entry point.
- Eliminated redundant dual entry points for fetching tool choices, which previously bypassed the soft pending-preview lifecycle.
- Updated test suites to consume `nextToolChoiceDirective` where appropriate to maintain consistency with internal agent-loop logic.
2026-06-19 22:24:12 +02:00
can1357 3006fe817b test(coding-agent): drop evaluator-worktree note from plan-reference test 2026-06-18 22:57:20 +02:00
can1357 0c69b35785 style: biome format integrated #2851/#1246/#2972 changes 2026-06-18 22:56:24 +02:00
can1357 dbf4b53163 fix(coding-agent): re-inject approved plan reference after compaction
After plan approval the executor delivers the plan-mode-reference exactly
once and sets `#planReferenceSent = true`. Both compaction paths — `compact()`
and `#runAutoCompaction()` — replace the conversation history that carried
that reference but never cleared the flag, so `#buildPlanReferenceMessage()`
short-circuited to null on every subsequent turn and the executor permanently
lost the plan it was working on (exactly the long-session failure reported).

Clear `#planReferenceSent` right after `replaceMessages()` in both paths so the
next turn re-reads the plan from disk and re-injects it. The reset is a no-op
for ordinary sessions: the default plan path (PLAN.md in session-local scratch)
has no file on disk, so `#buildPlanReferenceMessage()` still returns null there.

Adds a deterministic regression test (short-circuited compaction, mock stream)
that fails before this change and passes after, plus a guard proving normal
sessions get no spurious plan injection.

Fixes #1246
2026-06-18 22:52:29 +02:00