Repository navigation
useToolAllowed: whether the viewer may call one of this app's tools - #132
Merged
Merged
Conversation
mgoldsborough
marked this pull request as draft
October 30, 2026 21:09
Contributor
Author
QA Review: PR #132Scope: 8 files, +80/−5 · worktree: supplied review worktree (creation and dependency installation skipped as requested) · reviewed: edc77d5 · CI: pending Critical (must fix)None. Fix in-PR (apply mechanically — no adjudication essay expected)None. Suggestions (optional)None. What Looks Good
Body claims
Machine record{
"kind": "review",
"pr": 132,
"round": 1,
"reviewed": "edc77d5f9e76af88d69e3ec4119efc7bb3e164db",
"delta_base": null,
"ci": "pending",
"risk": "LOW",
"stop_gate": "n/a",
"verdict": "No blocking findings; eligible when CI is green.",
"label": "eligible-on-green",
"findings": []
}Reviewer: Codex. |
mgoldsborough
marked this pull request as ready for review
October 30, 2026 21:10
# Conflicts: # CHANGELOG.md
Contributor
Author
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.
useToolAllowed(tool): booleanreads the host context'sconnector.allowedTools, the names of the app's own server's tools the viewer may call, and returns whethertoolis among them.Why. An app that offers a restricted control (a bulk role change, removing a blocklist entry) needs to know whether to offer it. Telling the app a role and leaving it to guess which controls that role unlocks puts the policy in two places, the host's enforcement and each app's hard-coded list, and they drift silently; it also ties every app to today's role model. A list of callable tools, computed by the host with the same decision it enforces, keeps the policy in one place: a control shown is a call that will be allowed, and a change to what a role may do reaches the app with no app change. The server still decides every call.
Degradation. A hook that waits for the host:
falseuntil the host lists the tool, andfalseon a host that sends no list, so a restricted control stays hidden rather than offered to someone the call would refuse. Added to the degradation table.Release. 0.37.0, alongside #131 (the same version; whichever merges second takes the other's CHANGELOG entry). Vendored IIFE unchanged.
Tests.
host-context-hooks.test.tsx: no list → false; listed → true; left out → false; follows a host-context change (as when the viewer's role changes).npm run ci: 654 pass.