Repository navigation
feat(session-environments): stop offering bot threads a remote environment - #34572
kyleseaman wants to merge 1 commit into
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. One guard covers a path that no bot thread reaches today. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: keep a bot's chat on this machine instead of offering to move it to a remote workspace (ADDITION; Session Environments is behind a developer flag, so the default is unchanged).
[FIRST-PRINCIPLES-REVIEWED] 3247d1b Description read[DESCRIPTION-READ] 1b099309843fded9455a79751a61426ca38fd18ffc2ff4315d3f5e388d866098 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the server-side gate on the existing [DESIGN-REVIEWED] 3247d1b Description read[DESCRIPTION-READ] 719e31375b8ab728d804cb63d1fad1a6495013032f566ec74bbb52062c3568db 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 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: |
1b861dc to
8c126b3
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/routes/chat.py, src/kiro_crew/dashboard/chat_turn/permission_prompt.py, src/kiro_crew/dashboard/handlers/files.py and the approval/chat-lifecycle tests this PR's tests import alongside (b4cc7f9 -> e34c1d5); CI re-running on 8c126b3. The patch is unchanged (git range-diff '='); the PR's tests and the overlapping test files pass locally. The previous head's Dependency License Gate was cancelled after sitting queued for over an hour with no runner. |
8c126b3 to
3247d1b
Compare
|
Rebased: main moved in src/kiro_crew/notifications/bridge_transport.py and test/test_handlers_messaging_composition_contract.py (e34c1d5 -> 8c94d1b); CI re-running on 3247d1b. Main now carries #34646, which clears the Slack code-channel and markdown-it 4.3 reds this PR inherited. This push also carries the First Principles fix below. |
|
Code change approver recommendation: ApproveAutomated, not a person, and not a review: a maintainer still decides.
Why: the decider approves with p_defect 0.1 <= 0.12 and every rail passes. The PR stops offering bot threads a remote environment, entirely on the server side. GET lists only the profile a bot thread is already bound to, so the chip hides when there is no choice and still lets an older choice move back. PUT refuses a non-null profile for a bot thread, and the default bind skips bot threads. is_member_thread checks both the slot's mode and its key. No other code in src/ writes the choice store, and the frontend's readers (the chip and the side-panel placement hook) keep working with the shortened list. The new tests cover all three paths and would fail without the change. The change matches its description and stated non-goals, and I found no regression on ordinary chats. If this recommendation is wrong, reply here; the replies are how the approver is evaluated. |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes on 3247d1b for one part: removing the remote choice from bot threads.
Please change: the new refusal. On main, a bot's chat on the Bots page shows the "Run this chat on" chip and lists every saved profile, and a user can pick one today. Your own "Before (main)" screenshot shows that. This head takes that away in two places:
api_chat_slot_environment_getnow lists no profile for a bot thread.api_chat_slot_environment_putanswers 400choice_refused/bot_threadfor any profile.
The description gives a design reason: a bot's crons, wakes and sub-agents stay on this machine, so moving one thread splits its files and terminal. It does not show that a bot thread on a remote environment fails. That makes this a new refusal of something main allows, and we don't take those. Two ways forward that keep main's behaviour:
- Keep the offer, and put the bot-thread restriction behind a setting that is off by default (for example under
session_environments), so an owner who wants it can turn it on. - Or keep the offer and explain on the chip, for a bot thread, what moving it does (crons, wakes and sub-agents stay here).
Fine as is. The apply_default_environment skip for bot threads matches main, since bot threads are already created on a path that skips the default, so that line can stay. The tests are clear. No regex.
|
This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/). Review result on this head: no blocking findings. The review checked the following:
Done well: the refusal lives on the server and keeps a way back, so a thread bound before this change still shows where it runs and can return to this machine. Optional:
|
|
Closing this approach. The refusal for bot threads that the review of 2026-11-11 asked to change is dropped. A new PR from main will replace this one: it moves the choice into the bot's settings, where it applies to the workers the bot starts, and leaves the server routes as they are on main. I'll link it here when it is open. |
|
The replacement is open: #38620. |
Problem / Motivation
Goal: Bots are no longer offered a remote Session Environment, so a bot's thread stays on this machine unless it already runs elsewhere.
A bot's chat on the Bots page drew the composer's "Run this chat on" chip, listing every saved profile, whenever the developer flag was on and a profile was saved. A bot sets its other session controls on its profile card, and nothing on the Bots page explains what moving one thread to a remote workspace does.
Why it matters
A bot works through crons, wakes and its own sub-agents on this machine. Moving one thread to a remote workspace splits its files and terminal from the rest of its work. The chip offered a choice bots do not support.
Not a goal
What changed (motivation → approach → change)
All server changes are in
src/kiro_crew/dashboard/handlers/session_environments.py, and each one identifies a bot's thread with the existingslot_ownership.is_member_thread(modememberand amember-key).GET /api/chat/slots/{slot}/environmentlists only the profile the thread is already bound to. With no recorded choice it lists none, so the existing chip renders nothing. A thread bound before this change still shows where it runs and can still move back to "This machine".PUTon the same route refuses a remote profile for a bot's thread (choice_refused, reasonbot_thread).profile: nullstill succeeds.Backwards compatibility
Breaking:
PUT /api/chat/slots/{slot}/environmentnow answers 400choice_refused/bot_threadfor a bot thread (slot modemember) when the body names a profile. Writer sweep on origin/main @ 8c94d1b: the only client writer iswebsite/src/components/SessionEnvironmentChip.tsx, which no longer lists a remote it could send for a bot;apply_default_environmentis the only server-side writer and now skips bot threads.profile: nullstill succeeds, so an older choice can be cleared.Reader: website/src/components/SessionEnvironmentChip.tsx:SlotEnvironmentChip -- crew page -- hides with no profile and no choice; with an older choice it lists that profile and "This machine" (
test_a_bots_thread_is_offered_only_the_environment_it_already_runs_on).Reader: website/src/components/sessionEnvironmentHooks.ts:useSlotEnvironmentPlacement -- crew page -- reads
profileand looks its name and folder up inprofiles, which still holds the bound profile, so the side panel's Files and Terminal placement is unchanged.Reader: website/src/pages/chat/SidePanel.tsx:EnvironmentPlacementError -- crew page -- reads only the query's error state, which this change does not touch.
Tests
test_the_default_never_binds_a_bots_thread: a new bot thread stays on this machine with a default profile set.test_a_bots_thread_is_offered_only_the_environment_it_already_runs_on: no choice lists no profile; an older choice lists only its own profile; an ordinary chat still gets every profile.test_a_bots_thread_cannot_choose_a_remote_environment: the route refuses a profile for a bot thread, still clears an older choice withnull, and still lets an ordinary chat choose.All three fail with the production change reverted and pass with it. Determinism:
test/test_default_session_environment.pypassed 5 of 5 repeated runs and again in reversed test order.Manual verification
Screenshots / video
A bot's chat on the Bots page, two saved profiles, dark theme.
Before (main): every profile is offered.
After, a bot thread with no recorded choice: no picker.
After, a bot thread bound to Dev box before this change: it still shows where it runs and can move back, with no other remote offered.
Light theme
Related Issues
Part of #10433
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)