Skip to content

Add on-demand worker model discovery through MCP - #38

Open
edgexyz wants to merge 6 commits into
Fei2411:mainfrom
edgexyz:feat/list-models
Open

edgexyz wants to merge 6 commits into
Fei2411:mainfrom
edgexyz:feat/list-models

Conversation

@edgexyz

@edgexyz edgexyz commented Oct 17, 2026

Copy link
Copy Markdown

Coordinators currently need to inspect individual worker CLIs to find model IDs before dispatching. This adds an on-demand MCP tool, list_models(agent, cwd, refresh=false), that returns a worker's advertised model catalog. list_agents also reports discovery support.

Changes

  • Share ACP discovery between Kimi and DSH using a separate initialize / session/new handshake and the SDK's typed configuration options.
  • Query Antigravity through agy models and Codex through paginated app-server model/list.
  • Return model IDs, display names, advertised defaults, model-specific native effort levels, and cache metadata. Preserve null for unknown effort support and [] for explicitly empty levels.
  • Cache catalogs in memory per worker/project for one hour by default. Support explicit refresh and [models] cache_sec / timeout_sec configuration.
  • Add English/Chinese orchestration guidance, skill and MCP tool descriptions, and an isolated MCP smoke-test script.

Discovery is available to coordinator instances. ACP discovery denies permission requests and may leave an empty session in worker history. Lookup deadlines, output/page limits, diagnostic redaction, and subprocess cleanup cover worker failures and cancellation.

Validation

Tested on Windows with Python 3.14:

  • Full regression suite: 737 passed.
  • ruff check . and mypy: passed.
  • Live queries through an isolated MCP server: Kimi 4, DSH 4, Antigravity 13, Codex 7 catalog entries; cache reuse passed for each worker.
  • Tests cover SDK-backed flat/grouped ACP metadata, native effort semantics, pagination, malformed responses, timeout/cancellation cleanup, environment filtering, and cache concurrency.

The full suite reports one previously observed asyncio pipe-finalizer warning in test_quota.py::test_describe_quotas_covers_every_agent; all tests pass.

@edgexyz
edgexyz marked this pull request as ready for review October 21, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant