Skip to content

feat(context): add CPG-06 stateless recovery-priority loop - #21

Open
Wibias wants to merge 6 commits into
agent/context-projection-cp05from
agent/context-projection-cp06
Open

feat(context): add CPG-06 stateless recovery-priority loop#21
Wibias wants to merge 6 commits into
agent/context-projection-cp05from
agent/context-projection-cp06

Conversation

@Wibias

@Wibias Wibias commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stack CPG-06 on CPG-05.
  • Add the minimum shared internal-tool event/loop machinery needed for context recovery.
  • Context recovery uses recovery-priority semantics: any generation containing __ocx_context_v1 is entirely internal, including simultaneous assistant text or real client tool calls.
  • Stale real actions are discarded and must be regenerated after exact recovery evidence is injected.
  • Correctable lookup/protocol mistakes (not_found, stale cursor, invalid range/query) are returned as bounded hidden-tool errors so the model can repair its lookup without forcing a full restart.
  • Hard recovery limits, cancellation, provider errors, or unsafe executor failures abandon the hidden trajectory and allow one canonical restart trajectory. Normal bounded transport retry/failover may operate only after that hidden trajectory is abandoned; the bound is one canonical restart, not one physical network send.
  • Native OpenAI Responses passthrough now reaches the epoch resolver as an explicit representation boundary, so passthrough chains never start or resume CPG metadata.
  • Media-loop behaviour remains separate and unchanged in this stage.

Deep-review hardening

  • add a core-level regression for the native-passthrough epoch boundary;
  • freeze the provider-visible recovery-tool JSON for the v1 policy epoch;
  • identify duplicate receipts by source tool and occurrence when call ids repeat;
  • make planner cancellation polling independent of UTF-16 code-unit alignment;
  • cover a 10 MiB one-line result without canonical mutation;
  • keep hard byte/call/scan budgets fail-open while returning correctable lookup errors to the hidden model.

TDD

The original first commit is intentionally RED. It pins mixed-call suppression, multiple recovery calls, round limits, canonical immutability, and hidden-usage aggregation before implementation lands.

The deep-review hardening also landed tests-first and was verified with the focused projector, recovery protocol/loop, passthrough-boundary, and hardening suites before the clean branch was pushed.

Stack

@github-actions github-actions Bot added the enhancement New feature or request label Aug 15, 2026
@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title feat(context): add CP-06 stateless recovery-priority loop feat(context): add CPG-06 stateless recovery-priority loop Aug 16, 2026
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from 7c67d61 to 8b9bfef Compare August 16, 2026 02:06
@Wibias
Wibias force-pushed the agent/context-projection-cp05 branch from cd37948 to 027c9c9 Compare August 16, 2026 02:31
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch 2 times, most recently from 05fb2ea to 8f32b98 Compare August 16, 2026 02:47
@Wibias
Wibias force-pushed the agent/context-projection-cp05 branch from 027c9c9 to 57ce12a Compare August 16, 2026 03:06
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from 8f32b98 to eab5a3d Compare August 16, 2026 03:07
@Wibias
Wibias marked this pull request as ready for review August 16, 2026 03:13
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from 4054492 to 465d0e6 Compare August 16, 2026 03:14
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp06 branch from 2624d7f to 89259be Compare August 16, 2026 04:46
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp05 branch from 50e410c to bef1aa2 Compare August 16, 2026 05:03
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 42c5dc1a-0669-46e3-8ec7-ba781bd69e57

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot force-pushed the agent/context-projection-cp06 branch from c93d127 to 6fb741f Compare August 16, 2026 05:03
@Wibias
Wibias force-pushed the agent/context-projection-cp05 branch from bef1aa2 to cae07a1 Compare August 16, 2026 20:42
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from 6fb741f to 98c2fee Compare August 16, 2026 20:42
@Wibias
Wibias force-pushed the agent/context-projection-cp05 branch from cae07a1 to 0570de2 Compare August 16, 2026 20:51
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from 98c2fee to d0d8e81 Compare August 16, 2026 20:51
@Wibias
Wibias force-pushed the agent/context-projection-cp05 branch from 0570de2 to bfbde30 Compare August 16, 2026 23:20
Wibias and others added 6 commits August 17, 2026 01:20
@Wibias
Wibias force-pushed the agent/context-projection-cp06 branch from d0d8e81 to 57f5ca9 Compare August 16, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant