Fix/compact disabled during approval - #10089
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7505c55feb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58fcadfd38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Theofanis Petkos <tpetkos@redhat.com>
58fcadf to
e97589a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e97589a687
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d8b6b4dbe
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36daaf9797
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
I've added more tests to capture the fix, but also the further changes requested by copilot. Now I've also added This means if we have large tool output this can go undetected by the threshold check. An approach here would be to take the max of the stored value and a local estimate of the current conversation, so compaction triggers correctly even when the stored count is stale. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23e1c62bf4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Regression audit follow-up for the aaif-goose/goose#10089 port. The initial merge kept upstream's max(stored, estimated) compaction trigger, but accidentally restored per-message token estimation. Gosling had already moved to a single conversation pass to avoid repeated per-request primer overhead. Keep that local behavior while still using max(stored, estimated) so large tool outputs can trigger compaction. Gate: source bin/activate-hermit && cargo fmt && cargo test -p goose --test compaction
|
Thanks for this @thepetk! The one-line UI fix here — disabling the Compact now button while a request is in flight ( The backend changes, though, go well beyond "compact button disabled during approval" and I'd like to drop them from this PR:
These are all reasonable things to discuss, but they're distinct features/semantics changes that deserve their own issue and review rather than riding in under a UI-button bugfix. Could you strip this PR down to just the button disablement? If you'd like to pursue the mid-loop compaction / token-recount behavior, let's open an issue to discuss the approach first. |
Yeah @DOsinga I think you have a fair point. Just tried to handle this as an "easy fix", mostly for my own curiosity on how we could handle this on the backend, but I do agree it's not. That said, I'll remove this part from the PR and proceed only with the UI fix. |
Signed-off-by: thepetk@gmail.com <thepetk@gmail.com>
23e1c62 to
98410be
Compare
@DOsinga I've updated the PR I would be happy to start a discussion over the auto-compaction. Could do first a more thorough investigation and then bring it up here or in discord. Do you think it would worth the effort? |
DOsinga
left a comment
There was a problem hiding this comment.
Thanks — this is now focused on the UI regression, and I removed the redundant AlertBox tests that did not cover the changed wiring.
Thanks! Then I guess my "assisted-by" is not accurate anymore :D cause the only contrib left was those tests @DOsinga let me know if I should do anything further to merge it |
- feat: allow askai bot to read issues and PRs (aaif-goose#10398) - fix: Fix Gemini OAuth onboarding (aaif-goose#10363) - chore: remove unavailable models from cerebras catalog (aaif-goose#10407) - feat(cli): Fix output.rs merge conflicts - chore(deps): bump actions/stale from 10.3.0 to 10.4.0 (aaif-goose#10371) - chore(deps): bump dorny/paths-filter from 4.0.1 to 4.0.2 (aaif-goose#10370) - chore(deps): bump actions/cache from 6.0.0 to 6.1.0 (aaif-goose#10374) - fix: treat empty-string finish_reason as non-terminal in streaming (aaif-goose#10258) - chore(deps): bump step-security/harden-runner from 2.19.4 to 2.20.0 (aaif-goose#10372) - chore(deps): bump docker/login-action from 4.2.0 to 4.4.0 (aaif-goose#10373) - test: drop unavailable and preview Gemini smoke models (aaif-goose#10355) - fix(ui): restore pnpm 11 project configuration (aaif-goose#10395) - Fix/compact disabled during approval (aaif-goose#10089) - fix(prompt): make prompt timestamps timezone-explicit (aaif-goose#10209) - fix: preserve reasoning_content for DeepSeek thinking mode on multi-turn tool calls (aaif-goose#10366) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
The PR addresses an issue with the
Compact nowbutton which was clickable while the agent had pending approvals, however this wasn't possible on the backend. I think is because of this and I believe that's the right behavior. In my PR I'm just disabling the button whenisLoadingisTrue.Testing
Compact Now Button
just run-ui).main: button is enabled and fires.AlertBox.test.tsxcovering the disabled state while loading.Related Issues
Relates to #9958
Discussion: LINK (if any)
Screenshots/Demos (for UX changes)
Before: "Compact now" button remains active (clickable) while agent is streaming.
After: "Compact now" button is disabled (greyed out,
not-allowedcursor) while agent is streaming; re-enables once the stream finishes.Assisted-by: Claude Sonnet 4.6