Repository navigation
feat(crew): let a crewmate request tools for its worker (preview) - #23562
Conversation
First Principles Review (Opus 5.5) — ✅ human override accepted@buluoray overrode this lane for |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the chat cards this PR exists to add. No screenshot shows the Preview opt-in card (Turn on / Not now) or the capabilities card with its addition lines and Details. Evidence gaps
Notes
[UX-REVIEWED] 1c14ef1 Description read[DESCRIPTION-READ] 579e7a552df2f234b8f034dd5cd1821bf3fbe8157c59023007e4ef5e8151a4c4 That sha256 names everything this verdict read: the PR description, plus the 7 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the preview is per crewmate and off by default, every write still goes through a card the user presses, and the one thing taken away ( Notes
[DESIGN-REVIEWED] 1c14ef1 Description read[DESCRIPTION-READ] e479b83b78d9231036de12a3b1432af153db6e9bb2ffeba3afd3ae8ea2a75d9c 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 1c14ef1 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
47c43fd to
7101dcf
Compare
7101dcf to
26afd4e
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]: Answer to the First Principles BLOCK on the default removing an existing tool. Product decision by Ray (buluoray): default off, first use raises a Preview opt-in card, so no existing crewmate loses the tool. With the flag off, |
26afd4e to
2530157
Compare
|
AI-review override not recorded: |
|
/ai-review override first-principles 2530157: Product decision by the maintainer (buluoray): dynamic capabilities stay off by default, and the first request_capabilities call while off raises a one-time Preview opt-in card, so no existing crewmate loses the tool. |
|
/ai-review override first-principles 6b8fd74: Product decision by the maintainer (buluoray): dynamic capabilities stay off by default, and the first request_capabilities call while off raises a one-time Preview opt-in card, so no existing crewmate loses the tool. |
Human judgment recorded@buluoray recorded a legacy release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
This override used the old command without a class. It was recorded as class |
6b8fd74 to
6ef2f7a
Compare
|
/ai-review override first-principles 6ef2f7a: Product decision by the maintainer (buluoray): dynamic capabilities stay off by default, and the first request_capabilities call while off raises a one-time Preview opt-in card, so no existing crewmate loses the tool. |
Human judgment recorded@buluoray recorded a legacy release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
This override used the old command without a class. It was recorded as class |
…view) Dynamic capabilities, a per-crewmate preview off by default, on top of Crewmate 2.0's conductor and worker. - find_capabilities reads what the worker has, what this gateway has loaded that it lacks, and the MCP registry; request_capabilities takes named additions the gateway resolves into the card's operations, with where each comes from and what runs without asking. - The hand-off result names the worker's servers and the gateway's extra ones. - ask_tool_access: one Preview card per crewmate asking whether it may request tools, while its flag is off. - An approved capability reloads a running worker in place, conversation kept, and the [Capabilities added] turn sends the waiting work back to it. - The Profile card's Dynamic capabilities switch.
6ef2f7a to
1c14ef1
Compare
|
/ai-review override first-principles 1c14ef1: Product decision by the maintainer (buluoray): dynamic capabilities stay off by default, and the first request_capabilities call while off raises a one-time Preview opt-in card, so no existing crewmate loses the tool. |
Human judgment recorded@buluoray recorded a legacy release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
This override used the old command without a class. It was recorded as class |
cruisercohen
left a comment
There was a problem hiding this comment.
Reviewed as security scope (crewmate capability / access-gate paths), comment only — not approving. No default-on widening; the design is fail-closed.
What it adds: a crewmate can discover (find_capabilities) and request (request_capabilities) skills / MCP servers for its own worker. The security-relevant properties I checked:
- Off by default, per crewmate.
dynamic_capabilitiesis a per-crewmate preview flag; there is no global key and the default is off. With it off,find_capabilitiesis refused at its route (403dynamic_capabilities_off),request_capabilitiesraises a Preview opt-in card instead of acting, and a proposedcrewmate.capabilitiescard is refused — the user's "Turn on" is the only way in. - Nothing applies without the user. Every capability change is a change card, inert until the user presses it; the
set_*/request_*tools only offer a card.find_capabilitiesis read-only (worker tools + gateway-loaded servers + registry search). - Scoped to the crewmate's own file. A requested registry server is installed into the crewmate's own worker file, never the user's MCP config;
gateway_matchesmarks a server as gateway-provided only when it is byte-for-byte equal to the gateway's enabled entry (command/args/env/headers/cwd), so a tampered or switched-off spec can't borrow gateway provenance. - Workers can't reach it. Both tools are in
MATE_WORKER_EXCLUDED_TOOLS; only the crewmate's own conductor thread reaches them, and the hand-off capability summary is added only when the caller is a crewmate conductor and the target its own worker (member-id match) with the preview on.
Verified on the merge with current main: 0 failures across the dynamic-capabilities, catalog, dispatch, tool-access and goal-setup suites; and a mutation making the flag default-on turns 9 off-gate tests red (including the 403 route refusal) — so the off gate has teeth.
No security-default change. Final sign-off is a maintainer's.
Problem / Motivation
Goal: A crewmate can find the tools, MCP servers and skills its worker is missing and ask the user for them on a card, behind a per-crewmate Dynamic capabilities preview that is off by default.
Crewmate 2.0 (#23010) gives each crewmate a worker built from its own kit. When that worker reports a missing capability, the crewmate today can only tell the user and wait: it cannot see what this gateway already runs or what the MCP registry offers, so it often says a tool does not exist without looking. After the user adds something by hand, a worker that was already running does not see it until its next spawn.
Why it matters
The crewmate's job is to get the work done. Without a way to look up and request what its worker lacks, every missing tool turns into a manual trip to the crewmate's advanced settings and a stalled task. Keeping it a per-crewmate preview lets one crewmate try it without changing any other.
Not a goal
request_capabilitiesadditions.What changed (motivation → approach → change)
Goal → the crewmate looks first, then asks on a card, and the work resumes on the same worker → built on #23010's conductor/worker split, with every write still going through the existing
crewmate.capabilitiescard andmate_capabilities.put.find_capabilities(POST /api/member/self/capabilities,dashboard/handlers/member_capability_catalog.py,mate_capability_catalog.py): what the worker has, what this gateway has loaded that it lacks, and (for a query) the MCP registry, with provider fields redacted and no transport returned.request_capabilitiesnow takes namedadditions({server, source: "gateway"},{server, source: "registry", registry_id},{skill}) that the gateway resolves into the card's operations plus anoriginsmap; a draft of additions takes no rawoperationsalongside (invalid_additions), so none is folded under Details unseen. The card shows one plain line per addition, with launch lines and origins under Details (an addition with no auto-approved tool says it adds no new grant and the current approval settings still apply, not that every call asks, since a crewmate on Trust runs calls unasked); a card that only adds servers this gateway already runs carries no third-party warning, and a widening approval keeps its acknowledgement.On the worker-report wake (not a user turn), only a card whose additions are all servers this gateway already runs is admitted (
member_self._gateway_servers_only); anything else stays user-turn only.The conductor's own
session_create/session_sendresult names the worker's servers and the gateway's extra ones the user has not switched off (dashboard/crewmate_dispatch_capabilities.py).Off (the default),
request_capabilitiesstays, so no crewmate loses it. Its first call raises one Preview opt-in card instead of the capabilities card (member_self,mate_tool_access.py), saying in plain words what the preview does, with Turn on / Not now. Turn on writes the flag and raises the held request as its own card, so the crewmate does not ask again (member_self.continue_after_opt_in); only a card for the thread's own crewmate does this, and only once that crewmate's flag is on. The offer and held request are recorded before the card is raised: a failed write raises no card (503 opt_in_unrecorded), and a card that is not raised takes the record back. Not now leaves it off; every later call is refused with a plain line, and no second card is raised; a card the store has pruned counts as expired. Off,find_capabilitiesstays listed and its route answers403 dynamic_capabilities_off: the flag is read on every call, not through the pooledkirocrew-mateserver's cached tool policy, so a Turn on reaches a running conductor at once. Off, the conductor's prompts are the wording from before the preview (*_manualincrewmate_prompts.json).An applied capability reloads an idle running worker in place, conversation kept, and a
[Capabilities added]turn sends the waiting work back to it, only in the thread of the crewmate the card changed (dashboard/crewmate_worker_reload.py,goal_setup.schedule_capabilities_nudge).The Profile card's Settings page gets a Dynamic capabilities switch with a Preview tag, stored on the crewmate's own record (
KiroCrewAgentConfig.dynamic_capabilities,crewmate_dynamic_capabilities.py).Rebased onto feat(crew): give each crewmate its own config, a conductor and a worker #23010 as merged: the
change_card_catalogandagenthunks moved tochange_card_catalog_kinds.py/change_card_catalog_plans.py/agent_parts/spec_grants.py, the suite-wide preview fixture moved totest/conftest_resets.py, and the switch uses the Settings page's row layout.A gateway addition copies only a server the gateway lists as switched on, and only one whose entry sets no
envorheadersvalue and has no credential argument thatagent_capabilities.safe_viewwould mask (--api-key <value>,-e NAME=<value>; refusedcarries_settings): a card's params reach the proposing crewmate, so a credential never rides on one. The card calls a server "this gateway's" only when the draft equals the gateway entry key for key (gateway_matches), so a changedenv,cwdorargskeeps its code warning.propose_changerefuses caller-suppliedorigins.A worker still cold-starting when a capability is applied keeps its reload owed (the busy check runs before the no-provider check).
Spec:
docs/system-specs/modules/crew-mode.md,docs/system-specs/modules/config.md,docs/architecture/mcp.md,src/kiro_crew/docs/crew-members.md,src/kiro_crew/docs/agent-spec-fields.md.Backwards compatibility
Compatible for
request_capabilities: every existing crewmate keeps it with the flag off (the default), and its first use raises the Preview opt-in card. A config withoutdynamic_capabilitiesloads as off. Writer sweep on origin/main @ 5d7a22d. What is still taken away, one line each:Reader: src/kiro_crew/dashboard/handlers/change_cards.py:api_cards_agent_propose -- chat --
propose_changerefuses acrewmate.capabilitiescard from a crewmate whose flag is off, so the opt-in is the only way in, and refuses caller-suppliedorigins; test/test_crewmate_dynamic_capabilities.py, test/test_mate_capability_catalog.pyThe take-away check also fires on
src/kiro_crew/mate_config_migration.py, which changes only in its module docstring (one paragraph added); no migration code changes. Its readers:Reader: src/kiro_crew/dashboard/server.py:migrate_existing_crewmates -- release -- the startup migration's code is unchanged; test/test_mate_config_migration.py
Reader: src/kiro_crew/mate_config.py:uncarried_restrictions -- crew page -- the create path's restriction check is unchanged; test/test_mate_config_migration.py
Reader: src/kiro_crew/mate_worker_kit.py:_worker_base_or_none -- crew page -- Advanced > Re-copy from template reads the same base; test/test_mate_worker_kit.py
Tests
test/test_crewmate_dynamic_capabilities.py: the flag is per crewmate, off by default, read from the record on every call (off,find_capabilitiesanswers 403, and a Turn on takes effect on the next call); both capability tools stay listed; the conductor and worker prompts follow it.test/test_mate_capability_catalog.py: catalog order, redaction, additions resolved into operations, every refusal code (a switched-off server, one carrying env, headers or a credential argument, while plain arguments still pass), the card's rows and warnings, a changedenv/cwd/argsnot counted as the gateway's, additions with raw operations refused, andpropose_changerefusingorigins.test/test_mate_tool_access.py: off, the firstrequest_capabilitiesraises the opt-in card and holds the request; Turn on raises that request as its card, once; Not now (and an expired or switched-off-again card) refuses with no second card; a waiting card is not raised twice; it is per crewmate; on, the request is its card unchanged; a pruned card counts as expired while an unreadable store leaves it waiting; the record is written before the card, a failed write raises none, a refused card takes it back, a lost card id waits then ages out, and two calls claim one ask.test/test_crewmate_worker_reload.pyalso checks that a card for another crewmate wakes nobody in this thread.test/test_crewmate_dispatch_capabilities.py: only the conductor's own hand-off carries the capability line, and a switched-off server is not offered.test/test_crewmate_worker_reload.py: an applied card reloads an idle worker in place, leaves a busy one alone, and keeps a cold-starting one owed.test/test_goal_setup.py,test/test_member_goals.py,test/test_member_mate_tools.py,test/test_mate_config_migration.py: the nudges, admission and prompt wording.website/src/pages/members/CrewProfileSettings.test.tsx,website/src/cards/CardChanges.test.tsx,website/src/cards/ConversationCard.test.tsx,website/src/i18n/toolAccessCopy.test.ts: the switch, the card's summary and Details, the opt-in card's Turn on / Not now (no other card has them), and the copy.test/test_agent_refactor_spec_bytes.py(conductor, worker,kirocrew,kirocrew-workerspecs) andtest/test_dashboard_server_composition_contract_reach.py(the added routes).Proof: not provable -- other: new feature, the new tests exercise code this pull request adds
Manual verification
Rendered the built SPA against stubbed APIs: the Settings page shows the switch off with its Preview tag, and pressing it sends
PUT /api/agents/<name>with{"dynamic_capabilities": true}and shows it on, in light and dark. The catalog, card and reload paths were not run against a live gateway.Screenshots / video
Settings page, light, off and on:
Dark
Related Issues
Follows #23010.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.