Skip to content

Goose Simple Compact UX #4202

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Goose Simple Compact UX #4202

wants to merge 3 commits into from

Conversation

alexhancock
Copy link
Collaborator

@alexhancock alexhancock commented Aug 19, 2025

Improvements to the context management UX, making it much simpler and more consistent in the language it presents to users

Changes

  • No more UI in the chat itself other than simple markers that auto-compaction occurred, or the user compacted
  • "Compact now" button always in the alert popup about context
  • Session automatically continues for the user after the summarization occurs, keeping things moving without mentioning in any verbose way that the agent read a summary

Demo

Goose.Simple.Compact.mov

@alexhancock alexhancock marked this pull request as draft August 19, 2025 19:33
@alexhancock alexhancock mentioned this pull request Aug 19, 2025
@zanesq
Copy link
Collaborator

zanesq commented Aug 19, 2025

@alexhancock just a note to pull main and npm install, had to fix some dependencies from the upgrade

@alexhancock alexhancock force-pushed the alexhancock/context-ux branch 5 times, most recently from 7aa01ff to 9c26e47 Compare August 20, 2025 14:24
@alexhancock alexhancock changed the title alexhancock/context-ux Goose Simple Compact UX Aug 20, 2025
@alexhancock alexhancock force-pushed the alexhancock/context-ux branch 2 times, most recently from 2675a40 to 6e4c5e6 Compare August 20, 2025 15:51
@alexhancock alexhancock marked this pull request as ready for review August 20, 2025 16:00
@alexhancock alexhancock force-pushed the alexhancock/context-ux branch 2 times, most recently from 6f4216f to f210830 Compare August 20, 2025 18:54
@alexhancock alexhancock marked this pull request as draft August 20, 2025 20:51
@alexhancock alexhancock force-pushed the alexhancock/context-ux branch 9 times, most recently from 23e8de7 to dd2c7ea Compare August 21, 2025 15:49
@alexhancock alexhancock requested a review from katzdave August 21, 2025 15:51
@alexhancock alexhancock marked this pull request as ready for review August 21, 2025 15:51
@@ -242,7 +229,7 @@ function BaseChatContent({
const { createNewSessionIfNeeded } = useSessionContinuation({
chat,
setChat,
summarizedThread,
summarizedThread: [],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zanesq I wanted to ask you about this one. Can you clarify why the useSessionContinuation hook needed the summarized thread before? Likely need to make some kind of change here before going ahead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this new architecture has replaced what useSessionContinuation was doing so I think we can remove the hook completely now 👍

@alexhancock alexhancock requested review from zanesq and DOsinga August 21, 2025 15:56
@alexhancock
Copy link
Collaborator Author

.bundle

Copy link

macOS ARM64 Desktop App (Apple Silicon)

📱 Download macOS Desktop App (arm64, unsigned)

Instructions:
After downloading, unzip the file and drag the Goose.app to a location you prefer. The app is unsigned, so to run it run xattr -r -d com.apple.quarantine '/path/to/Goose.app' and then open the app

Copy link
Collaborator

@katzdave katzdave left a comment

Choose a reason for hiding this comment

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

Changes look nice overall; a little hard to parse the full diff on some of the file re-names. Taking it for a spin today though!

The previous message contains a summary that was prepared because a context limit was reached.
Do not mention that you read a summary or that conversation summarization occurred
Just continue the conversation naturally based on the summarized context
");
let assistant_message_tokens: usize = 14;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bump to 41.

new_token_counts.insert(0, compaction_marker_tokens);

// Add an assistant message to continue the conversation
let assistant_message = Message::assistant().with_text("
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a second message here now? Is the idea that this will become agent visible only, and the other one will be user visible only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is the idea that this will become agent visible only, and the other one will be user visible only

yes! to show the user a brief inline notification that compaction occurred, and give the model the deal of what happened and how it should behave when the session continues


// Store the original messages as ancestor messages so they can still be scrolled to
if (setAncestorMessages) {
const ancestorMessages = messages.map((msg) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ancestor messages just live in memory in the client and don't survive reload?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reload seems to be having trouble now (filed #4255) but I think it would behave the same as reloading a conversation without compaction. Can check after 4255 is resolved

@zanesq
Copy link
Collaborator

zanesq commented Aug 21, 2025

I noticed the new e2e tests aren't launching the app, are they working for you? Also I just pushed #4251 to main if you want to pull again so the pre-existing tests are passing.

@alexhancock alexhancock force-pushed the alexhancock/context-ux branch from dd2c7ea to c2c690b Compare August 21, 2025 18:23
const continuationMessage = convertedMessages[2];
if (continuationMessage) {
setTimeout(() => {
append(continuationMessage);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO here - look into putting the original user message in if context ran out entirely

@katzdave
Copy link
Collaborator

katzdave commented Aug 21, 2025

Noticed one issue where the green dot + context UI goes away right after a tool call. Comes back once goose returns control to the user. Auto-compact and button click flow seem pretty good.

Having a hard time testing the out of context case; seems like GOOSE_CONTEXT_LIMIT doesn't actually override the context in desktop (works on CLI display but also doesn't seem like it properly forces context_limit_exceeded errors); might do a separate fix for that as this is super annoying to test otherwise, but trying to just get a big session file I can drop in with too.

@katzdave
Copy link
Collaborator

Seems like scrolling is a little flaky too; not sure if related at all to the branch. But the agent loop seems to only force the scrolling sometimes. In particular the first time scrolling after the first user input doesn't seem to work.

@zanesq
Copy link
Collaborator

zanesq commented Aug 21, 2025

Seems like scrolling is a little flaky too; not sure if related at all to the branch. But the agent loop seems to only force the scrolling sometimes. In particular the first time scrolling after the first user input doesn't seem to work.

Might be better with #4257

@michaelneale michaelneale self-assigned this Aug 22, 2025
@michaelneale
Copy link
Collaborator

seems good so far @alexhancock - using it all morning and noothing surprising to me (not sure what I am quite looking for though). I did trigger a manual compact from GUI and did what I expected. Is there something I should look out for?

Also been using it in cli

@michaelneale
Copy link
Collaborator

I did get a token overrun though (cli) after a while:

ing("invalid_request_error"), "message": String("prompt is too long: 211596 tokens > 200000 maximum")}, "request_id": String("req_011CSNEjctXWn7P7aKQZq1S5")}). Returning error: ContextLengthExceeded("{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211596 tokens > 200000 maximum\"},\"request_id\":\"req_011CSNEjctXWn7P7aKQZq1S5\"}")
    at crates/goose/src/providers/utils.rs:110

Error: Context length exceeded: {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 211596 tokens > 200000 maximum"},"request_id":"req_011CSNEjctXWn7P7aKQZq1S5"}
The tool calling loop was interrupted. How would you like to proceed?
  error: The error above was an exception we were not able to handle.

which I have not seen in weeks, so not sure what is going on there.

@michaelneale michaelneale removed their assignment Aug 22, 2025
@katzdave
Copy link
Collaborator

#4284 fixes the summarize button in the UI at the end of the context to your error.

Saw some weird stuff rendered, but wasn't sure how to properly suppress that; not the end of the world though as we're targeting fixing this next with message metadata. (the top message is the summary which is also visible).
Screenshot 2025-08-22 at 11 50 14 AM

I also don't see the context window display green dot after resuming a session (but before finishing processing on the first message). I think if we fix the green dot to stop disappearing this should be good to go.

@alexhancock alexhancock force-pushed the alexhancock/context-ux branch from c2c690b to 829edbe Compare August 22, 2025 16:17
@alexhancock alexhancock force-pushed the alexhancock/context-ux branch 2 times, most recently from 4cf7136 to c2661cd Compare August 22, 2025 18:51
@alexhancock alexhancock force-pushed the alexhancock/context-ux branch from c2661cd to df861f6 Compare August 22, 2025 19:04
@alexhancock
Copy link
Collaborator Author

Updated demo screen capture

UX.mov

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.

4 participants