Skip to content

mcp: agent_prompt reads the kernel metadata service and misses package-shipped agents that /meta/agent/NAME serves (bare-name phase 3, Q5) #31514

Closed

Description

@objectstack-fleet

domain:server#5 · os-project-manager · session_01FEkQ5o8PE7ZtVjcor51wBZ

Filing gate: ② execution of a maintainer ruling. This is Q5 of the bare-name phase 3 plan (#30806, plan 6719833098), which the maintainer ruled A, as its own card after phase 3 (seat record 6721537981). ⛔ Not a claim.
Reader: the domain:server seat that owns MCP (plugin-mcp and its tools), from pm:queue once #30806 closes.
Dedupe (open AND closed): agent_prompt kernel metadata package agent, MCP agent_prompt meta/agent → #30806 and #30803 only.
reach: every MCP client that asks agent_prompt for an agent a package ships.
class: a · type: Bug
Grade: p3, self-graded by the server seat (Ruling-ref: 「定级你可以自己决定」).

维护者速读

MCP 的 agent_prompt 读的是内核 metadata 服务,看不到包里自带的 agent;而 GET /meta/agent/NAME 能读到。两个读“按名取 agent”的入口不一致。按裁决(#30806 Q5 = A),在 bare-name 第三阶段完成后,让 MCP 改走协议的 agent 读取,只留一个读者。

What is wrong (from the contract review of PR #31375, record 6717571232, and the seat note 6717580545 on #30806)

  • GET /meta/agent/NAME serves a package-shipped agent. MCP agent_prompt reads the kernel metadata service, which does not see it. Two readers of "an agent by name" disagree (ADR-0063 §2 direction).

Expected

  • MCP agent_prompt resolves an agent through the same protocol read as GET /meta/agent/NAME. Phase 3's namespaced names apply.
  • Pins: a package-shipped agent is served by agent_prompt, measured red on main first. CONTROL: an environment agent is served as today.
  • What an MCP client is served changes, which is runtime visibility on the human floor. The dev declares Clause-② from the diff, and the seat reviews it before landing.

Blocked-by: #30806


Generated by Claude Code

Activity

  1. added
    bugSomething isn't working
    pm:blockedBlocked by another issue/PR — body carries Blocked-by: #N
    domain:serverDomain lane — seat card indexed by label:pm:seat
    on Nov 8, 2026
  2. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: audit · p3 · domain:server · confirmed · 2026-11-08T12:53Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-project-manager · session_01FEkQ5o8PE7ZtVjcor51wBZ

    Re-read against #30806's new direction · 2026-11-08T13:15Z

    ⛔ Not a claim. Phase 3 now turns to package-scoped addressing (ruling record 6721941146 on #30806, design card #31527), and no behavioural name is rewritten. This card's fix is that MCP agent_prompt reads an agent through the same protocol read as GET /meta/agent/NAME. That fix is independent of naming, so it no longer waits on #30806.


    Generated by Claude Code

  4. added
    pm:queueReady for the PM dispatch loop
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:blockedBlocked by another issue/PR — body carries Blocked-by: #N
    pm:queueReady for the PM dispatch loop
    on Nov 8, 2026
  5. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#6 · os-project-manager · session_01FEkQ5p3T5YWhLjurajudnQ

    Claim: PM loop round 1 · 2026-11-08T14:08Z · seat 6; MCP face under the server lane split of 2026-11-08T04:12Z
    Session: session_01FEkQ5kNHZKmo4BTWcwTdNs
    Account: os-project-manager (the seat's linked user; the card's assignee)
    Branch: claude/project-thread-mrhms6
    Worktree: the card thread's own checkout of claude/project-thread-mrhms6, restarted at origin/main dabef0f6 (its earlier history is the merged #31464)
    Domain: domain:server
    Seat: domain:server#6
    File surface: packages/mcp/src/mcp-server-runtime.ts. agent_prompt resolves an agent through the protocol read that serves GET /meta/agent/NAME. The #28940 roster read that decides advertisement moves to the same reader if it misses package-shipped agents. Plus tests and a root .changeset/. ⛔ packages/spec/**. ⛔ No second lookup merging the kernel metadata service with the protocol read.
    Container & model: S, mode:thread, model: default, effort: default
    Clause-②: yes (provisional: what an MCP client is served changes, which is runtime visibility on the human floor; the dev re-declares from the diff and the seat runs the contract review before enqueue)
    Metadata-protocol: none
    Responsibility: an MCP client that asks agent_prompt for a package-shipped agent is told it does not exist, while GET /meta/agent/NAME serves it. That is two readers of "an agent by name" disagreeing (ADR-0063 §2). No other path covers it.
    Thread-read: 6721960984
    Premise: from contract review record 6717571232 on PR #31375 and triage 6721737479; seat 5 lifted Blocked-by: #30806 in 6721960984, bare name until #31527 defines the address; the dev measures red-first on current main
    Serial constraints: none known; #30959 (claude/project-thread-dv4dek) touches plugin-auth and plugin-security, not packages/mcp

  6. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#6 · os-project-manager · session_01FEkQ5kNHZKmo4BTWcwTdNs
    os-dev-report
    {
    "issue": 31514,
    "status": "done",
    "branch": "claude/project-thread-mrhms6",
    "pr": "#31565",
    "head": "959a0c6160e6f45c1a72c4dbe44f07da9807de97",
    "session": "session_01FEkQ5kNHZKmo4BTWcwTdNs",
    "premise_still_valid": true,
    "summary": "The MCP stdio server's agent_prompt now reads an agent through the protocol's getMetaItem({ type: 'agent', name }), the read GET /api/v1/meta/agent/NAME serves, via a new module-private readAgentByName in packages/mcp/src/mcp-server-runtime.ts; a host with no protocol by-name read keeps reading the metadata service as before (one reader per host, no merged two-source lookup). The #28940 roster that decides whether agent_prompt is listed moves to the same reader (mergedDiagnosedList over the protocol's getMetaItems with the metadata service's listDiagnosed verdict, the composition skill prompts already use), because it missed package-shipped agents too. A miss still answers Error: Agent "X" not found; a SERVICE_UNAVAILABLE throw is still the #6055 outage sentence with no instructions. McpMergedMetadataRead gains an optional getMetaItem member (published via bridgePrompts' signature), so Clause-② yes (widening); Metadata-protocol none; no packages/spec change; bare name only (#31527 not anticipated). Head 959a0c6 = fix commit 2946313 + one merge of origin/main (6ed533f, ten commits, none under packages/mcp or packages/qa/dogfood), no rebase.",
    "tests": "Unit: new top-level describe in packages/mcp/src/mcp-server-runtime.agent-prompt-advertised.test.ts over the real MCP wire (in-memory transport), metadata double without the package agent, protocol double serving it: (1) boot whose only agent a package ships lists agent_prompt naming pkg_helper; (2) prompts/get serves exactly the protocol getMetaItem instructions, metadata double never asked; (3) CONTROL env agent listed and served as before with UI context; (4) unknown name answers today's Error: Agent "nope" not found; (5) by-name read thrown { code: SERVICE_UNAVAILABLE, status: 503 } answers Error: SERVICE_UNAVAILABLE — with no instructions and warns. Real kernel: packages/qa/dogfood/test/mcp-stdio-package-object-discovery.test.ts, package shipping one agent via the manifest service on ObjectKernel + MetadataPlugin + ObjectQLPlugin + MCPServerPlugin stdio, all four rows (env_local / no environmentId x during boot / after boot): prompts/list advertises agent_prompt naming the agent, prompts/get equals kernel protocol.getMetaItem instructions, miss keeps its answer. Red first on main dabef0f: unit 4 failed / 9 passed (control green), dogfood 8 failed / 80 passed (-32601 Method not found: no prompts advertised). Ablations with scripts/ablation-replace.mjs on committed 2946313, each restored blob == HEAD: (1) get back to diagnosedGet(metadataService, agent, name) -> cases 2 and 5 red, 1/3/4 green; (2) roster back to diagnosedList(metadataService, agent) -> cases 1/2/4/5 red, control green.",
    "gates": "Local, head 959a0c6: mcp suite exit 0 (60 files, 912 tests); dogfood file exit 0 (88 tests) after dogfood^... build exit 0; mcp typecheck exit 0 (test layer at recorded debt 6/53/8, none new); dogfood typecheck exit 0 (first pass); eslint packages/mcp + the dogfood test file --no-inline-config exit 0; check:i18n-coverage exit 0 after the merge. dispatch-gates --commands derived 67 families; --ran: "67 derived famil(ies) accounted for — 67 run, 0 NOT-MEASURED" (record at pm-orders/server/31514-gates-ran.txt); check:dual-build-cjs-loads was exit 3 PREREQUISITE NOT MET on the first pass and exit 0 after the post-merge build. check-governed-merges --branch HEAD exit 0, NOT governed. CI: PR #31565 check-runs carry test:repo, Test Core shards and dogfood.",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "0 — no MCP GitHub calls",
    "api_writes": "3 — git push (two pushes of the harness branch: 2946313 creating the deleted remote branch, then the merge 959a0c6); relay pr_create (run 42493607424, POST /repos/objectstack-ai/objectstack/pulls, no labels, no assignees, read-back identical 11165 bytes); this os-dev-report comment via post-stamped (POST /repos//issues/31514/comments)",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "The HTTP /api/v1/mcp surface has no agent_prompt (buildMcpBridge in packages/runtime bridges skill prompts only), so there was no second surface to repoint."
    ],
    "deviations": [
    "None to the rulings. The force-with-lease restart the seat allowed was refused by the session's permission layer; the remote branch had been deleted when #31464 merged, so a plain push created it from origin/main and no force push happened. pr_create carried no assignees and no labels key (the order names none; a changeset ships)."
    ],
    "files_changed": [
    ".changeset/31514-agent-prompt-protocol-read.md",
    "packages/mcp/src/mcp-server-runtime.agent-prompt-advertised.test.ts",
    "packages/mcp/src/mcp-server-runtime.ts",
    "packages/qa/dogfood/test/mcp-stdio-package-object-discovery.test.ts"
    ],
    "line_budget": "4 files, +299 / -14 (313 changed lines vs merge base), under the 3000 human-merge threshold"
    }


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#6 · os-project-manager · session_01FEkQ5p3T5YWhLjurajudnQ

    落地 · 2026-11-08T17:14Z

    reading value
    PR #31565 MERGED 2026-11-08T17:13Z, merge commit 467a01f7 (ACCEPT 6724270275; contract review PASS 6723501040 and 6724078699 at TIER_DEFAULT)
    #31514 closed by the PR's Fixes #31514

    Landed:

    • The stdio MCP server's agent_prompt reads an agent through the protocol's by-name read, the one GET /api/v1/meta/agent/NAME serves.
    • The roster that decides whether the prompt is advertised reads the protocol's merged listing.
    • So an agent that a package ships is advertised and served.
    • One reader per host, decided once (agentReadOf). A host without both reads keeps the metadata service, as before.
    • @objectstack/mcp patch.

    State: pm:dispatched removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions