-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add Message Metadata for Visibility Control #4538
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
- Remove display and sendToLLM fields from TypeScript Message interface - Remove ancestor messages concept (redundant with server-side metadata) - Update convertApiMessageToFrontendMessage to not set visibility flags - Fix all test files to remove references to display/sendToLLM - Trust server-side filtering as single source of truth for message visibility - Simplify client to just display all messages it receives from server
…data * 'main' of github.com:block/goose: feat(acp): Read files (#4531)
…data * 'main' of github.com:block/goose: docs: add ampersand to link (#4560) Add video link to README for user guidance (#4553) docs: social channels (#4552) feat: simplify navigation, make reload work (#4498) docs: new recipe warning (#4545) Add AGENTS.md for AI coding assistant support (#4539) docs: non-interactive compact now (#4543) fixed css classes and added some accessibility fixes (#4492)
…data * 'main' of github.com:block/goose: improve auto scroll to bottom + detection (#4504) Fix unable to get access to microphone in Mac app (#4571) Use middleware to verify secret key (#4338) adding Vercel MCP (#4562) docs: reorganizing CLI commands (#4566) Desktop import yaml recipes (#4544)
alexhancock
left a comment
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.
From an API design perspective I wonder if we should consider reusing the concept of "audience". MCP resource annotations for example have the concept of:
audience: ['user' || 'agent']
https://modelcontextprotocol.io/specification/2025-06-18/server/resources#annotations
I am fine to go with the PR as is though as I think having this controlled in the agent is a great step forward! Then can continue to discuss the properties of MessageMetadata
Just flagging it to you now in case you agree audience would be a good idea, and it's not too big a refactor
crates/goose/src/agents/context.rs
Outdated
|
|
||
| // Add an assistant message to continue the conversation (agent_visible=true, user_visible=false) | ||
| let assistant_message = Message::assistant() | ||
| .with_text("The previous message contains a summary that was prepared because a context limit was reached.") |
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.
The
Do not mention that you read a summary or that conversation summarization occurred
Just continue the conversation naturally based on the summarized context
seemed helpful to me before in getting it not to make a big deal of the fact that it just read a summary. sometimes it still mentions it, but not nearly as much as if these instructions are removed. given the summary is only visible to the agent, and we want it to feel like we've just continued the conversation I wonder if we can keep this in?
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.
Or does this have a better solution now, always inserting the last user message as well?
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.
Ack added this back. This message is agent visible only so should definitely go with what we tested more.
Ideally this should behave about the same as before; I was mostly testing that session reload seemed to have a reasonable state.
The cool part is we have lots more levers to tweak now; For example since we're keeping all user messages forever, maybe these are actually useful to leave in the session or inject directly in the future summaries.
…data * 'main' of github.com:block/goose: refactor: add new recipe dependency updater (#4596) chore: fix nightly builds to have tags (#4595) feat: Import file contents from recipe 'file' input type parameter (#4558) also adding this change to the api key send for recipes (#4587) Fix local (working directory) recipes storage (#4588) fix: don't redact tool calls (#4589) Prompt injection detection (simplified - only pattern matching) (#4237) feat: add streaming support to Tetrate Agent Router Service provider (#4477) docs: goosehints updates (#4581) Iand/recipe scanner updates (#4584) patching recipe scanning workflows for permissions changes (#4579) fix: onboarding endpoints send token secret (#4575) Fix : Google AI schema validation by adding missing array items fields (#4569) Add unified diff support to text editor (#4522)
Good callout, agree that MessageMetadata does a pretty good job of encapsulation so we could probably follow up with that change if we want to match that pattern a little more directly. |
* main: (29 commits) docs: update built-in extensions list and fix link (#4601) Add Message Metadata for Visibility Control (#4538) Remove deprecated Claude 3.5 models (#4590) Remove unused loadRecipe function (#4599) Send the secret with decodeRecipe (#4597) fix markdown links overflowing content and hide agent link previews (#4585) refactor: add new recipe dependency updater (#4596) chore: fix nightly builds to have tags (#4595) feat: Import file contents from recipe 'file' input type parameter (#4558) also adding this change to the api key send for recipes (#4587) Fix local (working directory) recipes storage (#4588) fix: don't redact tool calls (#4589) Prompt injection detection (simplified - only pattern matching) (#4237) feat: add streaming support to Tetrate Agent Router Service provider (#4477) docs: goosehints updates (#4581) Iand/recipe scanner updates (#4584) patching recipe scanning workflows for permissions changes (#4579) fix: onboarding endpoints send token secret (#4575) Fix : Google AI schema validation by adding missing array items fields (#4569) Add unified diff support to text editor (#4522) ...
* main: (30 commits) docs: update built-in extensions list and fix link (#4601) Add Message Metadata for Visibility Control (#4538) Remove deprecated Claude 3.5 models (#4590) Remove unused loadRecipe function (#4599) Send the secret with decodeRecipe (#4597) fix markdown links overflowing content and hide agent link previews (#4585) refactor: add new recipe dependency updater (#4596) chore: fix nightly builds to have tags (#4595) feat: Import file contents from recipe 'file' input type parameter (#4558) also adding this change to the api key send for recipes (#4587) Fix local (working directory) recipes storage (#4588) fix: don't redact tool calls (#4589) Prompt injection detection (simplified - only pattern matching) (#4237) feat: add streaming support to Tetrate Agent Router Service provider (#4477) docs: goosehints updates (#4581) Iand/recipe scanner updates (#4584) patching recipe scanning workflows for permissions changes (#4579) fix: onboarding endpoints send token secret (#4575) Fix : Google AI schema validation by adding missing array items fields (#4569) Add unified diff support to text editor (#4522) ...
Signed-off-by: Matt Donovan <[email protected]>
|
Hello, it's possible that this pull request introduced a regression: #4635 |
Signed-off-by: HikaruEgashira <[email protected]>
Summary
This PR introduces a new message metadata system to centralize visibility control on the server-side and significantly simplifies the client-side message handling by removing redundant visibility flags and ancestor message tracking.
Key Changes
🏗️ Core Architecture Changes
Server-Side (Rust)
MessageMetadatastruct withuser_visibleandagent_visibleflagsMessagestruct with metadata field and visibility methods:user_only()- visible only to user, not agentagent_only()- visible only to agent, not userwith_visibility(user_visible, agent_visible)- custom visibilityis_user_visible()/is_agent_visible()- visibility checksauto_compact.rsto respect visibility flagsClient-Side (TypeScript)
displayandsendToLLMfields fromMessageinterfaceconvertApiMessageToFrontendMessage- no longer sets visibility flagsuseMessageStream🔧 Technical Improvements
🧪 Test Updates
display/sendToLLMfields📁 Files Changed
Rust Core (
crates/goose/)conversation/message.rs- New metadata system and visibility methodscontext_mgmt/auto_compact.rs- Respect message visibility in compactionproviders/- Updated all providers to use new message constructorsagents/reply_parts.rs- Use new message creation patternsServer (
crates/goose-server/)routes/- Updated API endpoints to handle metadata properlyClient (
ui/desktop/)types/message.ts- Removed visibility fields from interfacehooks/- Simplified message handling logiccomponents/- Removed ancestor message tracking__tests__/- Updated all tests for new message structureMigration Impact
Benefits
Testing
This change sets the foundation for more sophisticated message visibility control while significantly simplifying the client-side codebase.