Repository navigation
feat: add the Session Environments UI and dashboard API - #22238
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. All new behaviour sits behind the developer flag, which is off by default. The PR includes 36 screenshots. Removing [DESIGN-REVIEWED] 0fad680 Description read[DESCRIPTION-READ] c64f132877143aebecddb203d13784bfa955112b68540cb18dc528152ec29683 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. Every surface sits behind the developer flag, which is off by default, and the new Notes
What this change shipsInventory (10 items) — 9 justifiedIntent: let the owner bind a chat to a Coder workspace and work on that workspace's files and terminal from the dashboard. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 0fad680 Description read[DESCRIPTION-READ] 6f58c66fbd3d7eddcb2ba0f52c3aaee452e4062b4e3f4fe663f749eff3313a71 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 screenshots cover every control the PR adds, and the blind reader read each main-path control correctly. Those are the "Run this chat on" menu, Add Coder profile, Check Coder connection, the Files panel and the conflict actions. The reader declined Terminal only because they wouldn't know what to type. Notes
[UX-REVIEWED] 0fad680 Description read[DESCRIPTION-READ] 7e4b9a8848786d7dd6b393f2d67ae470b7ef2d13b76008715cc01e10bca7cbd5 That sha256 names everything this verdict read: the PR description, plus the 39 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 findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- website/src/hooks/usePanelDocumentActions.ts:73 -- Chat-specific refusals poison the shared file-read cache
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (LOW): Every condition needed is confirmed in code. The developer flag has to be on ( False positive or not applicable? A repository writer can comment: |
1a7f2c3 to
e5722a8
Compare
e5722a8 to
cb93ffe
Compare
cb93ffe to
4563717
Compare
4563717 to
062ebbb
Compare
|
|
|
|
|
|
|
Inherited red on |
|
HOLD at 960a423.
The conflict from r123 is gone. Opus and GPT have no blocking findings, and the earlier findings have dispositions. — crew-pr-reviewer (r124) |
|
Rebased onto main |
|
|
|
|
|
|
|
|
|
|
|
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES on 6ca0f8d. This also stays reserved for human review: it adds seven dashboard routes, including a remote workspace file write, and changes which machine a chat's terminal runs on. Every new handler is owner-gated, and the Opus and GPT findings since r124 all have fix dispositions.
What needs changing:
- The two "Before the flag is turned on" items (a live Coder run, and a gateway-side guard for the file, diff and Git routes the client alone keeps off a remote chat) are still untracked, as r124 noted. Please open one issue for each and link both in the description.
- The branch conflicts with main in
test/test_change_card_setting_classes.py. Rebase. - Lane notes on this head still have no reply: First Principles item 9 (
PREVIEW_SESSION_ENVIRONMENTSas a second gate), the UX notes (strand warnings name profiles by id, duplicate intro text, Copy/Discard over a binary file, the cut-off 256 KB label), andterminal.pyat 1,805 lines, past the 1,600-line split point. A fix or a one-line reason for each is enough. - macOS backend shard 3 is red on this head. The description blames leaked leases that #24590 fixes; a link to the same failure on main would confirm it.
A new head after the rebase needs a fresh review.
— crew-pr-reviewer (r128)
|
|
|
Replies to the lane notes and the review asks, as of First Principles, second gate ( UX, terms. No rename in this PR. Each term names a different thing: Session Environments is the page, a profile is a saved setup, a workspace is the Coder machine each chat gets, a template is the Coder template a profile names, and "this machine" is the gateway host. The intro defines profile and workspace where the reader starts. UX, fixed in
macOS shard 3. The cap is inherited from main. Main's nightly run 40459526858 on The rebase is mechanical, and |
|
|
UX Review on Blocker, "Working folder" gives no example: fixed. Note, The other notes ( |
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at db0a670. This also stays reserved for human review: it adds seven dashboard routes, including a remote workspace file write, and changes which machine a chat's terminal runs on. Each new handler is owner-gated (session_environments.py).
The r128 lane notes are answered: the preview switch has a reason, the profile names and 256 KB copy are fixed, terminal.py is split to 1,534 lines, and the macOS shard is linked to main's own run.
What needs changing:
- The two "Before the flag is turned on" items (a live Coder run, and a gateway-side guard for the file, diff and Git routes) are still untracked. The Design Review on this head repeats the second one. Please open one issue for each and link both in the description.
- The branch conflicts with main again. Rebase.
- The UX notes on this head have no reply: raw backend strings shown as-is, workspace rows that don't name their chat or profile, and the "Run this chat on" explanation repeated three times. A fix or a one-line reason for each is enough.
A new head after the rebase needs a fresh review.
— crew-pr-reviewer (r129)
The dashboard half of remote session environments, on top of the Coder backend: the Settings card with its readiness check and workspace list, the composer environment chip, the remote Files panel and terminal, the side panel's placement guard, the per-chat environment and file routes, default-profile routing for new chats, and the config-editor validators. Behind the developer flag (off by default): while KIROCREW_DEV_MODE is unset the gateway offers no profile, so the picker stays hidden and a new chat is never bound to the default profile.
… errors with details, one menu explanation
|
Replies to r128 / r129, as of The two "Before the flag is turned on" items are handled in this PR, so neither needs a tracking issue.
The description's Manual verification section now says both. Rebase: mechanical. The ui-index is regenerated, and the conflict with #24091 in UX notes on
Each fix has a test that fails without it (4 in |
Problem / Motivation
Goal: give the owner the controls for remote session environments: pick a Coder workspace for a chat, see and edit its files, open its terminal, and configure Coder profiles in Settings.
Part A (#19833) runs a bound session on its Coder workspace but has no way to bind one. This PR is the dashboard half. Part A is merged to main (
ab2f15c57b), so this PR now targets main directly.Why it matters
Without these controls the backend in #19833 cannot be used: nothing binds a chat to a workspace, and a remote chat's Files and terminal would act on the gateway.
Not a goal
What changed (motivation → approach → change)
src/kiro_crew/dashboard/handlers/session_environments.py,src/kiro_crew/dashboard/routes/sessions.pysrc/kiro_crew/dashboard/chat_api/slot_create.pysrc/kiro_crew/coder/session_browse.py,src/kiro_crew/remote_session/workspace_tools.py,src/kiro_crew/session_environment.py,src/kiro_crew/config,src/kiro_crew/providers/acp_runtime_start.py,src/kiro_crew/coder/session_launch.py,config-baseline.jsoncoder sshargv, the start-stage recorder, and thedefault_profilesetting. Part A'stest_the_guest_has_no_write_moderecorded that A had no caller for a guest write; this PR is that caller, so the test gives way to the write-path tests. A guest older than these files (one that answers "op must be …") is reinstalled once and the request retriedsrc/kiro_crew/dashboard/chat_turn/eager_spawn.pysrc/kiro_crew/dashboard/handlers/terminal.pycoder ssh; never a local fallback (see below); no gateway completion or cwdsrc/kiro_crew/dashboard/handlers/core_config_schema.py,src/kiro_crew/dashboard/handlers/core_config_patch.py,src/kiro_crew/dashboard/handlers/core.pysession_environmentswith the loader's own normalizers; the success audit line for one of these structured writes records the path only, not the whole record;core.py's facade manifest names the merge helper it forwardssrc/kiro_crew/dashboard/change_cards_settings.pysrc/kiro_crew/change_card_catalog_kinds.pysession_environmentskeys for change cards: the URL and whole section as code-exec settings (they pick the machine that runs a session's commands), the default profile and shutdown switch as cannot-widen. These four entries sit inchange_card_catalog_kinds.pybecause main's #22845 split moved both lists there fromchange_card_catalog.py;test_session_environment_paths_keep_their_classfails if one is dropped or reclassedsrc/kiro_crew/docs,docs/feature-map/README.mdwebsite/src/pages,website/src/components,website/src/api,website/src/hooks,website/src/utils,website/src/assetswebsite/src/i18n,website/src/test,website/eslint.i18n.config.js,website/scriptsDeveloper flag. With
KIROCREW_DEV_MODEunset the gateway offers no profile, refuses a chosen one as unknown, and never binds a new chat (test_flag_off_offers_no_profile_and_binds_no_new_chat). The placement read skips the choices store, so an unreadable store can't lock a local chat's tabs (test_flag_off_placement_read_skips_an_unreadable_choices_store). The Settings tab also sits behind a new per-device Feature Previews switch,mc-preview-session-environments.The gateway decides where a chat's terminal runs. A side-panel terminal names its chat (
?slot=). With the flag on, the gateway refuses a local shell for a chat bound to a profile, even if the client didn't ask for the workspace shell (?remote_slot=). A bound chat gets aterminal_wrong_machineframe and the tab parks. A placement the gateway couldn't read (Coder or the choices store failed) also opens no local shell, but getsterminal_placement_unavailable, which the tab redials, so a brief outage never strands a live terminal. The bottom terminal names no chat and is the gateway's own, as on main.File, diff and Git routes refuse a remote chat.
/api/file-read,-raw,-stream,-watch,-write,-diff,/api/project/git,/git/statusand/git/logread this machine's files, so a request whose?slot=names a chat on a session environment is refused before the route runs (409chat_runs_remotely, one fixed message that names no path; an unreadable placement counts as remote). The side panel's open, diff and save send their chat'sslot=. Limits: a request without?slot=passes unchanged, since the Files page, library previews and image thumbnails share these routes and carry no chat; a slot the gateway does not hold passes too; the routes stay owner-only, and a non-owner gets the route's own answer, so the guard never says where a chat runs. With the flag off nothing is refused and the placement store is not read. The client still keeps those tabs off a remote chat (a skeleton or error while placement loads or fails, then a pointer to the Files tab), and a terminal opened here before the chat was bound stops rendering. Code:dashboard/remote_chat_guard.py, wired indashboard/routes/taskrunner.py.Errors and labels. A failed switch shows inline beside the chip. Removing a profile says, beside Save, how many live chats it would strand. A failed check says what to do, with raw output under Details. A Remote Files conflict offers "Load workspace version (drops my edits)" and "Copy my edits", only on the failed file; a save made under a profile's old working folder is refused. A refused clipboard says so. The template field lists the deployment's templates, takes a typed name, and explains a failed load. "Ask the agent how to fix this" is left off only where an unsaved draft would be lost. Archived rows have "Reopen chat" and say how to keep the workspace. Over unsaved edits the buttons stay, disabled, and "Save or discard your changes first." is said once above the list. A refused Coder URL's reason sits under the box; the save banner just points there. A refused terminal offers no Reconnect.
!commands and Run in terminal refuse a chat on a profile. Disabled controls say why. One name per concept: profile (a template plus a working folder), the "Run this chat on" menu, a workspace per chat. The per-profile stop switch says it overrides the global one, with its own MicroVM line.Backwards compatibility
Compatible: every new route is owner-only and answers "this machine" while the flag is off. A terminal, file, diff or Git request without
?slot=behaves as on main;?slot=only adds refusals, and only while the flag is on.Removes nothing: this PR only adds routes, query parameters and UI; nothing main accepts is rejected, renamed or removed.
Tests
test_session_environment_handlers(including the terminal refusal at the socket and helper level, each refusal's code, and the flag-off placement read),test_session_environments_config_api,test_default_session_environment,test_json_object_body_guard,test_remote_chat_file_guard(each guarded route refuses a remote chat; local, unknown and unnamed chats, a non-owner and the flag off reach the route; the refusal names no path).usePanelDocumentActions.chatSlot), workspace rows name their chat and profile, plain Coder errors with the raw text under Details, terminal registry (slot/remote_slotquery,terminal_wrong_machineparks the tab,terminal_placement_unavailableredials), CLI panel banner, settings coverage, i18n style.Inherited CI reds (not this PR's)
These fail in files this PR does not touch. Each is re-run once, and none is fixed here.
test/test_crew_log_fullscan_guard.py, which also fail on a cleanmaincheckout (2356a1ba1c). They failed on Backend 3.12 shard 2 and Windows shard 2 atfa32704f0a:test_a_cold_prime_copies_the_fold_state_a_fixed_number_of_timestest_a_ws_connect_does_not_fold_every_open_slottest_a_ws_reconnect_with_nothing_new_reads_a_fixed_number_of_entriesc399f47437(aftertest_an_eager_advance_on_an_un…), 116 atfa32704f0a(aftertest_a_dispatch_view_for_one_unit_reads_a_fixed_number_of_units) and 287 at2ac56e2150. The open PR test(crew-log): release full-scan guard handles at the test boundary #24590 releases those leases.test/test_slack_team_id_env.py::TestSpawnEnvtests fail withFileNotFoundError: [WinError 2]. That test file is new from main's feat: pass the slack workspace id to agents as KIROCREW_SLACK_TEAM_ID #22380, and main's own CI fails the same way ona3ee04f574(job 121866397755) and5285bc2878(job 121891311949). This PR touches neither the test noracp/client_start.py.2ac56e2150only:test_a_first_history_page_in_a_new_process_reads_the_page_not_the_file, also a strict XPASS in that file. Main's test(crew-log): drop stale xfail on the first-history-page guard #24467 removed its stale xfail, and the current base includes that fix.Analyze (javascript-typescript): the analysis finished, and the job failed while uploading its results.Manual verification
Kyle (PR owner) has run the Coder environment end to end against a live Coder deployment.
The two items once listed for before the flag is turned on are both handled in this PR: the live run above, and the gateway-side refusal of the file, diff and Git routes for a remote chat (see "File, diff and Git routes refuse a remote chat").
Screenshots / video
Rendered from this PR's HEAD in a Vite dev server on 127.0.0.1, with every
/api/**call answered by a fixture (no Coder deployment). The whole-page shot is the built SPA behind the repo's loopback static server, with the same fixtures.Settings › Session Environments, the whole page with its title:
The card: filled (archived workspace rows with "Reopen chat"), check failed, empty (the disabled check and switches say why), one profile open (the Working folder hint with its example, and the stop switch with its override hint), its template picker open and its list unavailable, a profile just removed (the live chats it strands, beside Save), Setup instructions, saved, save error (plain wording under the URL box with the gateway's own words under Details, a short banner, and the one "save first" line above the workspace list). Each workspace row names its profile and, for a live chat, the chat's title.
A profile removed while the workspace list cannot be read (dark and light). The Manage section shows its error notice, and instead of claiming no chats are affected, the card says it could not check which chats still use the profile.
Composer "Run this chat on" menu (template under each profile, selected one checked), the chip once fixed and while a reply runs, start steps, and the Feature Previews switch:
While a reply runs the chip is disabled; its hover text (a native tooltip, which the browser does not draw into a capture) reads "Stop the current response to switch profiles". A failed switch names where it was going and where the chat still runs, beside the chip, wrapping instead of running past the composer row:
Remote Files: list, a file open, a save conflict with "Load workspace version (drops my edits)" and "Copy my edits", workspace stopped.
A file with unsaved edits that a refresh now reads as past the 256 KiB limit (dark and light), or as binary: the editor and Save are gone, and the header offers "Copy my edits" beside "Discard my edits", and a line under it says why the file can no longer be edited here.
A local chat's side panel while placement is read, and after the read fails:
A remote chat's side panel: an open file tab (it reads this machine's copy) shows the pointer to the Files tab instead. Then the workspace terminal opened from the Files panel's Terminal button (a scripted
coder sshsocket stands in for the workspace), and a terminal opened on this machine before the chat was bound, which is no longer typed into once the chat is remote:Light theme:
Related Issues
Part of #10433 (no closing keyword: a stack closes it). Stack: #19833 (merged) → this PR → #21259 health → #21256 git → #21257 Sprites/boxd → #21258 Fargate → #21260 Kiro Cloud.
Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.