Repository navigation
feat(slack): turn helper agents on with a first enable of code channels - #38112
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Helper agents coming on with a first enable is a product-shape default, and the base already records it: What this change shipsInventory (7 items) — 7 justifiedIntent: when an owner first turns on Slack code channels, helper agents come on too, so the conductor's first hand-off isn't refused. This is an ADDITION (a changed default).
[FIRST-PRINCIPLES-REVIEWED] f12f440 Description read[DESCRIPTION-READ] b60200d8f3cf3e173c3044b436390b0491ed84d3f086284c00b35c48e46d5b32 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 rule is decided at the one write path that turns Code channels on, and the old opposite pin is reversed by the RFC's 2026-11-16 amendment, which is already on main. [DESIGN-REVIEWED] f12f440 Description read[DESCRIPTION-READ] 0335cf4b9767bc6bee17991726cdfc0d40fc8feee78ea896b340de3df4400486 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) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The screenshots show the one changed string and both states of the sub-toggle, and the blind reader read the helper switch correctly and switched it off without trouble. Notes
[UX-REVIEWED] f12f440 Description read[DESCRIPTION-READ] bc6058fa5498dc421bc119f620347c8f2e1034c1ed3fcaf7a3f68bcc8e47059d That sha256 names everything this verdict read: the PR description, plus the 6 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: |
0041c86 to
0b3e40a
Compare
A settings save that newly turns Code channels on also saves slack.code_channel_dispatch on, unless config.json already stores a value (an explicit off is kept) or config.local.json sets it or cannot be read. Existing installs keep what they stored; an unset, unreadable or malformed value still reads as off. The card turns the sub-toggle on with the switch before the save and says so; the RFC is amended to record the decision.
0b3e40a to
f12f440
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: 29 files, more than 20. Implements the RFC's amended first-enable rule for slack.code_channel_dispatch (on main in rfc-slack-code-channels.md §3 and Backward compatibility). The server turns helpers on only on a real first enable with nothing stored and no config.local.json overlay. The implied value is decided again inside the locked write via the existing finalize hook, so a concurrent CLI edit is kept. The .env-failure rollback also removes the helpers value (finalize marks it as touched). The audit-log entry is adjusted to match what was written. The in-channel button path is unchanged. The UI reloads its saved state after each save, so the new on-enable flag never goes stale. Tests cover each branch, and CI and all review lanes are green. Tier: 2, held for a person: 29 files, more than 20. 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 |
|
The design for this change is recorded in the RFC amendment #38124, which a maintainer approved. This PR now waits for a maintainer approval. A first enable now saves Review result on this head: no blocking findings. The review read the full diff, every caller of Optional:
|
Problem / Motivation
Goal: When an owner turns Slack code channels on for the first time, helper agents come on with them, so the channel's conductor can hand off work without a second setting.
Today a new code channel's conductor refuses its first hand-off with "This code channel isn't allowed to open helper chats", because Let code channels start helper agents (
slack.code_channel_dispatch) is a separate opt-in that turning Code channels on never saves. A conductor only plans and hands off work, so with the default a fresh setup cannot do the one thing code channels are for until the owner finds the sub-toggle (or presses the in-channel Turn on helper agents button).Why it matters
Every owner who turns code channels on hits the refusal on their first real request. The owner asked for helper agents to be on by default; that decision is recorded in the governing RFC's Helper agents section (amended 2026-11-16) and its Backward compatibility section, added by #38124.
Not a goal
What changed (motivation → approach → change)
Motivation → approach: the default has to follow the owner's first enable, not the stored config default, because the stored default is what existing installs read; changing it would turn helpers on for every install that never chose (the rejected option). So the decision is made at the one write path that turns Code channels on,
validate_code_settings, which both the Settings card's save and the in-channel button go through.The governing RFC, rfc-slack-code-channels.md, records this decision through its own docs-only PR, #38124: the "Helper agents" paragraph (amended 2026-11-16) states the first-enable rule, the kept limits and the rejected option, and its Backward compatibility section names the one setting that follows a switch. This PR does not edit the RFC; it builds what that text says.
src/kiro_crew/dashboard/slack_code_settings.pydispatch_follows_enable(stored): a save that turns Code channels on also turns helper agents on only when Code channels are not saved on andconfig.jsonstores nocode_channel_dispatchvalue.validate_code_settings: on such a first enable, stagescode_channel_dispatch: truewhen the body does not name it andconfig.local.jsonneither sets the key nor is unreadable (the overlay wins over a base write, and an unreadable one may, so nothing is written for helpers then and the Code channels save still succeeds). When the body names the value on a first enable it is staged even if it equals "off", so an off chosen in that save is stored as an explicit off and kept by later enables.code_channel_dispatch_on_enable(the same rule over the files as they are now;falsewhen either file cannot be read; a non-objectslacksection counts as empty, as the save rebuilds it).src/kiro_crew/dashboard/messaging_api/slack_settings.py: the Settings save writes that implied helper-agents value through the locked write'sfinalizehook. It is re-decided on theconfig.jsonread inside the sidecar lock, so a value stored since the save's first read (akirocrew config set slack.code_channel_dispatch falsewhile a token verifies) is kept and is not overwritten withtrue. The SEL entry namescode_channel_dispatchonly when this save wrote it, and a failed paired.envwrite undoes it with the rest of the save.website/src/pages/settings/SlackCodePanel.tsx,slackCodeDraft.ts: whencode_channel_dispatch_on_enableis true, turning the Code channels switch on also turns the sub-toggle on in the draft (and turning it back off before saving undoes that). Every save that turns Code channels on sends the sub-toggle's shown value, unlessconfig.local.jsonowns it (the toggle is locked then), so the server stores exactly what the card showed even when the card was read before the files changed. Only an API client that omits the value gets the server's own first-enable decision.config-baseline.jsonand the settings registry are regenerated to match.docs/guides/slack-setup.mdanddocs/system-specs/modules/session-control.mddescribe the first-enable rule.Unchanged:
SlackConfig.code_channel_dispatchstill defaults toFalse, and a missing, unreadable or malformed value still reads as off (_safe_bool). No Sensitive Change Review path is touched.Backwards compatibility
Compatible: an install with a stored
code_channel_dispatchvalue, or with Code channels already saved on, reads and saves exactly as before; only a save that newly turns Code channels on with nothing stored writes the new value, and the PUT accepts the same fields as before.Removes nothing: the change adds one staged key on a first enable and one read-only GET field; no key, validator, path or record is removed or narrowed.
Tests
test/test_slack_code_settings.py(TestDispatchSubToggle):test_newly_turning_code_channels_on_turns_helpers_on: a first enable storescode_channel_dispatch: true, SEL-logs it, and the GET then reads it on.test_an_existing_install_keeps_its_stored_value: Code channels already on with nothing stored: a later save writes nothing for helpers and they read off.test_an_explicit_off_is_kept_when_code_channels_are_turned_on: a storedfalsesurvives turning Code channels on.test_an_off_saved_with_the_enabling_save_is_stored_as_explicit: an off in the enabling save is stored and kept by a later off/on.test_an_unreadable_or_malformed_config_reads_off(torn, non-object,"yes"): reads off, and the card is not told helpers will follow.test_a_non_object_slack_section_is_a_first_enable_on_card_and_save: with"slack": nullthe save rebuilds the section as{}and stages helpers on, and the card is told the same.test_a_value_stored_after_the_snapshot_is_kept_on_enable(off and on): a value written between the save's read and its locked write is kept, and the SEL entry does not claim the save wrote it.test_a_failed_env_write_undoes_helpers_turned_on_by_the_enable: a failed paired.envwrite leaves neither Code channels nor helper agents stored.test_an_overlay_that_cannot_be_read_leaves_helpers_off_on_enable, plus a new assertion in the overlay-pin test: withconfig.local.jsonunreadable or pinning the key, enabling Code channels saves but writes no base helper value.website/src/test/SettingsSlackCodePanel.test.tsx(Code channels card):{code_channels: true, code_channel_dispatch: true};code_channel_dispatch: false;config.jsonwas unreadable), turning Code channels on sends the off the card shows, so a stale card never saves helpers on behind an off toggle;config.local.jsonowning the value, the enabling save sends no helper value (the locked toggle is never sent).Fail-first: all 9 new backend cases fail on the base code, and both cases of the snapshot-race test fail without the locked re-decision (the
.envrollback test guards rollback and passes either way), and 2 of the 3 new UI cases fail with the UI change reverted (the third pins the undo path, which the base also satisfies); the stale-card case fails with the earlier send-only-on-first-enable rule. Mutation checks: ignoring a stored value fails the explicit-off, malformed-value and same-save-off tests; flipping the config default toTruefails the existing-install, first-enable and unreadable-config tests; dropping theconfig.local.jsonlock from the payload rule fails the locked-toggle test.Proof: not provable -- other: feature PR; fail-first and mutation runs recorded in the hand-off evidence
Manual verification
The Settings card was rendered from the built SPA with stubbed API responses (screenshots below): before and after turning Code channels on for a fresh install, and the same switch for an install that already saved helpers off. Not checked against a live Slack workspace; the server rule is covered by the tests above.
Screenshots / video
Settings → Channels → Slack → Slack Code, rendered from the built SPA with stubbed API responses (dark theme, 1x).
Fresh install, before turning Code channels on:
Fresh install, right after turning Code channels on (before saving): the helper-agents sub-toggle comes on with it and its text says so.
An install that already saved helper agents off: turning Code channels on keeps it off.
Related Issues
N/A -- requested by the owner in chat; no tracking issue.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.