Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f9e31c7e3
ℹ️ 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".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb5c3bf95d
ℹ️ 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".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdb88ca2f5
ℹ️ 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".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Fixed the four latest findings in cca2e11. Seven targeted compaction/config regressions passed; fmt/lint passed, and workspace all-target/all-feature Clippy passed after fixing a collapsible-if warning. The subsequent broad test run was cancelled, so no fresh aggregate pass is claimed. @codex review |
# Conflicts: # xtask/src/legacy-sleeps.txt
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cca2e11c8f
ℹ️ 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".
| let inherited_prefix = provider_rejected_window && reducible_messages > 0 && !run.inherited_compaction_attempted | ||
| && sessions::in_run_compaction_boundary(&messages[run_start..], sessions::CONTEXT_PRUNE_KEEP_TURNS).is_none(); |
There was a problem hiding this comment.
Do not compact a synthetic summary-only prefix
When a prompt was admitted through the summary-only fallback (sessions/execution.rs:1784), reducible_messages is 1 even though that synthetic opening deliberately omits retained rows after the latest marker. If the provider then rejects this request for context overflow, this condition treats the opening as the complete inherited prefix; the helper summarizes only that message but commits an unscoped marker through the ordinal immediately before the active prompt. Subsequent replay therefore excludes those omitted post-marker runs from model context without ever summarizing them. Preserve the represented cutoff with the live prefix and either reload the complete span before compacting or disable inherited-prefix recovery for summary-only admission.
Useful? React with 👍 / 👎.
| if !summary_text.is_empty() && !summary_continues_truncated_turn { | ||
| summary_text.push('\n'); | ||
| // A later non-continuation reply supersedes a | ||
| // completed partial fold, rather than joining it. | ||
| summary_text.clear(); |
There was a problem hiding this comment.
Preserve faulted-turn fragments on retry
When an internal compaction turn streams text and then hits a recoverable provider fault, the run loop persists that partial assistant message and appends TURN_RETRY_CONTINUE_NOTICE before retrying (runtime/run_loop.rs:2341-2374), but the event's truncated flag remains false. Consequently summary_continues_truncated_turn is false and this branch clears the partial text when the continuation completes. A between-run or manual compaction can therefore fail required-section validation or commit an incomplete summary after successfully recovering from a mid-stream transport fault. Track fault-driven continuations as continuations too, and clear accumulated text only when a genuinely new fold response supersedes it.
Useful? React with 👍 / 👎.
| && (reducible_messages > 0 && !run.inherited_compaction_attempted || sessions::in_run_compaction_boundary( | ||
| &messages[reducible_messages.saturating_add(1)..], | ||
| sessions::CONTEXT_PRUNE_KEEP_TURNS, | ||
| ) | ||
| .is_some(); | ||
| ).is_some()); |
There was a problem hiding this comment.
Allow inherited recovery after compacting active turns
When an overflowing request contains both inherited history and enough active-run turns to compact, the preparation path chooses the active-run boundary first. After that compaction the request is retried at the same turn_ordinal, but reactive_compaction_turn remains set to that ordinal, so a second provider context rejection cannot enter this newly added inherited-prefix alternative. A provider whose actual limit requires reducing both spans therefore still fails even though the inherited prefix remains reducible. Rearm recovery after a successful compaction or track the attempted target so one active-run pass and one inherited-prefix pass can occur without resending an unchanged request.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1477c113c8
ℹ️ 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".
| let message = error.to_string(); | ||
| if rejected_before_work | ||
| && kind == RunFailureKind::ProviderContextExceeded | ||
| && ordinal < 64 |
There was a problem hiding this comment.
Track fold splits instead of total turn ordinal
When an in-run fold has already produced 64 turns—for example, 16 portions that each needed three output continuations—this guard rejects a later context-overflow split even though SummaryFold still has capacity under its 32-split limit. A sufficiently oversized transcript can therefore fail on a remaining portion solely because earlier portions required continuations; gate on the number of splits, as the regular session fold path does, rather than on the cumulative provider-turn ordinal.
Useful? React with 👍 / 👎.
| credential_profile, | ||
| max_output_tokens, | ||
| context_window: metadata.and_then(qq_config::ModelMetadata::context_window), | ||
| context_window: provider.model_context_window(snapshot.model().model()), |
There was a problem hiding this comment.
Propagate inferred limits to delegation roster entries
When a recognized Custom/LiteLLM alias is configured as a delegation target rather than the selected route, this effective-limit lookup is bypassed: delegation_roster still populates each entry from raw ModelMetadata::context_window at src/runtime.rs:3531. The compiled system prompt therefore omits the child model's known context capacity even though spawning that same route uses the inferred limit, so the parent receives inconsistent routing guidance; use ProviderConfig::model_context_window for roster entries too.
Useful? React with 👍 / 👎.
| if self.splits >= 32 { | ||
| return false; | ||
| } | ||
| let Some(instruction_at) = messages.iter().rposition(|message| message.content().iter().any(|block| matches!(block, qq_provider::ContentBlock::Text { text } if text.contains(crate::sessions::COMPACTION_INSTRUCTION)))) else { |
There was a problem hiding this comment.
Identify the actual compaction instruction message
When a truncated summarizer reply echoes COMPACTION_INSTRUCTION and the subsequent continuation request overflows, this reverse substring search selects the echoed assistant message instead of the original user instruction. split then places an assistant message at the end of each restarted request and treats the real instruction as transcript evidence, so the retry may no longer ask the model to summarize and can fail validation despite further splitting being possible; match the expected user instruction by role and exact shape.
Useful? React with 👍 / 👎.
What changed
Fix the SQLite-audited LiteLLM/Bedrock Opus failure: missing model context metadata disabled proactive compaction, then both prompt and manual summarization overflowed.
Design
Reuse owned compaction cancellation, budgets and transactional markers. No protocol or SQLite schema change. Tool calls/results become inert evidence only during fallback. At most 32 splits. Addresses both ordinary request overflow and overflow of the summarizer itself, informed by Codex local compaction and OpenCode. Updated as-built architecture docs.
Verification
Regression tests cover same-prompt inherited overflow, oversized summarizer recovery/replay, and manual folding consuming both transcript ends while committing only the final summary. Existing cancellation/budget/failure coverage remains enabled.
cargo xtask check
Head
5f9e31c7e30cvsorigin/main; 17 changed file(s); scope: qq, qq-client, qq-config, qq-core, qq-harness, qq-server, qq-tui, xtask.cargo fmt --all -- --checkcargo xtask lintcargo clippy --color never -p qq -p qq-client -p qq-config -p qq-core -p qq-harness -p qq-server -p qq-tui -p xtask --all-targets --all-features -- -D warningscargo nextest run --color never --profile default -p qq -p qq-client -p qq-config -p qq-core -p qq-harness -p qq-server -p qq-tui -p xtaskAll gates passed in 322.3s.
cargo xtask smoke: 9 passed, 0 failed on final head.Limits
Provider outages, exhausted budgets and irreducible fixed prefixes can still prevent success; failures preserve stored history. No live-provider repair of the original session was attempted; the user DB was read-only throughout. Recovery can add summarizer requests; no cost/latency benchmark was run.