fix(member-directory): include tools_count and tools in discover-agent response#4261
Draft
fix(member-directory): include tools_count and tools in discover-agent response#4261
Conversation
…t response
The /api/public/discover-agent endpoint computed the tool list from a live
agent probe but dropped it before serializing the response. The member
directory modal reads data.tools and data.tools_count from that response,
so both always resolved to 0/[]. Tools are stripped to {name, description}
before serialization; inputSchema is not exposed on the public endpoint.
OpenAPI schema updated to match.
Closes #4256
Session: https://claude.ai/code/session_01RUBQkib3o3bktEosekm7LG
Generated by npm run build during triage session. Includes member-agents schema updates (MemberAgentTypeInput split, type required on write path) and new onboarding-openapi surface that was missing from dist. Session: https://claude.ai/code/session_01RUBQkib3o3bktEosekm7LG
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.
Closes #4256
Summary
The
/api/public/discover-agentendpoint computedtools = agentInfo.tools || []from a live agent probe but dropped it before serializing the JSON response. The member directory modal readsdata.toolsanddata.tools_countfrom that response — since neither field was present, both always fell back to0/[], showing "Tools: 0" regardless of the comply cache state.The reporter's stale-comply-cache theory was incorrect. The page was already probing live; it just discarded the tool list before returning the response.
Changes:
registry-api.ts: strip tools to{name, description}(noinputSchemaexposure on a public unauthenticated endpoint) and includetools_count: tools.lengthandtoolsin the responseregistry-api.ts: update the OpenAPI schema fordiscoverAgentto declare the two new fieldsmembers.html: changedata.tools_count || tools.length→data.tools_count ?? tools.lengthso a genuine "0 tools" agent is displayed as0rather than triggering the fallback armNon-breaking justification: Adds two new fields (
tools_count,tools) to an existing GET response. No existing consumer is broken — consumers that ignored those fields continue to work; the template that expected them now gets them.Separate issue not fixed here: The comply re-runner not firing on schedule (related bug referenced in #4256). That's a distinct infra problem with no overlap in the diff.
Pre-PR review:
inputSchemaexposure (fixed by stripping to{name, description}) and missing OpenAPI schema update (fixed);||→??nit addressedagentType !== 'buying'gate behaves correctly with the new field presentSession: https://claude.ai/code/session_01RUBQkib3o3bktEosekm7LG
Generated by Claude Code