Repository navigation
feat(chat): show approvals, policy denials and connector calls in chat - #110
Merged
Merged
Conversation
This was referenced Dec 3, 2026
jbouder
force-pushed
the
feat/79-chat-tool-states
branch
from
December 3, 2026 21:49
5d8161c to
9b2b8e2
Compare
- The broker marks a policy denial with structured content,
{"outcome":"denied_policy","message"}, for reads and for writes
denied while they are planned. The error text is unchanged.
- A pi extension (chat-results.mjs) keeps a Tapas tool's approval or
denial mark in the saved result's details. pi saves no structured
content, so a reloaded conversation would lose it. chat-start.sh
loads it through a new chat-bridge --pi-extension flag.
- The chat bridge sets toolMetadata.tapas on the tapas server's held
plans and policy denials, live and from history. Other servers'
results are never read for marks.
- The chat shows a connector call with its service's logo, the action
in words and whether it reads or writes. A held change shows the
Approvals card inline, which follows decisions made elsewhere. A
denial says why, apart from failures, with no retry.
Refs #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QW4EewVw4PsagWuFNuGMGY
- pi-setup writes the tapas server with exposure hidden and
toolExposure {"*__*": "direct"}. Pi's default, codemode, kept the
connectors' tools from the model, so it never called them, and a call
from a script would show in chat as one codemode step, not as a
connector call the chat can mark.
- Tapas's own tools stay hidden. The agent reaches the API through
javo-api.
- Without the helper, pi-setup takes away a tapas server it wrote,
which would point at a helper that is not there. A person's own
tapas server is kept.
Refs #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QW4EewVw4PsagWuFNuGMGY
- Approving or declining a held change on the chat's card sends pi a
message with the outcome ("I approved notes-create-page in Notes,
and it ran."), so the conversation goes on. Before, pi only learned
the change was held, and the chat stopped there.
- Queued messages wait for a streaming reply to finish before they go.
- A decision made on the Approvals page or in another tab still shows
on the card, but sends nothing, so two open tabs cannot both send it.
Refs #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QW4EewVw4PsagWuFNuGMGY
- The chat's pi extension adds a note after a held plan's result: the person decides on the card in the chat and pi gets a message with the decision, so pi does not send the approve link. Pi said "approve it there" with a link, under the card that already asked. - Only the chat's pi gets the note. The broker's result, which terminal agents read, is unchanged, and so are denials. - contracts.md describes the note. Refs #79 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QW4EewVw4PsagWuFNuGMGY
jbouder
force-pushed
the
feat/79-chat-tool-states
branch
from
December 3, 2026 22:16
9b2b8e2 to
3a2f338
Compare
This branch was successfully deployed
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.
What changed
{"outcome":"denied_policy","message"}, for reads and for writes denied while they are planned. The error text is unchanged.chat-results.mjs) keeps a Tapas tool's approval or denial mark in the saved result's details, so a reloaded conversation keeps it.chat-start.shloads it through a newchat-bridge --pi-extensionflag.toolMetadata.tapason thetapasserver's held plans and policy denials, live and from history. Other servers' results are never read for marks.docs/architecture/contracts.mddocuments the new denial content and the bridge's tool metadata.Why
Refs #79. Connector calls, policy denials and pending approvals all looked like raw tool output in chat.
Also in this PR
Found while testing on a local cluster:
exposure: hidden,toolExposure: {"*__*": "direct"}). Pi's default, codemode, kept them from the model, and a script's call would show as one codemode step that the chat can't mark. Tapas's own tools stay hidden; the agent usesjavo-api.tapasserver it wrote (from the feat(agents): pi reaches its owner's connectors through the helper's /mcp #70 review).contracts.mdcovers it.#70 and #71 are merged, and this branch is rebased on main.
How to test
go test ./internal/chatbridge/ ./internal/connectors/broker/node --test pod/files/agents/*.test.mjscd ui && npm test -- ToolCall🤖 Generated with Claude Code
https://claude.ai/code/session_01QW4EewVw4PsagWuFNuGMGY