Skip to content

feat(slack): code-channel view tabs: PR tabs, tab deep links, Workers tab with Stop - #38998

Merged
kyleseaman merged 2 commits into
mainfrom
feat/code-channel-view-tabs
Nov 18, 2026
Merged

kyleseaman merged 2 commits into
mainfrom
feat/code-channel-view-tabs

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: code channels use Slack's view tabs: native tabs for the channel's pull requests, deep links to the channel's own tabs, and a live Workers tab where a person can stop one helper agent.

Today a code channel publishes the Code tab (diff), the Plan canvas and whatever html/block_kit tab the agent writes. Pull requests are GitHub links only, nothing in the channel links to a tab, and the board is read-only: stopping one runaway helper means opening the dashboard. code_channel_set_view also told the agent that pull_request views are "published from the worktree automatically", which was false.

The design was reviewed in #22928 (merged into feat/slack-code-channel-api-gaps, not main). This PR brings it to main, on top of #22370 (merged), the worker PR fields of #38181 and the channel Stop of #38243, and follows the RFC amendment in #38124 (§3 "Tabs").

Why it matters

A person working in a code channel can't open the channel's pull requests or its own tabs from the messages that name them, and can't stop one helper agent without leaving Slack for the dashboard, while the conductor and the other helpers keep running. The agent was also told something false about pull_request views.

Not a goal

  • No csp is sent for html views (unchanged).
  • The context bar keeps its GitHub URLs: context_bar_items take only a url, no tab_id.
  • No new Slack scope or event. agents.conversations.setView/listViews/removeView use code_channels:manage, and the Workers buttons arrive over the existing interactivity endpoint.
  • Nothing is held until the hold PR lands. A helper stopped from the Workers tab, like one stopped by the channel's Stop, can be started again by a queued wake (a message, its AutoNudge or patrol).

What changed

  • PR tabs (tabs.py, views.py). setView type=pull_request with pr_url, upserted under pr-<n> and named PR #<n>, for the channel's own PR (its workspace record) and the board's worker PRs (feat(slack): per-row PR and CI, the combined Code tab and wrap-up outcomes on the work board #38181's fields), open or draft and forge-confirmed, the newest two by number. A tab is removed by the view id recorded when it opened, and only on evidence: its PR seen merged or closed, or two newer open PRs seen. A pass whose board or forge read failed removes nothing.
  • The five-tab budget (views.py). Three tiers. Plan, Code and Workers are never removed to make room. Then the PR tabs, at most MAX_PR_TABS = 2. Then the agent's own html/block_kit tabs, which give way first (least recently written). A PR tab gives way, oldest first, only to fit Plan, Code or Workers, never another PR tab or an agent tab. With Plan, Code, Workers and two PR tabs open, a new agent view is refused with too_many_views, and the tool says so. code_channel_set_view refuses the reserved keys plan, workers, diff, pr-<digits> and type=pull_request.
  • Deep links (board/render.py, board/publisher.py, wrapup.py). A rich_text channel element whose tab_id is the setView view_id (the Code tab's static code), built only from ids recorded as ours and shaped like Slack ids. The board gets a Tabs: Workers · Code line and each task's PR #n opens its PR tab (GitHub when it has none). The wrap-up links the Code tab and the open PR tabs (a worker's only while the board's scope admits the channel). A board or wrap-up Slack refuses because of the links is resent without them.
  • Workers tab (tabs.py, board/render.py). A block_kit view (workers) rendered from the board's own snapshot, so it carries the board's redaction, de-pinging and host scrubbing. Per worker: the title, a status line, its PR (linked to its tab) with the CI count, Open in dashboard (a url button), and Stop (outlined, behind a confirm dialog) while it works. Up to 14 open workers, then +N more. Settled workers fold into Done: <title> · PR #N · CI x/y lines. Written only when what it shows changed, or every 5 minutes for elapsed times, and at most every 15 s.
  • Stopped state (board/stops.py). After a Workers-tab Stop, the row reads "Stopped by @user · HH:MM" on the board and the tab, without a Stop button, until that worker's next turn. The refresh the Stop arms skips both edit gaps once. It is kept because it is the one place the other members of the channel see that a person stopped a helper, and when: the private reply reaches only the presser, and the audit row (slack.code_channel.stop) only the operator. It goes beyond the RFC's Workers-tab text, which asks only for the audit record. Its three known races each have a test: a press while a stop is already in flight credits nobody (test_a_press_while_a_stop_is_already_in_flight_credits_nobody), a queued turn that starts after the stop is never marked stopped (test_a_queued_turn_that_starts_after_the_stop_is_never_marked_stopped), and a label gone stale while the tab or the board is sent is written again (test_a_stopped_worker_whose_next_turn_starts_during_the_write_is_written_again, test_a_stopped_worker_whose_next_turn_starts_during_the_board_send_is_edited_again).
  • Fences and bookkeeping. Every tab write and removal re-checks the archive, Stop and channels fences, and the board's scope at the client's commit point (surface.send_fence), the retry after making room included. Writes after an await go through surface.commit_if_not_stopped; tabs.py and worker_stop.py are in test_slack_code_channel_commit_point.py's scan. Tab records follow what Slack did even when the call is cancelled after Slack answered, and a tab whose answer was lost (or whose record a restart cut off) is removed by its key once its PR settles or the board empties, with a backoff and a refresh armed when Slack refuses for now.

The Workers-tab Stop: authorization path (for the maintainer)

This is a new path from Slack interactivity to cancelling a session. It adds no new permission rule: it uses the channel Stop's.

  1. interactions.py routes kc_cc_worker_stop to worker_stop.handle_stop_click; kc_cc_worker_open is a no-op. Neither can fall through to another handler.
  2. actions.admit(...): the context-bar buttons' own gates, unchanged: one clicking user, admitted workspace, channels policy, a bound channel.
  3. The payload's container.view_id must equal this channel's recorded Workers view. No view_id, or another view, is refused. Nothing is guessed.
  4. actions._may_stop(...): the channel Stop's rule for who may stop (session_events.handle_stopped then routing.stop_from_channel, which the context bar's Stop goes through too).
  5. The button value is an opaque ledger item id, resolved on this channel's board through board.source.read_board (the scope-checked conductor-ledger read). A session key in the payload is never read.
  6. That read awaits, so the channels policy is asked again as the last await, then a synchronous final gate runs with nothing between it and the stop: code channels on, workspace admitted, the binding still the admitted one (same session and anchor, not archived), the view still the recorded Workers tab, _may_stop again, the slot neither the conductor's nor another conductor's worker (an unreadable lineage refuses), the session its sub-agents are swept from (effective_session_key) the slot's own and not the conductor's, and the cancel target (turn_stop._cancel_target) resolving back to that worker's slot.
  7. worker_stop.stop_one_worker stops that one helper through the channel Stop's own path for one helper, stop_helpers.stop_one_helper (feat(slack): a code channel's Stop also stops its helper agents #38243): its turn (stop_slot_turn(..., escalate=False, cancel_key=...), started with no await after the final gate, so a queued turn is never the one stopped), then its sub-agents (cancel_for_parent). It ends in the state the channel's Stop leaves a helper in. The confirm dialog says so: "This stops this helper agent and the agents it started." A double click never escalates to a kill, and the conductor keeps going. A worker whose turn has already ended at the final gate is answered "isn't running", and the agents it started are still swept, as the channel's Stop (whose "Nothing is running." check on main counts live sub-agents) sweeps them. Known limit, the same one the channel's Stop has on main: stop_one_helper stops the pinned turn first and sweeps the helper's sub-agents after, by session, so a person's new message to that helper during the stop's await can start a sub-agent that the sweep then cancels. A turn-scoped cancel is a separate change.

stop_helpers.py changes by 23 added and 3 removed lines: _stop_one takes escalate and cancel_key (defaults as before, so the channel's Stop is unchanged) and returns its answer, and stop_one_helper is the new one-helper entry.

Every decision is audited as slack.code_channel.stop (with the sub-agent count); refusals are ephemeral; a repeat within 5 s is answered, not re-sent. The id check, delivery dedupe and payload-shape logging are actions' own (_id, _first_delivery(scope=...), _log_shape).

The block_actions payload

Captured from a live workspace (see Real-machine verification). The gateway's first Workers-tab click logged the container's key names (actions._log_shape, names only, never values):

20:05:00 INFO kiro_crew.slack.code_channels.actions [PID 21775]: workers tab container keys: ['channel_id', 'type', 'view_id']

parse() reads the view from container.view_id and the channel from payload.channel, else container.channel_id (worker_stop.py:92-102). The container carried channel_id and view_id, the view id matched the channel's recorded Workers view (the stop passed both view checks, worker_stop.py:165 and :444), and _stop_payload() in the tests builds the same container shape, so neither changed.

The second commit: a refresh after every finite tab backoff

CI's GPT lane upheld one finding on the first head: a PR-tab write Slack rate-limited on a channel with no work board armed no refresh, so the tab stayed missing after the cooldown. The same held for a removal's backoff and for a full channel holding back the Workers tab. The second commit fixes the class: each finite hold now arms the channel's refresh on the board's timer, and a permanent refusal arms nothing.

Retry delays in the tab code: every site

Invariant: every finite retry delay that a tab write, a tab removal or a Workers refusal produces ends as an armed refresh no earlier than that delay, on a channel with or without a work board. A permanent refusal arms nothing. Refreshes are armed on the board's timer (board.retry_later / board._schedule(delay=...) -> _arm_timer): one per channel, the earliest wins, and it runs the workspace refresh with or without a board.

Line numbers are src/kiro_crew/slack/code_channels/tabs.py on this head unless named. Test file: test/test_slack_code_channel_view_tabs_fences.py unless named.

Site Delay Finite or permanent What arms it Test
_refusal :222, invalid_view_type type:<view type> held for ever, returns 0 permanent nothing test_a_pr_tab_slack_refuses_for_good_arms_no_refresh[invalid_view_type]
_refusal, invalid_pr_url / not_view_owner key held for ever, returns 0 permanent nothing ..._refuses_for_good_arms_no_refresh[invalid_pr_url / not_view_owner]
_refusal, too_many_views FULL_RETRY_SECS, now returned (was 0) finite the caller (rows below) test_a_pr_tab_slack_holds_back_arms_a_refresh_after_its_hold[full], test_a_full_channel_holding_back_the_workers_tab_retries_after_the_window
_refusal, any other code (429 included) _backoff, at least Slack's Retry-After finite the caller ..._arms_a_refresh_after_its_hold[write]
_open_pr_tab :521, Slack refusal _refusal's delay finite or permanent _retry_after_hold (new; arms only 0 < delay < inf) test_a_rate_limited_own_pr_tab_on_a_channel_with_no_board_comes_back (the finding's trigger, through WorkspaceService._publish_pr_tabs with no board), ..._hold[write], ..._hold[full]
_open_pr_tab :524, refused locally (CodeChannelError) held for ever permanent nothing existing test_a_pr_tab_slack_will_not_take_is_logged_once_and_not_asked_again (view_tabs.py)
sync_pr_tabs :440, a removal Slack refused _backoff, at least Retry-After finite _retry_after_hold (new) ..._hold[removal]
sync_pr_tabs :416, a removal still held when a refresh comes early the hold left finite (backoffs only) _retry_after_hold (new) ..._hold[removal] (second pass, 10 s in)
sync_pr_tabs :452, the PR view type held the hold left permanent today (invalid_view_type only) _retry_after_hold, which ignores inf ..._refuses_for_good_arms_no_refresh[invalid_view_type]
sync_pr_tabs :471, a PR tab still held when a refresh comes early the hold left finite or permanent _retry_after_hold (new; inf arms nothing) ..._hold[write], ..._hold[full] (second pass)
_sweep :335 / :346 (unrecorded tab removed by key) hold left / _backoff finite board.retry_later (unchanged) existing test_a_sweep_slack_refuses_for_now_arms_a_refresh_after_its_backoff
_publish_workers :615, type:block_kit held for ever permanent nothing ("held") n/a: only invalid_view_type sets it
_publish_workers :618, Workers tab held for ever (not_view_owner, invalid_pr_url, a local refusal) for ever permanent nothing: "held", no _retry_at (was "backoff" with an infinite timer) test_a_workers_tab_slack_refuses_for_good_arms_no_refresh
_publish_workers :620, Workers tab still held (a finite backoff) the hold left -> _retry_at finite take_retry -> board/__init__.py:592 _schedule(delay=min) existing test_a_rate_limited_workers_write_waits_out_slacks_retry_after (view_tabs.py)
_publish_workers :655, the 15 s edit gap gap left -> _retry_at finite same existing test_the_workers_tab_is_written_only_when_it_changed_and_at_most_once_a_gap (view_tabs.py)
_publish_workers :687, Slack refusal _refusal's delay -> _retry_at, "failed" (too_many_views was 0 -> "held", never retried) finite or permanent same test_a_full_channel_holding_back_the_workers_tab_retries_after_the_window; 429: existing ..._workers_write_waits_out_slacks_retry_after
_publish_workers :693, refused locally for ever permanent nothing same handling as :524; no Workers-specific test
_publish_workers :710, a write that removed a PR tab to fit, or a stopped worker started a turn mid-write WORKERS_MIN_GAP_SECS -> _retry_at finite same existing test_a_stopped_worker_whose_next_turn_starts_during_the_write_is_written_again
_publish_workers links refused (around :595), resent without none (resent in the same pass) n/a n/a existing test_a_workers_tab_refused_for_its_tab_links_goes_out_without_them
Repeated 429s across passes each pass inside the hold re-arms the time left finite _arm_timer: one timer per channel, earliest wins test_repeated_rate_limits_keep_one_timer_per_channel (real timer: 5 passes, 1 Slack call, 1 timer, due > 30 s out)

Not in scope: the agent's own html/block_kit views (tools.py code_channel_set_view) answer the agent with Slack's error and arm nothing by design; they are not refreshed by the board.

Test isolation: the env fixture cancels and clears board._timers before and after each test (test/slack_code_channel_view_tabs_helpers.py), so a hold armed by one test never decides another's timer.

Backwards compatibility

Compatible. Without a new tab the board, view and wrap-up paths render as before (test_without_tabs_the_board_is_what_it_was_…). code_channel_set_view also refuses workers, diff, pr-<digits>; nothing in the repo or the prompts writes those keys. Surface-record views entries gain an optional url and origin; old entries read the same.

Tests

test/test_slack_code_channel_view_tabs.py, _stop.py, _fences.py (164 test functions). Each review fix has a test that fails without it, among them:

  • a wrap-up edited while the board's scope refuses the channel (the Archive click, an unsaved wrap-up's retirement) carries no tab link;
  • a worker slot whose linked session is not its own (the conductor's, for one) is refused before any stop or sub-agent sweep, running or idle;
  • an idle worker's Stop still stops the agents it started;
  • the Workers-tab Stop goes through stop_helpers.stop_one_helper (pin test: it fails when the stop is routed around that path), stops the helper's sub-agents too, and never stops a queued turn that became runnable as the final gate passed;
  • a channel found shared during SurfaceClient's own policy read gets no Workers-tab write and no worker-PR-tab removal;
  • a wrap-up withdrawn (the channels policy, or the channel set to Off or Review) while its facts are read posts nothing; one sent without its tab links is retired without them;
  • a Workers tab whose tab links Slack refuses goes out without them, and stays without them for that channel;
  • a cancel after Slack answered still records or forgets the tab; a tab whose answer was lost is removed by its key once its PR settles or the board empties, retried after Slack's backoff;
  • a stopped worker whose next turn starts while the tab or the board is sent is written again.

Head commit: 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 (commit 1 a1e66c9dc785e27e7a195800162156b26ef44326, commit 2 on top), on main fb81cec80f492a5a897a9537334cf1524e8ec993.

Both commits are unchanged (git range-diff =) from 0b567acc1018cc3f432306890b15e56eafb74111 on main 54b60f24a906362d5bd533f0b453a904d8c28198, and main's commits since touch none of this PR's files; the static gates were run again on this head. Run locally on 0b567acc1018cc3f432306890b15e56eafb74111: all 25 steps of Fast Gate's Source Gates, Static Ratchet Gate and Flake Pattern Ratchet jobs, Semgrep (CI's configs, diff only) and check_agent_sdk_boundary.py, all passing; the static prepush gates (lint, types, line cap); every test/test_slack*.py: 7,700 passed; the changed test files three times: 1,048 passed each run; every ratchet and tree-scan test file with GITHUB_BASE_REF=main and the PR base: 24,479 passed, 30 failed, all test/test_kas_bundle.py on this host's glibc 2.26 (KasHostUnsupported). Commit 1 is unchanged from the one below (git range-diff =), which was also run on main db76983f2b:

  • every test/test_slack*.py (198 files): 7,696 passed;
  • every step of Fast Gate's Source Gates, Static Ratchet Gate and Flake Pattern Ratchet jobs with CI's base env, Semgrep (CI's configs, diff only) and check_agent_sdk_boundary.py: all pass;
  • ratchet and tree-scan test files with GITHUB_BASE_REF=main and the PR base: 3,097 passed (the code-channel, facade, fence and ratchet files); the wider 429-file set on an earlier tree of this round: 24,479 passed, 30 failed, all test_kas_bundle.py on this host's glibc 2.26;
  • the 10 changed test files three times: 1,038 passed each run;
  • flake8, black, isort (CI's whole-tree command) and mypy clean; line cap: code_channels/routing.py 1,912 and slack/events.py 1,965 lines (neither touched here);
  • no website/ file changes; no short fixed waits in the new tests.

Real-machine verification

Machine: the author's dev host (Amazon Linux 2, x86_64, 16 vCPU / 61 GiB); test copy /home/kseam/repos/KiroCrew-wt-tabs-stop-press at the head, gateway PID 21775 on 127.0.0.1:6797 with its own data home; a test Slack workspace with a new app made from that copy's manifest (the code_channel_action event deleted by hand), Agent sessions on, the channel's approval mode Trust.
Before (main fb81cec): the base has no src/kiro_crew/slack/code_channels/worker_stop.py (git ls-tree fb81cec80f src/kiro_crew/slack/code_channels/ lists none), so a code channel has no Workers tab and no Stop to press.
After (head 702cf27): pressed Stop on the working helper's row in the channel's Workers tab at 20:05:00Z and confirmed. The gateway logged:
20:05:00 INFO kiro_crew.slack.code_channels.actions [PID 21775]: workers tab container keys: ['channel_id', 'type', 'view_id']
Result: audit slack.code_channel.stop allowed for the presser, action=worker-stop item=it_e9d8f3ec slot=chat-4-1795032246 result=stopping subagents=0; the gateway logged a cooperative cancel for that worker slot, stop_turn outcome=soft-acked ... elapsed=0.24s and Turn cancelled by user; the channel's own session was not stopped. Slack showed the presser only: "Stopping Run sleep 600 in the shell, then report done. The conductor keeps going." The Workers tab was rewritten at 20:05:13Z (its recorded write time).
Cleanup: not yet: the test gateway (PID 21775) and the test Slack app are still up; Kyle stops the gateway, deletes the app (which revokes its tokens) and removes the test worktree after this review.

Screenshots

Slack-like render of the real blocks (not Slack's renderer), from a sample snapshot, rendered from the head's blocks (Workers tab with each worker's PR tab link and CI count, Stop on the working row; the board's Tabs: Workers · Code line).

Workers tab and board tab line, rendered from the head's blocks

Related

After #22370. Builds on #38181 (worker PR fields) and #38243 (the channel Stop). RFC: #38124. Earlier review: #22928.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The Workers-tab Stop reuses the channel Stop's authorization and its single-helper stop path, and the tab budget has a clear eviction order.

Notes

  • The description is cut off at 8,000 bytes, so I couldn't check its ## Backwards compatibility and ## Real-machine verification sections. The new refusal of the workers, diff and pr-<n> view keys has no in-tree caller that sends those keys.
  • If an agent tab was already recorded under workers or pr-<n> before this change, the new code will treat it as the channel's own tab. The fix would be a record migration, or a check of the type on the record, not just its key.

[DESIGN-REVIEWED] 702cf27

Description read

[DESCRIPTION-READ] dd44c54bfc2101c48294921934b4c7534478f2048a6a0773448899b19d462de2

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the base RFC rfc-slack-code-channels.md (partial, 2026-11-16 amendment, §3 "Tabs") records every shape this PR adds except one small display overlay, noted below.

Notes

  • Item 9 — oversized: the RFC's "Workers tab's Stop" says "Audited as slack.code_channel.stop" and names no "Stopped by" display. Yet board/stops.py adds 173 lines of in-process state (_stops, _urgent, slot-identity and generation matching), which 4 sites read (board/source.py:544, board/publisher.py:164, board/__init__.py:550, tabs.py:638), only to show "Stopped by @user · HH:MM" until the worker's next turn. Without it, the row still goes idle and loses its Stop button on the next refresh. Subtraction: delete board/stops.py, the stopped_of overlay and the take_urgent edit-gap skip; the audit record already holds who stopped it.

What this change ships

Inventory (10 items) — 9 justified

Intent: let a person in a Slack code channel open its PRs and tabs from the messages that name them, and stop one helper agent without going to the dashboard. ADDITION.

  1. Native PR tabs for the channel's two newest open PRs, its own and its helpers' — justified
  2. Five-tab budget: agent views give way first; a new agent view is refused when the channel is full — justified
  3. code_channel_set_view refuses reserved keys and type=pull_request — justified
  4. The tool no longer says pull_request views publish themselves — justified
  5. The board's header links the Workers and Code tabs; PR #n and the wrap-up link to PR tabs — justified
  6. A board or wrap-up that Slack refuses because of its links is resent without them — justified
  7. Workers tab with per-helper status, PR/CI and Open in dashboard — justified
  8. Workers-tab Stop (with a confirm dialog) stops one helper and its sub-agents — justified
  9. "Stopped by @user · HH:MM" overlay on the board and tab, which also skips the edit gap once — oversized: not in the RFC; the audit already records who stopped it
  10. Tabs whose Slack answer was lost are cleaned up by key, with a backoff and a re-armed refresh — justified

[FIRST-PRINCIPLES-REVIEWED] 702cf27

Description read

[DESCRIPTION-READ] 1b0c09145a59e18221c8d4dbcb5daf1702b89832c4e04b0e2b80af953fe79da8

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @kyleseaman overrides the GPT 6.1 finding for 702cf2760084a0a90cf5577d8ca7f0540a75e8b3; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 702cf27

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 702cf27

Verdict parsed from the review's SHA-scoped output markers for commit 702cf2760084a0a90cf5577d8ca7f0540a75e8b3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 702cf2760084a0a90cf5577d8ca7f0540a75e8b3 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 18, 2026
Kyle Seaman added 2 commits November 18, 2026 06:44
… tab with Stop

A code channel gets the tabs Slack's agent channels offer, inside the
five-tab budget views.py already keeps:

- native pull_request tabs (pr-<n>, named "PR #<n>") for the channel's own
  PR and the board's worker PRs, open or draft and forge-confirmed, the
  newest two by number (MAX_PR_TABS = 2). A tab is removed by its recorded
  view id only when its PR is seen merged or closed, or two newer open PRs
  are seen; a pass whose board or forge read failed removes nothing;
- the interactive Workers block_kit tab, from the board's own snapshot: per
  worker the title, a status line, its PR (linked to its PR tab) with CI,
  Open in dashboard, and Stop while it works. Settled workers fold into one
  line each;
- deep links (rich_text channel elements with tab_id) from the board's
  "Tabs: Workers · Code" line, from each board task's PR, and from the
  wrap-up to the Code tab and the open PR tabs (a worker's only while the
  board's scope admits the channel). Each is resent without the links if
  Slack refuses them.

The budget has three tiers: Plan, Code and Workers are never removed to make
room; then PR tabs; then the agent's own tabs, which give way first. A PR
tab never makes room for another PR tab or for an agent tab. A PR tab
removed to make room re-renders the board and the Workers tab without it.

The Workers tab's Stop (worker_stop.py) passes the context bar's gates
(actions.admit), checks that the click came from this channel's recorded
Workers view, applies the channel Stop's rule (actions._may_stop),
resolves the button's item id on this channel's own board, then asks a
synchronous final gate right before it stops that one helper: its turn,
pinned to the turn the gate admitted, and the sub-agents it started, as the
channel's Stop (stop_helpers) leaves a helper. Nothing holds it stopped. The
stop shows as "Stopped by @user · HH:MM" on the board and the tab until the
worker's next turn.

Every tab write and removal re-checks the archive, Stop and channels fences,
and the board's scope at the client's commit point (surface.send_fence).
Tab records follow what Slack did even when the call is cancelled after
Slack answered, and a tab whose answer was lost (or whose record a restart
cut off) is removed by its key once its PR settles or the board empties.
A PR-tab write or removal Slack held back (a 429, a full channel), a PR
tab still held when a refresh comes early, and a full channel holding
back the Workers tab now arm the channel's refresh on the board's timer
for when the hold ends, with or without a work board. A permanent
refusal arms nothing, and repeated holds share the one timer per
channel.
@kyleseaman
kyleseaman force-pushed the feat/code-channel-view-tabs branch from 0cc7dcb to 702cf27 Compare November 18, 2026 06:51
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 18, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider raised 1 possible problem and estimates a 50% chance that this change introduces a defect; a person should check it.

The code is carefully built, but the central new action (Stop from the Workers tab) depends on a Slack payload field (container.view_id) that the author hasn't confirmed against a live workspace. The PR says the live press is still to do before merge, and there's no real-machine verification section. If the field is named differently, Stop is refused every time: safe, but the feature doesn't work. Request the live verification, and a fix if the shape differs, before merging.

Things to check (possible problems the decider raised; at this confidence many turn out to be fine):

  • One of the PR's stated goals is a Workers tab where a person can stop one helper agent. Every Stop click passes or fails on one guessed payload field, container.view_id. The author says Slack's docs don't name the container's fields and that live capture hasn't been done. If Slack names that field (src/⁠kiro_crew/slack/code_channels/worker_stop.py, medium)

Tier: 2, held for a person: reviewer-finding.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 702cf27600 · 6955 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The Stop path reuses the channel Stop's own checks, and the final gate sits right before the stop, which is solid work. One item still blocks merge on this head.

  1. src/kiro_crew/slack/code_channels/worker_stop.py:102 (parse(), lines 92 to 102). A person presses Stop in a real code channel's Workers tab. parse() reads the channel only from payload.channel, container.channel_id or container.channel, and the view only from container.view_id. If Slack puts either field anywhere else, every Stop is refused. It fails closed, so nothing unsafe happens, but the main interactive path of the Goal does nothing. All the Stop tests build their click from _stop_payload() in test/slack_code_channel_view_tabs_helpers.py, which supplies both fields itself, so they cannot catch this. The body says the payload is "Not yet captured from a live workspace" and lists a live press as "Still to do before merge". The body also has no ## Real-machine verification section, which testing-conventions.md requires for a change to what runs. Smallest fix: press Stop once in a live test code channel. Paste the workers tab container key line from _log_shape into the body. Add a ## Real-machine verification section with Before, After and Cleanup lines. If the real payload differs, fix parse() and _stop_payload() so the tests match what Slack actually sends.

Optional:

  • If the channel id is missing, the refusal is silent: admit() finds no binding, and _respond returns early on not (click.channel and click.user) (around line 361). Consider giving the presser some reply in that case.
  • The "Stopped by" overlay in board/stops.py (and its readers in model.py, render.py, publisher.py and tabs.py) goes further than the Goal and the RFC's Workers-tab text, which asks only for the audit record. The presser already gets a private reply. Consider dropping it, or say why it is needed.
  • The Screenshots section names .logs/r2/shots/r81.png, which is not attached. Please attach the render so reviewers can see the Workers tab.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 18, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Thanks for the review. All four points are addressed in the description at 702cf2760084a0a90cf5577d8ca7f0540a75e8b3, with no code change.

The live payload (blocking). I pressed Stop once on a working helper in a live test code channel built from this head. The gateway logged:

20:05:00 INFO kiro_crew.slack.code_channels.actions [PID 21775]: workers tab container keys: ['channel_id', 'type', 'view_id']

That is the shape parse() reads (worker_stop.py:92-102): the view from container.view_id, and the channel from payload.channel or else container.channel_id. The view id matched the channel's recorded Workers view, because the stop got past both view checks (worker_stop.py:165 and :444). The audit row reads slack.code_channel.stop allowed, action=worker-stop ... result=stopping subagents=0, and the gateway logged a cooperative cancel for that one worker's turn (soft-acked in 0.24 s). The channel's own session was not stopped, and Slack showed me privately "Stopping Run sleep 600 in the shell, then report done. The conductor keeps going." _stop_payload() already builds this container shape, so neither it nor parse() changed. The description now has a ## Real-machine verification section with Before, After and Cleanup, and the block_actions section quotes the line above.

Optional: no reply when the click names no channel. Kept as is, because a real Workers-tab click carries container.channel_id. A payload with no channel id gets channel="" from parse(). actions.admit() then finds no binding (actions.py:266), audits the press as denied, "not a bound code channel" (:268), and asks to reply (:269). The reply is dropped at worker_stop.py:361, because an ephemeral needs a channel. Nothing is stopped, and the refusal is in the audit log.

Optional: the "Stopped by" overlay. Kept, and the description now says why. It is the one place the other members of the channel see that a person stopped a helper, and when. The private reply reaches only the presser, and the audit row only the operator. You're right that it goes beyond the RFC's Workers-tab text. Its three known races each have a test: a press while a stop is already in flight credits nobody, a queued turn that starts after the stop is never marked stopped, and a label gone stale during a send is written again.

Optional: the screenshot. It is now attached in the Screenshots section, rendered from this head's blocks.

@kyleseaman
kyleseaman dismissed KiroCrewCaptain’s stale review November 18, 2026 20:23

The blocking point is answered: one live Stop press on this head, with the log line, in the description (Real-machine verification) and in #38998 (comment).

@kyleseaman
kyleseaman enabled auto-merge (squash) November 18, 2026 20:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 18, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 702cf27 false-positive: Both findings are in main's files, not this PR's. The review diffed the stale base fb81cec against the merge ref, so it read main's commits as this PR. AUTOSDE.yaml and the docs/decisions entry (from #36888, decided by a maintainer) are not among this PR's 35 files, and it changes nothing under website/.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@kyleseaman recorded a false-positive release (class false-positive) for the gpt AI finding on 702cf2760084a0a90cf5577d8ca7f0540a75e8b3.

Both findings are in main's files, not this PR's. The review diffed the stale base fb81cec against the merge ref, so it read main's commits as this PR. AUTOSDE.yaml and the docs/decisions entry (from #36888, decided by a maintainer) are not among this PR's 35 files, and it changes nothing under website/.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 18, 2026
@kyleseaman
kyleseaman merged commit 640338a into main Nov 18, 2026
122 of 132 checks passed
@kyleseaman
kyleseaman deleted the feat/code-channel-view-tabs branch November 18, 2026 21:03
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants