Skip to content

fix(core): recover context overflow automatically - #436

Merged
lg2m merged 9 commits into
fix/compaction-retentionfrom
fix/compaction-recovery
Oct 23, 2026
Merged

lg2m merged 9 commits into
fix/compaction-retentionfrom
fix/compaction-recovery

Conversation

@lg2m

@lg2m lg2m commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #434. Reconciles #371, including its unpublished transport-retry correction, with current main.

Oversized task and summarizer requests recover inside the same prompt. Inherited compaction reloads the complete durable span its marker covers. Both summary paths share bounded splitting and capture the actual instruction position; continuations, partial text, cumulative limits and zero-work spend receipts survive recovery. Gateway limits agree across execution, delegation and headless records. Removed obsolete turn and duplicate split counters.

Normal recovery requires no /compact; manual compaction stays optional. A split resets the abandoned response's recovery allowances. Empty intermediate summaries stop before consuming evidence or dispatching the next portion; empty final responses cannot reuse a preceding summary. Failed summaries leave the original transcript and cutoff intact. No protocol or storage schema change.

Verified commit 3c43702c: full cargo xtask check --base origin/fix/compaction-retention passed (2,545 tests, 15 skipped), plus all 11 CLI/server smoke scenarios. All three review findings and the exhausted transport-retry case have failing-before, passing-after regressions; 115 focused compaction tests passed. The real isolated server recovered from task and summarizer overflows, consumed all four history portions, wrote the artifact once and retained its live prefix after restart, all before any manual compaction. A separate empty-intermediate test preserved the prior marker and stopped further provider work; optional manual compaction then succeeded. Reviewed the diff and fold state transitions locally.

An older fixed-request-count assertion now checks bounded shrinking requests, full source coverage and exact prompt sends because complete-span recovery needs additional requests. Persistent provider faults, exhausted budgets and irreducible input still report failure with history intact. Exact instruction retention and complete history retrieval remain separate task #5 slices.

lg2m commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T04:46:49.606694Z 3c43702 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8e297e2e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved

lg2m commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f0e9f6ea7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lg2m commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 3c43702cc2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lg2m
lg2m added this pull request to stack #438 October 23, 2026 05:20
@lg2m
lg2m merged commit 3deef4e into main Oct 23, 2026
7 checks passed
@lg2m
lg2m deleted the fix/compaction-recovery branch October 23, 2026 06:07
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