Fail agent loop eagerly on auto compaction failure#10934
Fail agent loop eagerly on auto compaction failure#10934charley-oai wants to merge 4 commits intomainfrom
Conversation
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbaee85aa5
ℹ️ 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 review this |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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 review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e248815b2
ℹ️ 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".
| if total_usage_tokens >= auto_compact_limit | ||
| && let Err(err) = run_auto_compact(&sess, &turn_context).await | ||
| { | ||
| emit_auto_compact_error(&sess, &turn_context, err).await; | ||
| return None; |
There was a problem hiding this comment.
Preserve user input when auto-compact fails early
When total_usage_tokens >= auto_compact_limit and auto‑compaction fails, this path returns early before record_user_prompt_and_emit_turn_item runs. That means the user’s input for the turn is never recorded into session history, so subsequent turns will omit that message and a retry won’t have the expected context. This only happens when auto‑compaction fails (e.g., 500/context errors), and is inconsistent with other error paths that still record the user prompt before failing.
Useful? React with 👍 / 👎.
Previously we just emitted a UI error event; this may be an artifact of the
/compactdays where users could run/compactand keep going if it failed