Repository navigation
MCP: the answer card's messages go to card hosts only - #379
Merged
Merged
Conversation
_meta["triton/a2ui"] (Triton's card plus a producer's basic-catalog surfaces and their data_model) went to every MCP client while the widget was on, because #368 did not know whether ChatGPT declares MCP Apps. The demo logs show both reference hosts do (ChatGPT 'openai-mcp/1.0.0 (Codex)', 'Claude-User'), so a client that cannot render the card no longer receives its data either: the same per-request card-host rule as the card text, the slim structuredContent (#376) and the in-card tokens (#374). Tests (red first): a plain client gets no _meta["triton/a2ui"] (mcp_card_text, mcp_app_widget, mcp_in_card); the golden and embed-parity comparisons run as a declared card host. Contract, architecture and realizations updated.
…le (crew review) - in_card_call took the card-host decision as given (answer(..., true, ...)): a valid in-card token replayed by a request that does not declare MCP Apps still got the card, a producer's data_model and fresh signed controls. card_host is now passed in; such a replay gets the answer as any non-card client does. The reference hosts declare MCP Apps on widget calls (demo log: card_host true before every in-card rerun). - Tests: a sessionless token replay gets no card and no token and the full envelope; a producer data_model marker appears nowhere in a non-card client's response (mutation-checked: red without the gate). - Contract: the card-host rule keeps data away from clients that cannot show it; it is not access control. tool_trace deliberately still goes to every client (comment + contract line). Drop a redundant filter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
_meta["triton/a2ui"]carries Triton's card plus a producer's basic-catalog surfaces and theirdata_model. It went to every MCP client while the widget was on, because #368 didn't know whether ChatGPT declares MCP Apps. The demo's per-call log lines settle it: ChatGPT (openai-mcp/1.0.0 (Codex)) and Claude (Claude-User) both declareio.modelcontextprotocol/ui. A client that can't render the card shouldn't receive its data either.What
structuredContent(MCP: a card host's structuredContent is a summary of the card, not every row #376) and the in-card tokens (feat(mcp): in-card actions on the answer card via an app-only tool (#369) #374).card_host: truebefore every in-card rerun._meta.tool_trace(an opt-in debug sidecar) deliberately still goes to every client. This was your decision; there is a code comment too.Tests (red first)
_meta["triton/a2ui"]:mcp_card_text,mcp_app_widget(customer path),mcp_in_card. The golden and embed-parity comparisons now run as a declared card host.data_modelmarker appears nowhere in a non-card client's response. Mutation-checked: the test is red without the gate.it: 758/758. Clippy is clean. Pre-pushscripts/check.shpassed.Review
The crew (security on Claude, correctness on Codex) approved after these follow-ups: the rerun gate (F1), the not-access-control sentence (F2), the
tool_tracedecision (F3), the replay and leak tests (F4), and dropping a redundant filter (F5).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.