Skip to content

fix(coding-agent): preserve goal context - #316

Merged
Pepps233 merged 1 commit into
mainfrom
fix/goal-recovery-protected-context
Nov 7, 2026
Merged

Pepps233 merged 1 commit into
mainfrom
fix/goal-recovery-protected-context

Conversation

@Pepps233

@Pepps233 Pepps233 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve protected goal-mode context during emergency recovery while archiving eligible older history.
Keep the latest request, project instructions, incomplete tool exchanges, and the recent assistant exchange available verbatim.

Reasoning

Emergency recovery previously used a contiguous compaction boundary that could remove protected messages.
Recovery now selects eligible entries and replays protected history around the archived range.
Summary generation uses the model's available output capacity so reasoning summaries are not cut off by the ordinary response headroom limit.

Changes

  • Preserve protected entries across recovery, export, resume, and forks.
  • Reject compaction when the active request or system context changes during summarization.
  • Add faux-provider coverage for protected blocks, summary budgets, and recovery lifecycle behavior.
  • Carry forward the README link to SWE-Marathon data from the original working tree. Its target under docs/ is currently ignored and is not in this PR.

Testing

  • npm run check passed on this main-based branch.
  • Focused goal-mode tests passed: 14 files, 88 tests.
  • ./scripts/test.sh did not pass in this sandbox: 416 passed, 10 failed, and 6 were canceled in the script tests. The failures involved owner-private temporary directory checks, denied local sockets, and absent built distribution files.

- Keep protected requests, instructions, and tool exchanges through emergency recovery.
- Allow reasoning summaries to use available context and output capacity.
@Pepps233 Pepps233 self-assigned this Nov 7, 2026
@Pepps233
Pepps233 marked this pull request as ready for review November 7, 2026 14:14
@Pepps233
Pepps233 added this pull request to stack #318 November 7, 2026 14:22
@Pepps233
Pepps233 merged commit 8025c3e into main Nov 7, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant