Skip to content

feat(mcp): request_server tool and template.mcp_server card - #25180

Merged
buluoray merged 1 commit into
mainfrom
feat/request-server-25157
Oct 30, 2026
Merged

buluoray merged 1 commit into
mainfrom
feat/request-server-25157

Conversation

@buluoray

@buluoray buluoray commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An agent in any template-based session can ask, in the chat, for an MCP server it lacks, and the user approves it on a change card.

A session on an agent template (the default kirocrew agent, a custom or third-party agent, the worker, a conductor) has no way to ask for a server mid-chat. Crewmates have request_capabilities; nothing else does, and propose_change has no kind that adds a server to a template. So an agent that needs a capability either stops or works around the gap, for example by launching the server's program from the shell, which bypasses the per-tool gate.

Why it matters

The workaround runs a server's code as one shell command: policy, approval and the audit trail never see the server's calls. The supported path has to be easier than the workaround, and it has to keep the owner as the only one who grants anything.

Not a goal

  • Adding a server from the MCP page to a template by hand (the issue's second Expected bullet). It builds on the same record and can follow.
  • Queuing a request from an unattended turn for the next person-sent turn. This PR refuses it with the reason.
  • Showing a pending card inline through MCP elicitation.
  • Any tool approval: the card adds a server, never autoApprove or allowedTools.

What changed (motivation → approach → change)

Goal → approach: the one-pager on the issue and its amendment put the request tool on kirocrew-core (the one server every session carries), a gateway route that resolves the caller from the attested session, a card kind that writes the per-template additions record from part (a), and an Undo that removes it. The design review's six points are each handled:

  1. No launch line from the agent. request_server sends only {server?, source, registry_id?, reason?}; the route refuses any other field (400 invalid_body). The gateway builds the entry with member_capability_catalog.resolve_server, now shared with request_capabilities (extracted from additions_to_draft, same behaviour): a server this gateway runs and has switched on, or the official registry's install plan. A gateway entry carrying env, headers or credential arguments is refused carries_settings; such a server is added on the MCP page, where secrets come from the existing store. propose_change cannot raise the kind (GATEWAY_RESOLVED_KINDS, 403 use_request_server) and list_change_kinds leaves it out.
  2. The card adds the server, not trust. The kind's params pass template_mcp_additions.validate_entry, so autoApprove, allowedTools and every other trust key are refused. The "Each tool" row says "nothing is auto-approved; this agent's existing permissions still apply" (the UX reviewer's wording); it makes no promise that each tool asks.
  3. One record for every template. The card writes template_mcp_additions.add_addition from part (a); nothing is written into a spec file. An alias session (kirocrew-ledger-conductor) records under its target.
  4. Reach. The card lists every template from addition_reach (an addition to the goal conductor also lists its deprecated alias), every open dashboard session on those templates, and crew members built from them, plus whether running sessions pick it up at their next turn (the live gate) or restart. A worker session's request records on the worker's own entry.
  5. Removal. The card's Undo is DELETE /api/agents/detail/{name}/mcp-additions/{server}?card_id=<card>, calling remove_addition(card_id=...), so a later approval of the same server on another card survives a stale Undo.
  6. Unattended turns. cards.request_server is a user-turn operation of the existing caller gate, with no own-thread exemption. A subagent, a schedule or workflow slot, a channel turn and any turn the user did not send (patrol, loop wake, session_send) get a refusal naming the reason and what to do instead.

A third-party template on a harness where an addition cannot reach its sessions (kiro-cli) is refused 409 unsupported with part (a)'s UNSUPPORTED_REASON. A crewmate is sent to request_capabilities. A request from the default kirocrew agent or the worker is refused by (a)'s addition_support (409 unsupported, pointing to the MCP page) and raises no card: those agents carry every server installed there, and the MCP page's add would also approve every tool. Mount-only requests for them are a follow-up.

Change:

  • mcp_tools/server_request.py: the request_server tool on kirocrew-core (strict session key, stateless).
  • dashboard/handlers/template_server_request.py: the agent route POST /api/cards/agent/request-server (strict /api/cards/agent prefix) and the owner-only, card-hooked POST/DELETE /api/agents/detail/{name}/mcp-additions[/{server}]. The POST refuses any internal caller (403 owner_only) and any request with no card (403 card_required). Each write rebuilds the agent specs, then applies live or resets sessions, as an MCP page change does.
  • change_card_catalog*: the template.mcp_server kind, its preview, evidence (card_id) and Undo; readers for its state and context.
  • docs/architecture/mcp.md: new section Asking for an MCP server mid-chat (request_server), the core tool list and the card kinds paragraph.

Merge order: part (a) #25172 has merged; this PR is rebased onto main and imports kiro_crew.template_mcp_additions. This PR makes two changes to (a)'s module. add_addition gains a keyword only_if_absent (default off, so existing callers are unchanged), which the Apply and a failed Undo's restore both use, so neither overwrites a newer card's approval. And merge_into now layers the MCP page's current disabledTools for each added server onto the merged entry, read through the existing mate_worker.globally_disabled_refs, so an addition never brings back a tool the owner switched off.

Backwards compatibility

Compatible: one new tool, one new kind that only the new route raises, and three new routes. request_capabilities keeps its behaviour: the server resolution moved into resolve_server with the same checks, order and messages.

Removes nothing: the diff only adds a tool, a card kind and routes; the shared helper is an extraction with the crewmate path calling it.

Tests

test/test_template_server_request.py (18 tests), through the real routes, card engine and additions record under a temp data home:

  • the agent asks, the owner applies the card, the record holds the gateway's entry under the card id, and the Undo removes it;
  • launch-line fields (command, url, entry, template, session) are refused, and propose_change cannot raise the kind with its own entry;
  • the card entry is the one the gateway resolved;
  • a patrol/wake, subagent, channel and cron turn each get their own refusal;
  • an unsupported template is refused with UNSUPPORTED_REASON;
  • only the owner's browser applies the card: the agent with the card's headers, the agent bare and the owner with no card are refused;
  • a stale Undo never removes a later approval;
  • a concurrent Apply never replaces an earlier approval (409 already_added);
  • the card writes only the record and asks for one ordinary rebuild; a concurrent rebuild that commits an older snapshot is corrected by the next rebuild, for Apply and Undo;
  • the card says every open chat restarts when the change cannot apply live;
  • an addition never brings back a tool the owner switched off on the MCP page: every merge layers the page's current disabledTools for that server onto it;
  • the card has an Undo row;
  • the card says in plain words what adding the server does ("What it does", before the tool list), and an old agent name rides on the chip of the agent it names;
  • a template that reads the record at spawn needs no spec rewrite, so a declined rebuild does not roll it back;
  • no trust key rides on the card; the kind is out of list_change_kinds;
  • the card never promises a prompt (test_the_card_never_promises_a_prompt);
  • the tool sends only named fields under the strict key and refuses without one; the caller template comes from the session record; a crewmate is sent to request_capabilities.

Mutation checks, each reverted by path and each reddening a named test:

  • route owner check removed → test_only_the_owner_s_browser_applies_the_card
  • unknown body fields accepted → test_the_request_never_takes_a_launch_line_from_the_agent
  • propose_change refusal of the kind removed → test_the_request_never_takes_a_launch_line_from_the_agent
  • cards.request_server dropped from the user-turn operations → test_an_unattended_turn_is_refused_with_its_reason[not_user_turn-not_user_turn]
  • card params skip validate_entry → test_a_trust_key_never_rides_on_the_card
  • Undo ignores card_id → test_a_stale_undo_never_removes_a_later_approval
  • Apply without only_if_absent → test_a_concurrent_apply_never_replaces_an_earlier_approval
  • rollback not gated on a spec-merged template → test_a_spawn_merged_template_needs_no_spec_rewrite
  • Undo skips its record write → test_a_racing_rebuild_converges_on_the_undone_record
  • old restart wording restored → test_the_card_says_every_open_chat_restarts_when_not_live
  • "What it does" row removed → test_request_raises_a_card_the_owner_applies_and_undoes

Updated pins: the card route table regex admits a hyphen in a path, the MCP route table row count and digest, and the boot chain's _deferred run (one more deferred route).

Proof: not provable -- other: new feature, no fix to revert; the mutation checks above stand in for it.

Locally, on this head: the change-card, member-capability, tool-registry, tool-title, facade-mirror, identity-topology and server-composition suites pass, except test_identity_topology.py::test_a_proven_recycle_is_not_unverifiable, which fails the same way on the base commit 15e3f14 without this change.

Manual verification

Run end to end in a pod on Linux with kiro-cli 2.35.1: request, card, apply, live pickup in the running session, Undo (screenshots below). The pod run found the dashboard had no entry for the new kind, so Apply stayed disabled; the kind is now registered in website/src/api/cards.ts and cards/cardRegistry.ts with its strings. KAS live pickup and macOS/Windows not run.

Screenshots / video

Pod run on this head, Linux, kiro-cli 2.35.2. A Crew Mode (kirocrew-conductor) session called request_server for tickets-demo, a server installed on the pod with no keys or login settings.

The pending card. The title, "Adds" and "What it does" say in plain words what adding the server does. The old agent name sits on the same chip as the agent it names. "Each tool" reads "nothing is auto-approved; this agent's existing permissions still apply", and a new "Undo" row reads "remove it from this card any time". The server had not run yet, so "Its tools" shows its fallback:

pending card

After Add server (the conductor spec mounts tickets-demo):

applied card

After Undo (the record is empty, and the spec no longer mounts it):

after Undo

Rows this pod could not show are pinned by tests: the not-live "Open chats" text (test_the_card_says_every_open_chat_restarts_when_not_live), "Crew members", and "Already approved" (test_an_approval_the_agent_already_holds_is_named).

Related Issues

Refs #25157 (part (b) of two; part (a) is #25172)

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners October 28, 2026 07:54
@buluoray
buluoray requested review from cruisercohen and removed request for a team October 28, 2026 07:54
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 28, 2026
@buluoray
buluoray force-pushed the feat/template-mcp-additions-25157 branch 8 times, most recently from 36ac868 to bdd9cc2 Compare October 28, 2026 13:25
@buluoray
buluoray force-pushed the feat/template-mcp-additions-25157 branch 8 times, most recently from 3fba3e7 to 2258b7b Compare October 29, 2026 00:55
Base automatically changed from feat/template-mcp-additions-25157 to main October 29, 2026 09:38
@buluoray
buluoray force-pushed the feat/request-server-25157 branch from 93eecc6 to e1caf0f Compare October 29, 2026 09:52
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The gateway builds the server entry, only the owner's browser can apply the card, and the patch removes nothing that existing readers depend on.

Notes

  • merge_into now reads the MCP page's disabledTools through mate_worker.globally_disabled_refs on every merge. That is a second reader of the page's switch-offs sitting inside part (a)'s record module. If that reader's format changes, additions quietly lose the guard, so pin the shape with a test on the shared reader.
  • A source: "registry" request runs the official registry's install plan and drops its required env (_env). The resulting card may add a server that cannot start. Refuse it, or say on the card that settings are needed, rather than approving something that won't run.

[DESIGN-REVIEWED] 6d643d5

Description read

[DESCRIPTION-READ] cf7ac7cec9a6717534e7be1c28c3f0951729cb217dfbf4b09260b321b958bab0

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. One gap: the Goal says "any template-based session", but on the default agent and worker the new tool always refuses, and on a kiro-cli custom agent it does too.

Notes

  • Item 4 — inherited: the Goal promises "An agent in any template-based session can ask… and the user approves it on a change card", and the motivation names "the default kirocrew agent… the worker". The diff refuses both without a card (addition_support → 409 unsupported). It also refuses every non-conductor template on kiro-cli (UNSUPPORTED_REASON). So on a default install, request_server sits in every session's tool list and can only refuse. The card path serves conductors, plus custom agents on backends in ACP_BACKENDS_TEMPLATE_ADDITIONS_AT_SPAWN. Subtraction: drop "the default kirocrew… the worker" from the mcp.md section's opening list of who asks with request_server, so the doc names only the templates that can get a card.

What this change ships

Inventory (10 items) — 9 justified

Intent: let an agent ask in chat for an MCP server it is missing, with the owner approving it on a card. ADDITION.

  1. New request_server tool on kirocrew-core: the agent names a server and its source, never a launch line — justified
  2. New template.mcp_server change card listing the agents, open sessions and crew members it reaches, the server's tools, and an Undo — justified
  3. Turns the user did not send (subagent, cron, channel, patrol, wake) get a refusal that names the reason — justified
  4. Default agent, worker and kiro-cli custom templates get a refusal pointing to the MCP page, not a card — inherited (Goal says "any")
  5. Owner-only POST/DELETE /api/agents/detail/{name}/mcp-additions routes, usable only as card steps — justified
  6. propose_change cannot raise the new kind, and list_change_kinds leaves it out — justified
  7. An added server now keeps the tools the owner switched off on the MCP page (disabledTools) — justified
  8. add_addition gains only_if_absent, so a stale Apply or Undo never replaces a newer approval — justified
  9. Server resolution moved out of request_capabilities into a shared resolve_server — justified
  10. Docs section, feature-map row and i18n strings for the card — justified

[FIRST-PRINCIPLES-REVIEWED] 6d643d5

Description read

[DESCRIPTION-READ] d2325ad2ac9f81c2c999b23b41256cc8b56b37628e6e69017d87bfde6cc67a70

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks: all three card states (pending, applied, undone) are shown, and the blind reader read the main button "Add server" correctly. Its hesitation was about wording, not about what the button does.

Notes

  • The card's title and its main button use different words for the same thing. The blind reader hesitated because "It says "server" while the rest of the card says "helper program"". Use one term in both places, for example primary_template_mcp_server → "Add helper program", or put "server" in the title.
  • The "Its tools" row reads "shown once it first runs" at the moment the user decides. The reader said it "makes me uneasy about approving". If the tool list can't be known before approval, say so and say what happens instead, for example "Listed after you add it; each tool still follows this agent's permissions".
  • After Undo, the existing "Restored: {{title}}" line next to this card's "Let … use … helper program" title "could just as well mean the helper was restored". The card needs its own undone line for this kind, for example "Removed: "tickets-demo" from "kirocrew-conductor"".

[UX-REVIEWED] 6d643d5

Description read

[DESCRIPTION-READ] e8f5dfd3115cc4d3412c193eee6c27c0932d34316d4adb722103119021fb9cee

That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 6.1 flagged blocking issues on 6d643d549f71aee1a19db467a9ff43c91bf7e3a7; Opus 5.5 adjudication downgraded every one of them. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

This comment is updated in place on each push.

Review details

BLOCKING -- src/kiro_crew/dashboard/handlers/template_server_request.py:536 -- A concurrent rebuild can restore a server after successful Undo

if await asyncio.to_thread(_rebuild_required, template):
Trigger: An MCP-page Apply reaches rebuild_agent_config_reporting → _conductor_spec and reads the existing addition. Concurrently, this DELETE removes it and finishes its rebuild; the older rebuild then writes its captured conductor spec.
Outcome: Undo succeeds and the card becomes undone, but conductor sessions mount the removed server again. Neither the record-only card state check nor the conductor spawn path corrects the stale spec; it persists until another rebuild.
Anchor: defect
Fix: Serialize the complete additions-read-to-spec-write phase at the shared rebuild entry point, so an older rebuild cannot overwrite Undo’s rebuild.
Sites: The Apply path at src/kiro_crew/dashboard/handlers/template_server_request.py:476 has the inverse race; the conductor, deprecated-alias, pipeline-conductor, and security-conductor installers in src/kiro_crew/agent_materialization/conductor_agents.py all separate the additions read from the spec write.

[BLOCK-MERGE-DOWNGRADED] 6d643d5
[GPT-REVIEWED] 6d643d5

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 is LOW harm. Every condition below was checked in the code. The failure needs the owner to Undo at the same moment a separate MCP-page rebuild has already read the additions record but not yet written its spec. That rebuild reads the record in _conductor_spec at conductor_agents.py:762, and the DELETE's own rebuild runs at template_server_request.py:536. Both endpoints are owner-only (template_server_request.py:341), so this is one person racing their own two actions. The server stays mounted only on conductor templates (template_server_request.py:380-389), and it is a server that same owner had already approved. The next rebuild repairs the spec: the module states the record is the source of truth and the next rebuild corrects a stale snapshot (template_server_request.py:355-358, :398-409). Gateway start and any MCP change both rebuild.

The real fix is expensive. It needs a new lock over the whole read-additions-to-write-spec phase of rebuild_agent_config, with lock ordering coordinated against the existing agents_spec_lock and _mcp_lock (spec_rebuild.py:1373-1379). That cuts across four installers and the shared rebuild entry point, and the module deliberately chose not to hold a rebuild lock (template_server_request.py:355).

[ADJUDICATION] 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 total=1 uphold=0 downgrade=1
DOWNGRADE F1 src/kiro_crew/dashboard/handlers/template_server_request.py:536 reason=disproportionate-remedy
[GPT-ADJUDICATED] 6d643d549f71aee1a19db467a9ff43c91bf7e3a7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6d643d5

Verdict parsed from the review's SHA-scoped output markers for commit 6d643d549f71aee1a19db467a9ff43c91bf7e3a7.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 6d643d549f71aee1a19db467a9ff43c91bf7e3a7 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

Findings on 6f790ecb82, addressed in 749d3ca1c3:

  • GPT 6.1, overlapping rebuilds commit an older conductor snapshot (upheld by adjudication): fixed in code, as the finding proposed. _rebuild_specs now runs under one module lock (_REBUILD_LOCK), and every rebuild in this module goes through it: Apply, Undo, and each rollback's reconcile. Each card writes its record before it rebuilds, so whichever rebuild runs second reads both servers. Test: test_spec_rebuilds_never_overlap, where 4 threads see at most 1 rebuild at a time. Replacing the lock with a no-op fails it.

The description and mcp.md are updated to match. The head is rebased onto main 09e4e0bfe2, and none of that change's files overlap this PR.

@buluoray
buluoray force-pushed the feat/request-server-25157 branch from 6f790ec to 749d3ca Compare October 29, 2026 19:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray
buluoray force-pushed the feat/request-server-25157 branch from 749d3ca to 4b28ec5 Compare October 29, 2026 19:43
@buluoray

Copy link
Copy Markdown
Contributor Author

Findings on 749d3ca1c3, addressed in 4b28ec5f0d:

  • GPT 6.1, a concurrent MCP-page rebuild can overwrite a card's Apply or Undo: by owner ruling, this is handled by design, not with a new lock. The shared rebuild_agent_config lock is not touched, because it has 12 callers and some run on the event loop. The card owns no spec write and no rebuild lock. It writes only the additions record, under the record's own lock, and then asks for one ordinary rebuild. The card-only _REBUILD_LOCK from the last round is removed.
    • Why it converges: every rebuild, the MCP page's included, merges the record into the conductor spec. The record is the source of truth. A racing rebuild that commits an older snapshot last can leave the spec one rebuild behind. The next rebuild corrects it (gateway start, any MCP change, or another card). Nothing leaves the record wrong, and nothing gets past the approval limits.
    • Tests: test_a_racing_rebuild_converges_on_the_applied_record and test_a_racing_rebuild_converges_on_the_undone_record model this race: an MCP-page rebuild reads the record before the card's step and writes after the card's rebuild. Each test checks that the record is right and that the next ordinary rebuild brings the spec to match it. test_a_rebuild_after_the_card_s_write_carries_it covers the other order. An Undo that skips its record write fails the Undo test.
  • Opus 5.5, a reset restarts chats the card does not list: the row is now "Open chats". When the change cannot apply live it reads "every open chat restarts to pick it up, including chats on other agents" (TEMPLATE_SERVER_RESTART_NOTE), which also takes the UX rename. Test: test_the_card_says_every_open_chat_restarts_when_not_live. Restoring the old wording fails it.
  • Semgrep test-sleep-as-barrier: the test that used time.sleep is removed with the lock.

Rebased onto main 2ad709cba7, which shares no files with this PR.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray
buluoray force-pushed the feat/request-server-25157 branch from 4b28ec5 to bb9c2af Compare October 29, 2026 21:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 29, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

UX findings on bb9c2afbbd, addressed in 98a8e107f8:

  • The "Add server" button could not be judged from the card: fixed in code.
    • The title now says what the card does in plain words: "Let “kirocrew-conductor” use the “tickets-demo” helper program". "MCP" is gone from it.
    • "Adds" now reads "“tickets-demo”, a helper program already installed on this machine".
    • A new "What it does" row comes before the tool list: "lets the agent ask a helper program to do the tasks below for it, on this machine" (TEMPLATE_SERVER_DOES_NOTE). Removing the row fails test_request_raises_a_card_the_owner_applies_and_undoes.
  • The old name shown as a second agent: the old name now rides on the chip of the agent it names: "kirocrew-conductor (also its old name, kirocrew-ledger-conductor)". The title does not count it as a second agent.
  • Evidence gaps: new screenshots from a pod run on this head replace the stale ones: pending, applied and after Undo. They show the current "Open chats" and "Each tool" copy. Rows this pod could not show are pinned by named tests, as the description lists.

GPT's race finding is deferred to #25974 by owner decision, and there is no code change for it. Rebased onto main a8fe017686.

@buluoray

Copy link
Copy Markdown
Contributor Author

UX finding on 82d3dc00ca, addressed in d489c40598:

  • The "Each tool" row could be read backwards: the row now uses the reviewer's text word for word: "nothing is auto-approved; this agent's existing permissions still apply" (TEMPLATE_SERVER_TOOLS_NOTE). The card builds this row in Python, so no locale catalog holds it. Test: test_the_card_never_promises_a_prompt pins the new text, and the old text fails it.

The screenshots still show the earlier wording of this one row; the description says so. The head is rebased onto main 4df4f0209f, and the merge was clean. No other check was red on 82d3dc00ca.

@buluoray

Copy link
Copy Markdown
Contributor Author

Findings on d489c40598, addressed in 4d0e594f95:

  • Opus 5.5, select_provider_backend call without the crewmate pin (H17): fixed in code. _caller_backend now passes crew_backend=crewmate_backend_pin(cfg, sk) the same way the other callers do. This one fix also clears Backend Tests (3.12, 6) and (Windows) (6), which failed on test_crewmate_harness.py::TestEveryCallerPassesThePin. It clears Coverage Gate too, which failed only because those backend tests failed. Tests: that scan test, plus test_with_no_provider_the_member_selector_answers, which checks that the pin is passed through.
  • GPT 6.1, a stale rebuild can reverse an Apply or Undo: this is the race class deferred to fix(agent): hold the spec lock across a conductor rebuild's record read and spec write #25974. No code change; the owner override is pending.

Rebased onto main 72382c2d9d, which shares no files with this PR.

@buluoray

Copy link
Copy Markdown
Contributor Author

Findings on 4d0e594f95, addressed in b2dc4846d4:

  • Opus 5.5, an approved addition switches back on a tool the owner turned off on the MCP page: fixed in code, no override. Every merge of the additions record now adds the MCP page's current disabledTools for that server (template_mcp_additions._page_switch_offs, read live through list_servers). This covers both the plain path and the restriction-only path, at rebuild and at spawn, the same way the crewmate path applies the switch through mate_worker.globally_disabled_refs. A tool switched off after the approval is off on the next merge too. Tests in test/test_template_mcp_additions.py:

    • test_an_addition_never_brings_back_a_tool_the_page_switched_off
    • test_a_restriction_and_the_page_switch_both_apply
    • test_an_unreadable_page_adds_no_switch

    Skipping the switch read fails two of them.

  • UX, nothing on the card says it can be undone: the card has a new "Undo" row with the reviewer's text, "remove it from this card any time" (TEMPLATE_SERVER_UNDO_NOTE). Test: test_the_card_says_it_can_be_undone.

  • UX, stale screenshot: new screenshots from a pod run on this code show the current "Each tool" row and the Undo row: pending, applied, and after Undo.

Rebased onto main 6b41c4b2d3, which shares no files with this PR.

Any template-based session asks the user, mid-chat, for an MCP server it
lacks. The kirocrew-core tool names a server and its source; the gateway
resolves the caller and its template from the attested session, builds the
entry from a server it runs or the official registry plan, and raises a
template.mcp_server card that lists every template and open session the
addition reaches. Only the owner's browser applies it, into the per-template
additions record; its Undo removes only the record its own card wrote.

Unattended turns (schedule, subagent, channel, patrol or any turn the user
did not send) are refused with the reason. propose_change cannot raise the
kind, and the card carries no autoApprove or allowedTools.
@buluoray

Copy link
Copy Markdown
Contributor Author

Findings on b2dc4846d4, addressed in 6d643d549f:

  • Backend Lint & Type Check, mypy "Invalid index type" at template_mcp_additions.py:316: this also kept the test shards from starting, which made Coverage Gate fail. Fixed by the change below. mypy passes on the changed files.
  • First Principles, a second reader of the MCP page's tool switches: removed. merge_into now groups the output of the existing mate_worker.globally_disabled_refs per server instead of reading list_servers() itself. The switch-off tests still pass: test_an_addition_never_brings_back_a_tool_the_page_switched_off, test_a_restriction_and_the_page_switch_both_apply, test_an_unreadable_page_adds_no_switch. The description now names both changes to (a)'s module.
  • GPT 6.1, a concurrent rebuild can remount a server after Undo: this is the race class, deferred to fix(agent): hold the spec lock across a conductor rebuild's record read and spec write #25974 by owner ruling. No code change.

The H17 crew_backend fix from fdd9554bf0 has been on the branch since b2dc4846d4. Rebased onto current main, which shares no files with this PR.

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.

2 participants