Skip to content

fix(context): retain live-context notices across append-only turns - #267

Merged
ZouR-Ma merged 1 commit into
mainfrom
fix/stable-live-context-notices
Oct 19, 2026
Merged

ZouR-Ma merged 1 commit into
mainfrom
fix/stable-live-context-notices

Conversation

@ZouR-Ma

@ZouR-Ma ZouR-Ma commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

Live-context status and pressure notices were appended only to the current request view. Once consumed, they disappeared from the following request. Ordinary continuation therefore stopped being append-only even when the canonical conversation had not changed, potentially disrupting prompt-prefix cache reuse.

Changes

  • Retain request-only notices at their original message boundaries during append-only turns.
  • Reuse notice content and timestamps on retries without duplicating notices.
  • Clear retained notices when the input projection changes or shrinks, rather than replaying stale advice into an edited or compacted context.
  • Add unit coverage for ordering, retries, context changes and unchanged canonical messages.
  • Extend the AgentSession integration test to verify prefix stability after an accepted context edit and a subsequent user continue.
  • Document the notice lifecycle.

Behavior and compatibility

Only model-facing live-context notice retention changes. Notices remain outside the canonical transcript. User messages, tool permissions, schemas, provider configuration and public entry points are unchanged. Intentional context edits and compaction remain supported and start a fresh retained-notice epoch. No configuration migration is required.

Validation

On macOS with Node.js 24.3.0:

  • pnpm run check — passed.
  • cd packages/coding-agent && pnpm exec vitest --run test/stable-context-notices.test.ts test/live-context-manager.test.ts test/suite/agent-session-live-context.test.ts test/request-dump.test.ts — 61 tests passed. The request-dump tests are local diagnostic work and are not included in this PR.
  • TMPDIR=/tmp ./test.sh — passed, including the workspace test suites. The initial default-TMPDIR run hit a macOS tsx IPC socket EINVAL with a long temporary path; the short-path rerun passed.
  • git diff --check — passed.

Limitations

This fixes the identified one-shot notice lifecycle, not every potential source of cache misses. It does not establish the root cause of historical sessions for which final request payloads are unavailable. Other extension context transformations are unchanged. Retained notices are request-view state and are not restored across process restarts. CI results are pending.

@ZouR-Ma
ZouR-Ma merged commit 325f63c into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant