-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Autocompact + One Shot Summarization algorithm #3559
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
|
nice - taking for a spin |
|
nice @katzdave - seems to work well, I will use it a bit more as a daily thing and see if I can abuse it more! lets get this in! |
|
did hit a snag, I told it to look at ~/.local/share/goose/sessions for jsonl to extract themes, and it ran up quite the context: might be able to reproduce it with things like that (jsonl is good as there is lots of stuff buried in there in single lines to mess it up), but then again, may not be related? I did ask it a few things and a few times to get it to run up a big session) |
I changed the context counting a bit, as it was annoying me that the context didn't update until the next message. I ripped that out into another branch though, and am trying to get things in a row there. |
* 'main' of github.com:block/goose: (23 commits) fix: add fallback id to messages if none provided (#3584) feat: migrate ErrorData from internal mcp crates to rmcp version (#3586) fix: adjust subrecipe description to allow running tests (#3585) Scenario tests (#3430) feat: migrate JsonRpcMessage/Request/Response/Error/Notification from internal mcp crates to rmcp versions (#3564) Restore recipe parameters functionality (#3530) feat: Enhanced loading states with thinking icons and flying bird animation (#3478) Agent loop defensive (#3554) chore: remove needless clone() in goose/providers (#2528) Add recipe install warning (#3537) Replace mcp_core::resource::* with rmcp types (#3563) Add YouTube video embed to using-goosehints.md (#3560) fix: ensure retry-config and success-criteria are populated in openapi spec (#3575) fix: use sequential when sub recipe task is 1. (#3573) fix: track message id to keep like with like (#3572) Replace mcp_core::prompt with rmcp::model types (#3561) feat (ui): close recipe modals with esc key (#3568) feat: recipes can retry with success criteria (#3474) Env var to set Ollama request timeout (#3516) Updating docs to match new UI (#3552) ...
* 'main' of github.com:block/goose: Remove mcp_macros and unused types (#3581)
|
@katzdave this is my take on auto compact: #3600 still trying it out - so not sure how good, but thought you may find it interesting where to put the calls to compact - client end still seems easier (vs moving to agent and changing how api looks) - but take a look if it helps. I have seen it autocompact once (but it seemed to stall before it hit it - so may not be quite right) - it did autocompact down to 1K tokens (should it be that low?) eg:
|
* 'main' of github.com:block/goose: docs: use installer component for tutorial, add updating extensions section (#3608) fix: show token alert popover during agent responses and agent failure cases (#3536) reuse the cancellation token in the agent level (#3599) Docs: Move MongoDB tutorial to MCP section (#3602) docs: desktop recipe format (#3594) Fix model display name not being updated immediately after leaving settings (#3587) Added option to summarize the chat when an error is triggered (#3598)
Co-authored-by: Zane <[email protected]> Co-authored-by: dianed-square <[email protected]> Co-authored-by: Rizel Scarlett <[email protected]> Co-authored-by: Lifei Zhou <[email protected]> Co-authored-by: David Katz <[email protected]>
* 'main' of github.com:block/goose: Adds the `WaitingForUserInput` state (#3620) docs: update extensions library (#3612) Fixing grants path (#3632) docs: June 2024 Community All-Stars Spotlight (#3631) grant program (#3630) Lifei/sub recipe desktop temp (#3576) docs: local LLMs context size tip (#3454) fix: Handle non-default base path for OpenAI compatible model fetching (#3566) Goose security updates (#3579) fix: multi-tool calls in streamed openai-compatible responses (#3609) feat: subagent turn count, simple agent loop (#3597) feat: subagent independent extension manager (#3596) Improve session history loading resiliency (#3588) Added logging and changed default route case to not redirect to home when there is an invalid route (#3610) fix: chat sidebar layout overlapping content occasionally (#3590) fix: loading shared sessions (#3607)
|
@katzdave I did have a quick look (but failed) to see if it would be easy to add it to the main agent loop - but I wasn't sure if we still had the summarizer that runs when it fills up (if we don't, we may need to add something like it back in on a higher threshold but not waiting for user input to trigger) to avoid running up against the limit when it is in the agent loop |
One idea I chatted with Douwe about is to potentially have a tool for the agent to decide itself to autocompact + combined with task tracking that should help resume after compaction; I worry if we compact in the middle of an agent loop it might get pretty lost whereas with those signals it can start fresh a bit more cleanly. I also think that marking a task as done provides a strong signal that the agent might be in a decent resting point to potentially compact or feed in new user context. Working on some token counting fixes, but I think adding to the agent loop makes sense as a next wave effort. |
|
I also swapped in a 50% more summarize prompt. I don't notice much of a difference. |
* 'main' of github.com:block/goose: docs: Add GitMCP Tutorial to Extensions Library (#3716)
|
@katzdave in that case do you think we should we have task tracking in this PR (if we can make it work) - or anther PR (could also move it to developer MCP if that made it easier) - or is over loading it? "tool for the agent to decide itself to autocompact + combined with task tracking" yes - so you think compact is itself a tool to call? (or just part of agent loop + heuristics so it isn't an extra tool call?) |
| 8. **Current Work** – Active work at summary request time: filenames, code, alignment to latest instruction | ||
| 9. **Next Step** – *Include only if* directly continues user instruction | ||
|
|
||
| > ⚠️ No new ideas unless user confirmed |
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.
not sure about how many tokens an emoji uses?
…o separate function
token_debug/Cargo.toml
Outdated
| @@ -0,0 +1,10 @@ | |||
| [package] | |||
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.
this intended to be here or should be in existing test code dir?
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.
Nope, deleted
* 'main' of github.com:block/goose: feat: Allow configuring hints filename(s) (#3269) Add support for mouse back nav button to Settings screen (#3195) chore: Remove the wrong tailwind package (#3754) chore: fix typo in desktop readme for goosed (#3752) feat: upgrade rmcp (#3738) feat: allow users view and edit their non-secret config's (#3005) fix: View extensions link (#3751) chord: refactor tool route (#3732)
* main: Increase req body limit (#2965) Stable goose info -v (#3760) Speed up app initialization and improve refresh crashing (#3717) docs: consolidate search session content, doc import recipe (#3759) Improve power save blocker mechanism (#3698) Ensure adding/removing extensions refreshes extensions list (#3695) Env parsing for primitive types (#3706) Autocompact + One Shot Summarization algorithm (#3559) fix: initial prompt not filled in after accepting new recipe (#3637) fix not being able to click on searchbar buttons in chat (#3723) center session summary modal description text (#3737) Persist first message to local history in case of failure or cancellation (#3744) Make the client more secure (#3742) feat: Allow configuring hints filename(s) (#3269) Add support for mouse back nav button to Settings screen (#3195) chore: Remove the wrong tailwind package (#3754) chore: fix typo in desktop readme for goosed (#3752) feat: upgrade rmcp (#3738) feat: allow users view and edit their non-secret config's (#3005) fix: View extensions link (#3751)
* main: fix: don't return full shell output when very large (#3750) fix: cli tool logging (#3749) Increase req body limit (#2965) Stable goose info -v (#3760) Speed up app initialization and improve refresh crashing (#3717) docs: consolidate search session content, doc import recipe (#3759) Improve power save blocker mechanism (#3698) Ensure adding/removing extensions refreshes extensions list (#3695) Env parsing for primitive types (#3706) Autocompact + One Shot Summarization algorithm (#3559)


Replaces the summarization algorithm with a single prompt variant.
Auto-compact uses GOOSE_AUTO_COMPACT_THRESHOLD to determine if we should compact the session. Triggers this check after every user message.