Skip to content

fix(context): consume resumed deltas without tool cache - #7424

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/context-retained-baseline-reading-20261027
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/context-retained-baseline-reading-20261027

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A resumed native session can retain its model context while the tool process has lost earlier Code Mode variables. Treating that empty tool cache as context loss made a consumer read a complete delta and then fetch the full capture again. The native delta instruction now distinguishes these two lifetimes and directs the Agent to use the complete delta with retained context. Unavailable baseline content, uncertain continuity and compaction still require same-capture full recovery.

The change stays in the existing TypeScript context codec. It adds no state, protocol field, configuration, authority or caller entrypoint. Cold/full output, confirmed-input clients and invalid-continuity fallback are byte-for-byte unchanged in the focused comparison. Native deltas gain 365 instruction bytes; whether this reduces actual model rereads remains a live-behavior qualification, not a measured fee or task-outcome benefit.

Validation:

  • 25 TypeScript codec tests and 245 Python context/lifecycle/resume/caller tests passed.
  • Two real native process exit/resume and compaction-recovery cases passed with deterministic synthetic inference and no paid model calls.
  • Standard premerge passed all 14 selected canaries/smokes and the public-boundary check, plus whitespace and bilingual checks.
  • The new independent reader case uses only the serialized delta to read current selection, settlement and authority fields; actual baseline loss still falls back to the immutable full capture.
  • Bounded refactor review: no additional abstraction is useful for this instruction correction; the existing codec remains the sole owner. No installed-App, billed-cost or natural model-adoption claim.

中文:原生会话恢复后,模型上下文和 Code Mode 工具变量的生命周期不同。当前消费方曾因旧工具变量不存在,在读完差分后又读取全量。本修改在共享 codec 的原生差分指引中说明应使用保留的模型上下文与完整差分;所需基线不可用、连续性不确定和压缩后的原捕获恢复保持。冷启、确认输入的 Host 和失效回退字节不变;原生指引增加 365 字节,真实模型是否减少重读仍待实验验证。25 项 TS、245 项 Python、2 项真实原生合成链路以及标准 premerge 均通过,不宣称费用或解题收益。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

This branch has not been deployed

No deployments
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