Skip to content

Fail agent loop eagerly on auto compaction failure#10934

Open
charley-oai wants to merge 4 commits intomainfrom
fail-agent-loop-on-auto-compaction-failure
Open

Fail agent loop eagerly on auto compaction failure#10934
charley-oai wants to merge 4 commits intomainfrom
fail-agent-loop-on-auto-compaction-failure

Conversation

@charley-oai
Copy link
Collaborator

Previously we just emitted a UI error event; this may be an artifact of the /compact days where users could run /compact and keep going if it failed

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

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

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: 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".

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

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

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: 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".

Comment on lines +3675 to +3679
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;
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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