Repository navigation
fix(shared-crew): let a relay teammate see a team Crew's Bots - #34334
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the teammate branch reuses the existing relay-teammate check, returns a separate config-only row, and leaves the owner's path and every member write untouched. Notes
[DESIGN-REVIEWED] 2923dbc Description read[DESCRIPTION-READ] 118765c671f348506a7e0ed83e8ccd47c6850100d18f2c72867d4c38a215dbae 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix gives the relay-teammate read the same admission that People, sessions and mode already use, and every other item is part of removing the reported "Could not load your bots" failure (#34327). What this change shipsInventory (8 items) — 8 justifiedIntent: a teammate who reaches a team Crew through the Kiro relay can see its Bots instead of a load failure. FIX.
[FIRST-PRINCIPLES-REVIEWED] 2923dbc Description read[DESCRIPTION-READ] 0dfce11b9b7f740ab6fb98e401ac5a3c66b3f40e7b3ed431d31bbe2bb9f14070 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read the new chat notice correctly ("a warning that I can't talk to this bot"), and the screenshots show the teammate's Bots list in both themes. Notes
[UX-REVIEWED] 2923dbc Description read[DESCRIPTION-READ] e86e281a175949eaa64de05879040fa0376ac2f926738bdb001466af90149bb1 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed 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: |
b216b27 to
e8fa340
Compare
e8fa340 to
ca8f07f
Compare
|
ca8f07f to
2923dbc
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Read the whole diff at 2923dbc (23 files), tests included. Approving.
What I checked:
GET /api/membersnow answers a relay teammate that the Kiro relay verified (_relay_teammate, already on main for the People, sessions and mode reads) with a narrow roster. This loosens a read that was a 403 for them. It adds no new refusal.- The branch sits after the app-caller guard and before the owner gate, so the owner's read is unchanged. A test compares the owner's response with the teammate branch forced off, and the bytes match.
_teammate_rosterreads the config only. It lists person-created Bots only, and each row holds name, slug, display name, description, avatar, source anddashboard_created, with the display name and description masked as the owner's row masks them. A test lists 27 owner-private fields (slot, last DM line, projections, workspace, model, star order and so on) and checks none is present, and that the workspace value never appears in the body. Nothing is written, so the owner read's reconcile never runs.- Any other non-owner still gets 403
owner_only, and the thread and fresh-start writes stay owner-only for the teammate. Tests cover both. - The granted read is audited under the relay caller's own label.
- The Bots page words the thread open's
owner_onlyrefusal as who may chat, with no retry. The new string is in all 13 locales and the translator context file. - No regex added. 102 checks pass and none is red or pending. Five more show cancelled, and each has a later success on this head (Issue Gate, PR Hygiene, PR Policy, GPT 6.1 Review, Sensitive Change Review).
Problem / Motivation
Goal: A teammate who opens a team Crew through the Kiro relay sees that Crew's Bots instead of "Could not load your bots."
GET /api/membersis owner-only:members_roster.api_memberscallsrequire_owner_dashboard_request(request, "members.list.read"), and a relay teammate'srelay:<Kiro user ID>subject never matches the owner, so the Bots page shows its load-failure notice.Why it matters
Team Crews exist so a team can use one Crew's Bots. Today a teammate cannot even see which Bots there are, and the page reports it as a failure with a retry that can never succeed.
Not a goal
What changed (motivation → approach → change)
Before writing code, three questions:
1. Does #29609 already cover relay teammates? No. #29609 allow-lists
/api/membersforis_guest_session, which ends incollaborators.is_collaborator_actor. That requires the actor's provenance to be in_MEMBER_PROVENANCES = {TAILSCALE_SERVE, TAILSCALE_LISTENER, SSM_INVITE}(src/kiro_crew/shared_crew/collaborators.py:36, which #29609 does not change). A relay teammate's principal comes fromidentity.relay_principal, which stampsprovenance=Provenance.KIRO_RELAY(src/kiro_crew/shared_crew/identity.py:217). Sois_guest_sessionis false for every relay caller, and the two PRs do not overlap.2. Which roster fields are owner-private, and what does the Bots tab need? Owner-private:
slot_keyandrunning(the owner's DM slot),last_message,last_message_stopped,has_dm_message,has_user_dm_message(the owner's DM history),projectionsandlast_active_ts(the owner's member log),has_goal,heartbeat_on,welcome_owed,welcome_claimed,starred,star_order, and the local setup (workspace,memory_store,memory_version,memory_owner,kiro_agent,model,reasoning_effort,worker_model,worker_reasoning_effort,approval_mode,dynamic_capabilities,dashboard_card_send,triggers). To render a row the page needsname,slug,display_name,avatar, plusdescription,sourceanddashboard_createdfor the label and the listing rule (rosterFilter.listedByDefault).3. What would "use" need? Listed under Follow-up for Bolin. None is opened here.
The change follows the pattern that let a relay teammate read People, sessions and mode (#32953):
api_membersasksroutes_identity._relay_teammate(the ingress-published relay caller plus akiro_relayhuman principal) before the owner gate, and a teammate getsmembers_roster._teammate_roster. That builds rows from the config alone with the seven fields above, masked as the owner's row masks them, and touches no binding, transcript or member log, so the owner read's reconcile writes never run for a teammate. A teammate's read leaves anallowedSEL row like the owner's, filed under the relay caller'srelay:<Kiro user ID>label withresources=relay_teammate(members_access._audit_teammate_read). Both new helpers are listed on thehandlers/members.pyfacade, as every roster helper is. It lists only Bots a person created here (dashboard_created); the other config rows reach the owner's list only through the owner's DM history. Because the check runs before the owner gate and returns false for the owner, the owner's response is unchanged.On the page, a thread open that comes back 403
owner_onlynow says "Only this bot's owner can chat with it." with no retry, the way the Dashboard tab already words its owner-only refusal (MembersPageThread.tsx, anownerOnlyflag on the thread outcome inmembersQuery.ts, and the newthread_owner_onlystring in every catalog with itsen.context.jsonnote). Every member write stays owner-only.Backwards compatibility
Compatible: the owner's response is byte-identical (pinned by a test), a non-relay non-owner still gets 403
owner_only, and the only new answer is a 200 to a caller that got 403 before.Removes nothing: the owner's roster and every member write keep their shape and gate; a teammate's narrower row is new.
Tests
test/test_members_roster_relay_teammate.py, over the real relay ingress, client-sent strip and token auth: a teammate's read writes oneallowedmembers.list.readSEL row underrelay:<id>; a relay teammate gets 200 with each owner-private field absent by name and only the person-created Bot listed; the owner's bytes match a run with the teammate branch switched off and still carryslot_key,running,last_message,projections,workspace,model; a non-owner token with a forged relay header is refusedowner_only; a teammate'sPOST /api/members/{slug}/threadand/fresh-startare refusedowner_only.MembersPage.test.tsx: a teammate-shaped roster renders, a threadowner_onlyrefusal shows the owner-only line, never "Could not load your bots" or "Could not open this bot's chat". Fails withMembersPageThread.tsxreverted (checked by hand; prove.py runs Python only).--sequence.shufflewith two seeds.Proof: PROVEN test/test_members_roster_relay_teammate.py::test_a_relay_teammate_reads_the_bots_without_the_owners_view, test/test_members_roster_relay_teammate.py::test_a_relay_teammates_read_is_audited_under_their_relay_label (head 2923dbc)
Local: isort, flake8, mypy on the changed module,
tsc -p tsconfig.app.json, eslint on the changed files, 752 members and shared-crew backend tests, 776 spec and doc tests, 66 frontend files undersrc/pages/members,src/i18nand the dock. The full local gate selected 1,259 backend files (1,244 cross-surface) and ran on one xdist worker for lack of memory, so I stopped it; CI runs that set.Manual verification
Captured the real
MembersPagegateway-free with the roster stubbed to teammate rows and every per-Bot route answering 403owner_only, in both themes.Screenshots / video
Relay teammate, dark: the chat column says who may chat, and the Dashboard tab keeps its existing owner-only line.
The Bots list a teammate now gets, in the switcher:
Related Issues
Closes #34327
Sibling sweep
Swept:
git grep -n "require_owner_dashboard_request" -- src/kiro_crew/dashboard/handlers/members*.py src/kiro_crew/dashboard/handlers/member_goals.pySibling: src/kiro_crew/dashboard/handlers/members_thread.py -- not affected -- a write that spends on the owner's account, kept owner-only by design
Sibling: src/kiro_crew/dashboard/handlers/members_thread_turns.py -- not affected -- greet and fresh start are writes, kept owner-only
Sibling: src/kiro_crew/dashboard/handlers/member_goals.py -- not affected -- the Goals tab is a per-Bot owner view, out of this PR's goal
Sibling: website/src/pages/members/CrewDynamicDashboard.tsx -- not affected -- already words its owner_only refusal plainly
Pattern harvest
Not generalizable: the narrowed row is specific to what the roster's owner view holds, and the relay-teammate admission already has one shared predicate (
routes_identity._relay_teammate).Follow-up for Bolin (use, not in this PR)
Each of these runs or wakes a Bot on the owner's account, and stays as it is here:
POST /api/members/{slug}/thread(open the DM): owner-only (members_thread.py:170); refused for a relay teammate, pinned by a test here.POST /api/chat(send into the DM slot): open to a relay teammate today, on main as well as here. Probed through the relay ingress, strip and token auth in front of the chat handlers: a teammate's send to an existing member slot (member-<slug>, derivable from the slug this roster now shows) passed every gate and was dispatched as a turn; an empty message reached the handler's ownmessage_required400. Route wrappers that only the full gateway installs were not in the probe. This PR does not change it, and it now matters more, so it needs a decision before teammates use this list.POST /api/members/{slug}/greetand/fresh-start: owner-only (members_thread_turns.py:47,:133); fresh start refused for a teammate, pinned by a test here.POST /api/spawn(run a Bot as a worker): owner-only for a dashboard user (messaging_api/spawn.py:346)./api/members/{slug}/goals*, the wake schedule): owner-only throughmember_goals._owner_member(member_goals.py:146).Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)