Repository navigation
feat(mcp): session_set_color tints a session the caller created - #15428
Conversation
5f8c52a to
eccde2e
Compare
|
Intent: Give a conductor two cheap ways to manage the workers it created: tint them in the sidebar, and leave them a note that their next turn reads, without starting a turn. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. It is one new verb with a creator fence on every caller, and it writes through a shared color writer that the sidebar menu's color route also uses. No surface under [DESIGN-REVIEWED] 4228ae5 Description read[DESCRIPTION-READ] 336eb4200fbaec1fcbb1ea335c2c1992c1f41128800d0902da839cc678c62c11 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 |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the agent-side tint has no existing equivalent (no What this change shipsInventory (7 items) — 6 justifiedIntent: let a conductor color the worker sessions it created so the person can tell fleets apart in the sidebar. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 4228ae5 Description read[DESCRIPTION-READ] 178d6853a9479991f9890907d357e52ef9da0501ea4134edc55f9b7bc44479ec That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
eccde2e to
6df954c
Compare
|
|
|
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
|
4510db7 to
b819c17
Compare
|
b819c17 to
fa30bb4
Compare
|
|
|
Rebased onto main after #15166 (session_end_wait) merged. Conflicts were tool lists and counts only (docs, agent.py withheld notes, the doc-count test); both tools kept, 26 dashboard tools / 16 session-control verbs. Related tests pass. |
|
note: rebased onto main at 212cc94, no behaviour change Main now includes #22433, which fixed the |
|
note: rebased onto main at 23e747d, no behaviour change Main's #22474 split |
|
note: the two reds on 23e747d are runner time limits, not this diff Backend Tests (3.12, 2) failed one test, |
|
note: same-tree retrigger at c30108d, no code change This head has the same tree as 23e747d; only the commit date changed, so every check reruns. The reds there were the |
|
note: the Backend Tests (3.12, 2) failed one test again: I timed it locally, single-process, on this head and on a clean checkout of main at 8f828d6: 57.96 s and 58.59 s. This PR does not make the scan slower; it adds one source module and a handful of test lines to a tree of several thousand files. Main's own Backend Tests (3.12, 2) passed on its last three CI runs today. My reading is that the test sits within about 2x of its 120 s per-test limit on a loaded runner, and which shard it lands in with which neighbours decides the run, but I have not proved that. No code change is pending. A re-run of that one job would settle this head; the fork account cannot re-run jobs. |
cruisercohen
left a comment
There was a problem hiding this comment.
Re-reviewed c30108d against 1a46d44, the last head I checked. This is a comment review.
- Rebase only. The one change to this PR's own lines is the MCP route-table pin (302 rows and its digest), now in
test_dashboard_server_composition_contract_reach.pyafter main's #22474 split. Range-diff and a per-line comparison of the added and removed lines show nothing else moved, so my earlier read of the set-color handler and its gates stands. - On the
test_facade_mirror_guards.pytimeout: main's #22320 raised that test's ceiling from 120 s to 300 s. It merged at 18:07 UTC, four minutes after this head's Backend Tests (3.12, 2) run started, so that run had the 120 s limit, and a re-run of the same job would too. A rebase onto current main (4d5cb47) picks up the 300 s ceiling. A local merge with it is clean, and main's route table still has 301 rows, so the 302 pin stays right. - iamwhatever's hold on the security posture is a human maintainer's call and is unchanged by this.
|
@cruisercohen thanks, rebased onto main at fdd0434, no behaviour change Main 4d5cb47 includes #22320, which raised the per-test ceiling for the |
|
HOLD at fdd0434 for maintainer sign-off. This head is a rebase. I still found no defect. The one remaining blocker is a human decision. This adds a strict-internal route, I read the source, the range-diff and CI. I did not run tests. — crew-pr-reviewer (r116) |
|
note: rebased onto main at 85d8ba5, no behaviour change The only conflict was in |
|
note: rebased onto main at 82145ff, no behaviour change The only conflict was in |
|
note: rebased onto main at d8e9148, no behaviour change Real Adapter Contract Tests failed on 82145ff with 6 setup errors in |
|
note: rebased onto main at 62b11e1, no behaviour change The only conflict was in |
|
HOLD at 62b11e1 for maintainer sign-off. This head is a rebase of fdd0434, our r116 head. The PR's added and removed lines are the same set; the strict-internal entry now sits in The remaining blocker is a human decision. This adds I read the source, compared the diff with the previous head and read CI. I did not run tests. — crew-pr-reviewer (r120) |
|
note: rebased onto main at 9bb82e4, no behaviour change The only conflict was the MCP route-table pin in |
|
note: same-tree retrigger at d412234, no code change This head has the same tree as 9bb82e4; only the commit date changed, so the fork review lanes run again. On 9bb82e4 two lanes stopped before they reviewed anything. The Opus 5.5 Review check reported "review incomplete" and its PR comment never updated past 62b11e1. The Security Scope Review lane run 39878785278 had its generate job cancelled, so publish failed with |
|
note: rebased onto main at fa7520f, no behaviour change The only conflict was the MCP route-table pin in |
|
HOLD at fa7520f. This head is a rebase of 62b11e1, our r120 head. The only changed lines are the route-table pin in What still blocks:
I compared the diff with the previous head and read CI. I did not run tests. — crew-pr-reviewer (r123) |
|
note: rebased onto main at f4dd87b, no behaviour change The only conflict was the MCP route-table pin in |
|
note: rebased onto main at 36fe73c, no behaviour change The only conflict was the MCP route-table pin in |
|
nitpick (non-blocking): the description's "Where it lives" line still names Design is right. Main moved |
|
Hold at 36fe73c for maintainer sign-off. This head is a rebase of fa7520f, our r123 head. The only changed lines are the route-table pin in The remaining blocker is a human decision. This adds — crew-pr-reviewer (r124) |
|
note: rebased onto main at dce124c, no behaviour change Two edits to I also corrected the description's "Where it lives" line, which Design flagged: the strict list is in |
|
note: Backend Tests (3.12, 7) red on dce124c is not from this diff One test failed out of 24,225: I will push one same-tree retrigger (commit date only) at the next clear quarter-hour slot. If the same test fails again there I will report it rather than retrigger again. |
|
note: same-tree retrigger at 0c0f4ad, no code change This head has the same tree as dce124c; only the commit date changed, so Backend Tests (3.12, 7) runs again. On dce124c that shard failed one test, |
Adds a kirocrew-dashboard tool so a conductor can tint the worker sessions it created and group a fleet at a glance in the sidebar. It runs through a new strict-internal route, POST /api/session-control/set-color. set_color_target gates it with authorize_target and allow_self, then a creator fence for every caller, so a person's own tabs are refused even to an owner session. color is "0"-"6" (the sidebar menu's palette swatches, pinned to PALETTE_SIZE) or "" to clear; a swatch write clears any custom hex, as the menu's own swatch click does. The tool is one Tool row in mcp_dashboard.TABLE. Its schema field is matched verbatim against those eight literals (new FieldSpec.verbatim, which requires allowed), so an invisible value is refused instead of sanitizing into "", the clear value. Refs kirodotdev#15424
|
note: rebased onto main at 4228ae5, no behaviour change Main's #19135 added Both sides had raised the same three counts by one, and git merged those lines cleanly at the old value. With both tools the This push also supersedes the 0c0f4ad retrigger, so Backend Tests (3.12, 7) runs again here. |
|
HOLD at This head is a rebase of What still blocks is a human decision. This adds I compared the diff with the previous head and read CI. I did not run tests. — crew-pr-reviewer (r126) |
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 4228ae5. This supersedes our earlier sensitive-file HOLD and our REQUEST_CHANGES at f45434f.
That change request asked for a tracking issue for sharing the swatch write. The PR now does it in place: the sidebar PATCH /api/chat/slots/{slot}/color route and the new verb both call dashboard/slot_color.write_slot_color, so no follow-up is left.
This PR adds a new agent-facing MCP verb and route, so it needed a human decision. A maintainer has now reviewed the deep-check findings and accepts the scope: set_color_target in session_control_parts/session_titles.py (L351-356) validates the color first, runs authorize_target with no self waiver, and applies the creator fence, so a caller can only recolor sessions it created. The verb stays out of channel agents and the unattended conductor grants. CI and the AI review lanes are green on this head, and the last push is the author.
— crew-pr-reviewer (r127 deep)
Problem / Motivation
Goal: A conductor can color the worker sessions it created.
A conductor that opens workers with
session_createhas no way to group them visually in the sidebar. The sidebar color menu (PATCH /api/chat/slots/{slot}/color) is out of reach of thekirocrew-dashboardMCP server, and it does not fence agent callers by ownership.Why it matters
A conductor running a dozen workers leaves a sidebar of identically tinted tabs, so the person cannot tell which fleet a tab belongs to.
The color also has to change after creation. An attended conductor, one the person is driving in the dashboard, recolours a worker when the person asks it to regroup or mark one, and clears the mark with
"none". Each call goes through the normal approval prompt. Acolorfield onsession_createwould set the first tint only, so it covers grouping at birth but not those later steps; the standalone verb is the smallest surface that does both.Not a goal
/noteroute's behaviour for apps and crons.session_set_colorstays out of the unattended conductor grants, and no built-in skill calls it yet. Granting it there, so a patrol can mark a blocked or done worker without a prompt, is a separate trust decision for a follow-up that adds the skill step and the grant together.What changed (motivation → approach → change)
This PR now ships the color half only. The note half,
session_set_note, moves to its own PR: every review round on it raised a new security question about agent-written text entering another session's prompt and transcript (choice markers, frame delimiters, replay after a channel link), and those need their own design pass rather than riding along with a sidebar tint. The work so far is kept on thefeat/mcp-session-notebranch of the fork.session_set_color(target, color)joins the session-control family as oneTool(...)row inmcp_dashboard.TABLE(the #17098 table), withidentity="strict"androutes=("POST /api/session-control/set-color",), and calls that new strict-internal route.The route runs the existing
authorize_targetunchanged, so a session naming itself is refusedself_targetas forsession_stop. It then refuses any target whosecreated_byis not the caller, the same every-caller fenceend_wait_targetapplies. That second check runs for every caller, so an owner session with session control switched on for everyone still cannot recolor the person's own tabs.session_stopis not narrowed.coloris"0"to"6"for the seven swatches the sidebar menu draws, or"none"to clear; the menu's custom#rrggbbcell is left out, since a fleet mark needs a few distinct tints and the swatches follow the viewer's theme. A swatch write clears any custom hex, as the menu's own swatch click does.coloris a required field checked againstSESSION_COLOR_CHOICES("none"and"0"to"6") with the existingallowed=check. The clear value is a word rather than""so that an input validation sanitizes down to"", such as a lone"\u200b", is refused as missing instead of clearing a tint. A test pins those choices to the route's parser.Folders do not cover this: a conductor usually sits in the person's project folder beside its workers, so the folder cannot also say which conductor owns which worker, and a tint marks that without moving anything the person filed. Tags cannot do it either: each fleet mark would be a permanent entry in the person's shared tag list and board filters, and the dashboard MCP has no tag delete, while a tint lives on one session and
"none"removes it.The tool is blocked for channel agents and left out of unattended conductor grants.
Where it lives: the tool row in
mcp_dashboard_session_tools.pyand its body_run_session_set_colorinmcp_dashboard_session_runs.py, the schema and color choices invalidation_parts/messaging_session_schemas.py(registered invalidation_parts/server_registries.py), the title indata/mcp_tool_titles.json, the gate indashboard/session_control_parts/session_titles.py, the route indashboard/handlers/session_control.py,dashboard/server_runtime/mcp_routes.pyand the strict list indashboard/server_internal_paths.py, the channel block inchannel.py, the withheld-verb note inagent_parts/spec_grants.py, and the reference indocs/session-control.mdanddocs/index.md.The color write itself is
dashboard/slot_color.write_slot_color, which stores the index and hex, marks the slot dirty and publishes. The sidebar menu'sPATCH /api/chat/slots/{slot}/colorroute now calls it too, after deciding the pair exactly as before, so a later change to how a color is stored reaches both writers. This answers the Design review's suggestion in this PR instead of a follow-up.Backwards compatibility
Compatible: one new tool and one new route; no existing route or argument changes.
Tests
test/test_session_control_color.py: self refused (fails ifallow_selfcomes back), created, not-created (owner and fenced callers) and out-of-bounds targets; the color grammar, including a custom hex, invisible characters and padding; the palette size pinned toPALETTE_SIZEinsessionColors.ts; route auth and strict-internal registration; the tool reply shapes throughTABLE.callwith an in-memory dashboard; invisible, empty and out-of-set colors refused with no request sent; a tint on an empty newborn worker reaches its metadata line through the periodic flush (flush_slot_now). The tool schema and the route's parser read one set,validation.SESSION_COLOR_CHOICES, built fromSESSION_PALETTE_SIZE.test/test_session_control_member_gate.py:set-coloradded to the routes that must forward the carried member verdict.test/test_session_control_audit.py: the tool added to the every-refusal-is-audited table.test/test_session_control_color.py::test_both_color_writers_store_through_the_one_slot_color_write: the menu's PATCH route and the agent verb both store throughwrite_slot_color(fails if either inlines the field writes again). The existing route tests intest/test_dashboard_chat_session_meta.pypass unchanged.Manual verification
N/A. The route is driven through its real handler against a real
DashboardStatein the unit tests, and the tool through the realTABLE.callframe.Related Issues
Refs #15424 (the note half of that issue moves to its own PR)
The color verb relies on the periodic flush persisting a message-less newborn's metadata, which #17896 added and which is on main.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement