-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Run remote auto compaction #6879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
ℹ️ 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-rs/core/src/codex.rs
Outdated
| ) | ||
| .await; | ||
| } | ||
| compact::run_inline_auto_compact_task(sess.clone(), turn_context.clone()).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid double-running local compaction after remote
When token_limit_reached is true, we now call run_inline_remote_auto_compact_task (which replaces the conversation history with the remote-compacted summary) but then immediately call compact::run_inline_auto_compact_task on line 1906. That second call re-runs the legacy inline compaction and overwrites whatever the remote task just produced, so the new remote auto-compaction path can never take effect and we still spam the legacy summary. It also doubles the amount of compaction work every time the feature is enabled. Please skip the local inline call when the remote path runs so the remote result is preserved.
Useful? React with 👍 / 👎.
codex-rs/core/src/compact_remote.rs
Outdated
| message: format!("Error running remote compact task: {err}"), | ||
| }); | ||
| sess.send_event(&turn_context, event).await; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sending token usage to indicate that the limits has been rested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave this to @jif-oai to follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was already the case but got cleaned here: #6894
Inline compact tasks no longer emit events directly; instead `run_remote_compact_task_inner` now wraps an impl function to standardize success/error events. Update callers to use imported helpers and adjust tests to assert the completion message.
No description provided.