Repository navigation
feat(slack): mark code-channel sessions in the dashboard - #21437
kyleseaman merged 2 commits into
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the new slot keys are additive and gated per audience, the new Slack events are only subscribed under Notes
[DESIGN-REVIEWED] 332e373 Description read[DESCRIPTION-READ] 174aaec81879ffacab674d7f5fcb19d199cb4b1e4b26b6b85dceee42bbad6aec 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) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the phone ⋯-menu Slack link and the "Task done" and "Replies paused" states. No supplied screenshot shows the phone surface, and none shows two of the states the diff adds. Evidence gaps
Notes
[UX-REVIEWED] 332e373 Description read[DESCRIPTION-READ] ff4384b88fd14ec3c95ff595b13c09ecfb1f4df2955be5c7e6a1cddf24813256 That sha256 names everything this verdict read: the PR description, plus the 15 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 code-channel surfaces sit behind the Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: let a person see which dashboard sessions are Slack code channels and jump to the channel or thread (ADDITION).
[FIRST-PRINCIPLES-REVIEWED] 332e373 Description read[DESCRIPTION-READ] f8b030b913708e6a301ff48d44b3637c9324e2902a2199c317c436ba492b3340 That sha256 names the PR description this verdict read. 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: |
bf6e6bb to
83f234f
Compare
32e4cdf to
0cd3ae3
Compare
7c017bd to
2e1d007
Compare
|
|
|
|
|
|
|
|
|
|
Evidence: archived chip no longer collapses to an empty box (UX Review). Built SPA, canned slots, Attached, in order: conductor 260px, conductor 180px, folders 260px, folders 180px, folders 320px phone, sidebar rows dark, sidebar rows light. |
125672a to
2defbe2
Compare
|
HOLD at 2defbe2. This PR targets It is also reserved for a human reviewer. It adds an inbound Slack event route that changes stored bindings (lifecycle.py, wired at events.py#L1264), six new manifest event subscriptions, and an app-token audience split (ws_event_scope.py#L1411). I found no definite defect: the handler refuses a missing, non-admitted or mismatched workspace and audits each outcome. These current-head AI items have no reply (every disposition is for 7c017bd):
— crew-pr-reviewer (r114) |
19a16d6 to
78ab86f
Compare
2defbe2 to
1a78644
Compare
78ab86f to
10d5311
Compare
Evidence: Slack-born session header link (build 9)A session started in a Slack thread ( Order: before dark, after dark, before light, after light. |
Sidebar row and session header show a Slack code channel chip with a link to the channel and its archived / wrapped-up state. The row chip keeps its Slack mark whole, yields width after the agent name, drops its link glyph before the channel name, and goes icon-only below a readable floor; the time never shrinks. Slack channel_archive / unarchive / rename events update the binding.
Sidebar rows carry the Slack mark alone, a link named 'Open #channel in Slack'. The session header carries the full link (mark, #channel, state, link glyph); a session mirrored to a Slack thread gets a header link to its thread (paused state shown; hidden while code channels are still loading). In the folder view a code-channel conductor's direct workers fold under its row behind a persisted disclosure. The conductor's status line reports the crew worst-first (waiting on you > stuck/interrupted > working > done > idle) from slot data, and from the conductor slot's optional work_aggregate {state, label, counts} when published; a hidden worker's approval or unread result always surfaces on the conductor row.
A session started in a Slack thread is not slack_linked (its thread is
where it lives, not a mirror), so serialize_slot shipped empty
slack_channel/slack_thread_ts and SlackThreadLink drew nothing.
serialize_slot now also ships slack_origin_channel and
slack_origin_thread_ts for a genuine Slack-origin self-link, keeping
slack_linked False so sidebar, menu and mirror semantics are unchanged.
SlackThreadLink links those ids when the session is not mirrored and
reads paused from the origin row. While the code-channel store is
unread, rows carrying an origin thread are marked code_channel_pending
too, so a bound session never flashes the thread link.




























Stacked on #28305 (worktree and diff code, on #21410). Full backend CI runs when this retargets to main after the parents merge.
Problem / Motivation
Goal: A dashboard session that runs a Slack code channel is visibly marked as one, in the sidebar and the session header, with a link that opens that channel. And any session linked to a Slack thread, whether mirrored to one or started in one, gets a header link that opens that thread, whether or not code channels are on (Kyle's build-9 ask: a session he started in Slack showed no Slack link).
#21410 gives every Slack code channel an ordinary dashboard session, but in the dashboard that session looks like any other chat. Nothing shows that typing in it posts to a Slack channel, which channel that is, or whether the channel has been archived or wrapped up, and there is no way to jump from the session to the channel. A code channel's conductor also opens worker sessions, which pile up in the sidebar beside it, so one task reads as many rows and a worker waiting on the user is easy to miss.
Why it matters
Slack Code is meant to be one session seen from two windows. If the dashboard side cannot tell a user which sessions are code channels, or take them to the channel, the dashboard half of the feature is invisible. And a crew should read as one task whose single line says what it needs, without hiding anything that needs the user.
Not a goal
wrapped_up_atstamp the wrap-up work sets.work_aggregate: that is feat(slack): conductor work board in code channels #21993's row model. This PR only renders it.What changed (motivation → approach → change)
slack/code_channels/dashboard_view.pyturns a binding intocode_channel{channel_name,status(archived > wrapped_up > active),web_url: Slack'sapp_redirectlink, empty unless the ids are well formed}. Only a person's views carry it: the bare list never does, anddashboard/ws_event_scope.pystrips it from app WebSocket rows. While the store is still loading, Slack-linked rows carrycode_channel_pendinginstead, so no thread link flashes before the badge. With the gate shut the store is never read.slack/code_channels/lifecycle.pyhandles channel archive, unarchive and rename (andgroup_*), subscribed inslack-manifest.yamlunder#@code_channels. Bound channels only, nothing while the gate is shut, one channel's events in order; a foreign workspace's event is refused, SEL-audited.#channel(truncated, full name in the tooltip), state words, link glyph. A session linked to a Slack thread gets a link toslack.com/archives/<C>/p<ts>(ids validated; "Replies paused" when paused). A session started in a Slack thread is not a mirror, sodashboard/state_parts/slots_frame.pyalso sends that thread asslack_origin_channel/slack_origin_thread_tsand the header links it the same way. On a phone, which draws no session header, the same link (code channel's, else the thread's) is a row in the top bar's ⋯ menu (MobileTopBar.tsx, sharedslackLinkTarget). No URL carries a dashboard credential.mc-sidebar-conductor-expanded). Nothing folds while a search or filter narrows the list; the open session or a pinned worker never folds. Open workers keep the sidebar's one content column (docs/decisions/2026-10-09-folder-glyph-sits-on-its-connector-line.md), marked by an out-of-flow rail. Display only; it could serve any parent but is scoped to code-channel conductors.pages/chat-sidebar/codeChannelCrew.ts), worst first: waiting on you > stuck / interrupted > working > done > idle.work_aggregatepresent (contract below): itsstate,labeland counts render as given.pluralKeys.json.work_aggregatecontractPublished by #21993 at cc01bfb; this PR consumes the same shape (
WorkAggregate,website/src/types/index.chat.ts). An optional field on the conductor's dashboard slot, delivered by the existing slot patch (no new poll),nullwhen there are no workers:A shape this build cannot read (unknown state, non-string label, missing counts) is treated as absent.
Backwards compatibility
Compatible:
code_channelandcode_channel_pendingare new optional keys on slot rows (the dashboard also reads an optionalwork_aggregate, which nothing in this PR sets), and the new Slack events are subscribed only under thecode_channelsswitch. No existing field, route or event changes meaning.slack_origin_channelandslack_origin_thread_tsare new additive string keys on every serialized slot (empty unless the session was started in a Slack thread), ungated by thecode_channelsswitch on purpose: they carry the Slack-born session's thread for its header link. They reach exactly the audiences the existingslack_channel/slack_thread_tsalready reach, app tokens included, and carry the same kind of value (a channel id and a thread ts, no names, no message text, no credential).slack_linkedkeeps its meaning (False for a Slack-born session), so the sidebar, the session menu and mirror release are unchanged. A client that ignores the keys sees today's payload.Removes nothing: no field, route or event is deleted or tightened. Folding hides worker rows from the folder view's default display only; each stays one chevron away, on its session page, in search and in History.
Premise (for the maintainer override)
First Principles flags the Slack-thread header link (
SlackThreadLink,ChatTitleOverlay.tsx) and theslack_origin_*slot fields as reaching sessions outside the code-channel gate. That is intentional and owner-approved: Kyle asked for it after build 9, when a session he started in Slack showed no Slack link in its header, and on 2026-10-23 ruled to keep it in this PR rather than split it out. The link appears only for a session that is already linked to a Slack thread (mirrored or Slack-born), opens Slack's own permalink built from validated ids, and carries no dashboard credential. The fields are additive and back-compatible (see Backwards compatibility). The Goal above now states this scope.First Principles also flags the
work_aggregatereader as having no producer in this tree. It is the dashboard half of a contract whose producer is #21993's work-board row model ({state, label, counts}on a conductor's slot, delivered by the ordinary slot patch), still open on another branch. Both halves were built against one written shape so the stack can merge in either order. Until #21993 lands the field is absent: the sidebar falls back to slot data, and the "stuck" and "done" lines don't appear. The crew line ranks code-channel workers from slot data, whichlib/crewWorkers.ts(Crew Mode's ledger grouping) does not read, and Crew Mode roots are excluded from the fold.Tests
test/test_slack_thread_session_binding.py:serialize_sloton aslack:<ts>self-link shipsslack_linkedFalse plus the origin ids (namespace prefix dropped); a dashboard mirror, a Slack session mirroring another thread, an empty channel and a non-Slack origin ship none.test/test_slack_code_channels_dashboard.py: URL building rejects malformed ids; status precedence; view shape. Gate shut never reads the store; an unread store touches no disk on the caller, is warmed off the loop and re-pushed, and marks only rows carrying a Slack thread (mirrored or Slack-born)code_channel_pending. Viewer scoping through HTTP and WebSocket: a member sees no other session's channel, an app caller never sees either key.test/test_slack_code_channels_lifecycle.py: archive/unarchive/rename, unbound channel, feature off, refused or mismatched workspace, per-channel ordering (mutation-checked).website/src/components/CodeChannelBadge.test.tsx: the row mark's exact accessible name and tooltip, no text, no pill; the link glyph only on a linked mark, the archive glyph only on an archived one (both fail on revert); aweb_urlthat is not Slack'sapp_redirectrenders no link; the header link; the thread link's permalink, id validation, paused state, and nothing while pending or for a code channel.website/src/test/ChatPage.mobileTopBarActions.test.tsx: the phone ⋯ menu opens a Slack-born session's thread and a code channel's own link, and offers no row for malformed ids, a pending code-channel lookup, or a malformed channel link (fails without the row).website/src/pages/chat-sidebar/codeChannelCrew.test.ts+website/src/test/ChatSidebar.codeChannelCrew.test.tsx(real sidebar): collapsed by default, expand persists across a remount, an ordinary parent unchanged;work_aggregatepresent in all five states with label and counts, trusted as given, null and malformed fallback, and the approval rule under every aggregate state (line and dot); one owed approval reads the same on the conductor line and the worker row; nothing between the crew wrapper and a worker row steps it in (any padding/margin class, variant prefixes included). Mutation-checked: dropping the fold, the crew line, the attention dot or the approval rule, or putting the oldpl-2back, turns them red.capture-slack-code-channel-row-fit.mjs(the mark is 10x10px and nothing clips it at 260px/180px/320px, nested rows),capture-slack-code-channel-crew.mjs(fold, persistence across a reload, waiting on you, done/stuck fromwork_aggregate, each worker's title left edge equal to its conductor's and a sibling row's, 12 checks red withpl-2restored;--recordwrites the fold open/close WebM),capture-slack-code-channel-badge.mjs(link glyph and archive glyph visible, row close-ups).Manual verification
pod_upcannot resolve this host's worktrees, so the UI was checked in a real browser (Playwright) against the built SPA with canned slots shaped as the backend serializes them, by the three harnesses above, which assert the DOM before each shot. Local gates on this head: tsc, eslint, build, related vitest (5,757),npm run i18n:checkandcheck-i18n-render.mjsagainst the base, focused backend tests, black/isort/flake8, the brand-name, comment-history, feature-map, focus-cue and flake-pattern gates, Docs Lint, push_guard.Screenshots / video
Earlier before/after shots are in the evidence comment. The key ones:
Current row mark (link glyph; an archived or finished channel says so in words beside the mark) and the worker fold:
Fold opening and closing (260px, dark): fold open and close
Known gaps
Related Issues
Part of #15175.
work_aggregatecontract: #21993 (cc01bfb).Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)