Repository navigation
fix(mcp): stop project tools advertising agent_name for a user key - #4630
Merged
vybe merged 2 commits intoNov 18, 2026
Merged
Conversation
…bilityai#4616) The project tools told a user-scoped key to call them with agent_name and an admin's key, but the backend refuses that with 403 agent_key_required (docs corrected in Abilityai#4613). Say instead that an agent-scoped key (the agent itself) is needed, drop the agent_name suggestion from the refusal and from the parameter description, and keep sending nothing for a user key with no agent_name. Asks, reports, metrics, objectives and canvas tools are untouched. Signed-off-by: Alex Castillo <[email protected]>
…ct tool failures (Abilityai#4616) Signed-off-by: Alex Castillo <[email protected]>
Contributor
|
Merged via merge-train 2026-11-18 — thanks! Validation found two small follow-ups, neither blocking:
|
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.
Fixes #4616
Description
The Workspace project tools told a user-scoped key to "pass agent_name with an admin's user key", but the backend refuses that route with
403 agent_key_required(as the docs were corrected to say in #4613). A caller who followed the advice was refused a second time with the same advice.This is the wording-only option from the issue's technical notes:
agent_key_requiredexplanation now says the project tools need an agent-scoped key (the agent itself) and that a user key, including an admin's, is refused;agent_namegets that same message (nothing is sent, as before) instead of "pass agent_name";agent_nameparameter on the project tools has its own description saying it is not usable with a user key, instead of the shared "admin's user key acts on behalf of an agent" text.The asks, reports, metrics, objectives and canvas tools keep their wording and behaviour (they still use
ACT_AS_PARAM_DESCRIPTION). A comment inprojects.tsrecords that the wording is to be restored if the route is opened later. Requests that do name an agent still go out with the act-as header, so behaviour is unchanged.Related Issue
Fixes #4616
Journey Impact
Journey Impact: none: only the wording of the MCP project tools' refusals and
agent_namedescriptions changes; no request a working caller sends is alteredType of Change
Testing
module under test unless its live consumer is CI itself (a workflow, a vendored copy, a
route table), and no bound check at the one value where both bounds coincide (bug(process): tests that assert source TEXT instead of executing the path — three green-CI ejections in one train, third run running #2829)
node --import tsx --test src/act_as_agent.test.ts src/tools/projects.test.ts(insrc/mcp-server): the tests assert that neither refusal suggestsagent_name, that both name an agent-scoped key, and thatcreate_projectwithagent_nameanswered by a403 agent_key_requiredreturns the agent-key guidance instead of the raw backend text.tsc --noEmitpasses.Mutation: with
src/mcp-server/src/tools/projects.tsreverted todev, 3 tests go red — "a user key without agent_name is told to use an agent's key, and nothing is sent" (act_as_agent.test.ts), "list: a string 403 is unlicensed, a code 403 is the agent-key gate", and "create_project: a 403 agent_key_required with agent_name gets the agent-key guidance" (projects.test.ts).Checklist
git commit -s) — required for contributors outside the core teamThis PR was prepared with AI assistance (Claude Code).
🤖 Generated with Claude Code