ACP: let the client choose deferred for each MCP server (_meta)

Aperta Adatta ai principianti
#6,000 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia da packages/acp-server/src/convert.ts ed esamina acpMcpServersToConfigRecord, in particolare i rami stdio e http/sse. Poi leggi test/convert.test.ts e verifica come ciascun ramo converte i metadati del server. Il lavoro è completato quando viene mantenuto un valore booleano kimi-code/deferred per ciascun server, mentre i valori mancanti o non booleani lasciano invariato il comportamento predefinito, con un test che copra la conversione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What feature would you like to see?

Let an ACP client choose deferred for each MCP server that it sends in session/new, session/load and session/resume.

Today acpMcpServersToConfigRecord (packages/acp-server/src/convert.ts) builds the config record without deferred, so every ACP server uses [mcp] default_deferred (default true). The config schema and the connection manager already support deferred for each server, but an ACP client cannot set it. In 2.9.0 I found no other way: the --mcp-config flags are gone, there is no environment variable for default_deferred, and tool _meta is not read.

Proposal: read an optional key from the ACP _meta of each server:

{ "name": "core", "command": "core-mcp", "args": [], "env": [], "_meta": { "kimi-code/deferred": false } }
  • false: the tools of this server stay inline.
  • true: the tools of this server are deferred.
  • missing or not a boolean: no change (default_deferred applies).

The ACP schema allows _meta on each MCP server, and clients other than Kimi Code ignore the key.

Additional information

My use case: I maintain OpenBot, which runs Kimi Code as an ACP agent. Each session gets a few MCP servers from OpenBot that the agent needs on each turn (chat, team and task tools), and also MCP servers that the user adds. I want the user's servers deferred, which saves prompt tokens, and OpenBot's own servers inline, so the agent does not need a search step before each core action. Today the only choice is one global setting for all servers.

I have a small change ready (a deferredFromMeta helper used by the stdio and http/sse branches, about 10 lines, and one test in test/convert.test.ts). I can send it as a PR if you invite me, or you can implement it in a different way.

Lingua principale
TypeScript
Stelle
8.3k
Fork
1.4k
Merge medio
15h 9m
PR unite (30g)
751

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MoonshotAI/kimi-code

Tutte le issue di MoonshotAI/kimi-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.