Repository navigation
fix(app): follow-ups to the agent tool limit - #2956
Merged
Merged
Conversation
…a reopened session Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
… tool pairs Co-Authored-By: mecatl <[email protected]>
retainHarnessGeneration returns a nil close when the harness instructions are not generation-backed. The file-less member path called it unguarded, so closing a defined member with its own MCP server panicked, and a failed provider lookup did the same. Guard both, as the file-ful path does. Co-Authored-By: mecatl <[email protected]>
…member The file-less defined member catalog only filtered core tools by the definition's disallowedTools, so a definition limited to a few tools still got WebFetch, WebSearch and every memory tool. Scope the file-less core and memory tools through scopedToolNamesMode, as the member with a filesystem does. MCP and gateway tools keep following the definition's servers and exclusions. Co-Authored-By: mecatl <[email protected]>
Load a definition from files through the real broker path, with the calendar server and one excluded tool, and register a helper running it. Its call to the excluded tool and to a server it does not reference are refused before any ID-JAG exchange, and its call to the server's other tool passes the ceiling check. Co-Authored-By: mecatl <[email protected]>
- Log filesystem tools named in a definition's `tools` at Debug instead of Warn "unknown tool": they do not exist without a filesystem. Genuinely unknown names still warn. Add the member name to the log, as the file-ful path does. - Mention the `tools` allowlist in the buildMemberEngine comments. - Reword the no-filesystem docs so disallowedTools is not described as limited to core and memory tools, and name the tools `tools` limits. - Drop an always-true assertion and fix a stale definition description in the file-less member tests. Co-Authored-By: mecatl <[email protected]>
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.
Summary
Follow-ups from reviewing #2937, stacked on
feat/agent-tool-limit. Merge this into #2937's branch, or cherry-pick the commits there.retainHarnessGenerationreturns a nil close function when the harness instructions are not generation-backed. The new file-less member close in feat(identitybroker): limit each agent's gateway calls to its definition's tools #2937 called it without a check, so a member whose definition has inline MCP servers panicked on teardown. All three unguarded calls inbuildMemberSelectorEnginenow check for nil, including an older one on the file-ful path.toolsallowlist to its file-less team member. The file-ful path narrows core tools withscopedToolNamesMode. The file-less path only applieddisallowedTools, sotools: [Read]still gotWebFetch,WebSearch, and the memory tools. Both paths now narrow core tools the same way, and MCP and gateway tools still followmcpServersanddisallowedTools. A file tool named intoolslogs at Debug in the file-less path, because it doesn't exist there; a genuinely unknown name still warns.internal/apptest loads a definition from disk through the startup loader and callsAuthorizeCalldirectly. It fails with check 7 removed.recordLockedoverwrites the stored ceiling.Ceilingis immutable, soString()now returns text computed inNewCeilingandintersectinstead of sorting and joining on everyAuthorizeCall.mcp-authorization.mdno longer says resolution runs against servers "and their tools". Thetools.mdsentence on file-less team members now says whattools,disallowedTools, andmcpServerseach do.Issue relationship
Relates to #2842
Type of change
Test plan
Baseline checks
golangci-lint runon./internal/app/...and./internal/identitybroker/...only, 0 issuesgo test ./internal/app/ ./internal/identitybroker/...pass;go test -race ./internal/identitybroker/...passestask test:race): left to CIgo run ./cmd/mecademo): not runtask docspassestask site:build): left to CIengine/is unchangedEach new test was checked against the regression it targets. The close test panics without the nil check. The loaded-definition test fails with check 7 removed. The re-registration test fails when
recordLockedoverwrites the ceiling.Changes
internal/app/build.gogenerationClose; comments mention thetoolsallowlistinternal/app/catalog.gonewNoFSDefinedMemberCatalogscopes core tools withscopedToolNamesMode; file tools log at Debuginternal/app/nofs_team_test.gotoolsallowlistinternal/app/identitybroker_gateway_test.gointernal/identitybroker/ceiling.gointernal/identitybroker/ceiling_test.godocs/drafts/agent-identity/mcp-authorization.mduser-docs/features/sessions/tools.mdUser-facing change
A file-less team member that names a definition with a
toolslist now gets only the listed core tools. For example,tools: [Read, Grep]leaves it with its team, MCP, and gateway tools only, which matches howtoolsalready works with a filesystem.API compatibility: no wire change. Nothing touches a proto, gRPC, HTTP, or event surface.
Special notes for reviewers
feat/agent-tool-limitatf608b39e1.0146799b2and thetools.mdpart of the last commit.🤖 Generated with Claude Code