Skip to content

feat(slack): turn helper agents on with a first enable of code channels - #38112

Merged
iamwhatever merged 1 commit into
mainfrom
feat/code-channel-helpers-default-on
Nov 17, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/code-channel-helpers-default-on

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Turning helper agents on for existing installs. A value an install already stored is kept, including an explicit off, and nothing is flipped on upgrade (rejected: changing the stored default).
  • Changing what helper agents may do: the owner-only, workspace (no Slack Connect), one-level-deep and approval-mode limits on hand-off are unchanged.
  • Changing the in-channel Turn on helper agents for all code channels button or the refusal text.

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.py
    • dispatch_follows_enable(stored): a save that turns Code channels on also turns helper agents on only when Code channels are not saved on and config.json stores no code_channel_dispatch value.
    • validate_code_settings: on such a first enable, stages code_channel_dispatch: true when the body does not name it and config.local.json neither 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.
    • The GET adds code_channel_dispatch_on_enable (the same rule over the files as they are now; false when either file cannot be read; a non-object slack section 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's finalize hook. It is re-decided on the config.json read inside the sidecar lock, so a value stored since the save's first read (a kirocrew config set slack.code_channel_dispatch false while a token verifies) is kept and is not overwritten with true. The SEL entry names code_channel_dispatch only when this save wrote it, and a failed paired .env write undoes it with the rest of the save.
  • website/src/pages/settings/SlackCodePanel.tsx, slackCodeDraft.ts: when code_channel_dispatch_on_enable is 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, unless config.local.json owns 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.
  • Settings text: the sub-toggle's description now starts "On by default when you first turn on Code channels." (all 12 locales, en-XA regenerated); the config field's help, config-baseline.json and the settings registry are regenerated to match.
  • Docs: docs/guides/slack-setup.md and docs/system-specs/modules/session-control.md describe the first-enable rule.

Unchanged: SlackConfig.code_channel_dispatch still defaults to False, 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_dispatch value, 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 stores code_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 stored false survives 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": null the 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 .env write 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: with config.local.json unreadable or pinning the key, enabling Code channels saves but writes no base helper value.

website/src/test/SettingsSlackCodePanel.test.tsx (Code channels card):

  • a first enable turns the sub-toggle on, shows the new text, and saves {code_channels: true, code_channel_dispatch: true};
  • an off chosen in that save is sent as code_channel_dispatch: false;
  • switching Code channels back off before saving sends neither key;
  • with no first enable read (a value stored, or a card read while config.json was unreadable), turning Code channels on sends the off the card shows, so a stale card never saves helpers on behind an off toggle;
  • with config.local.json owning 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 .env rollback 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 to True fails the existing-install, first-enable and unreadable-config tests; dropping the config.local.json lock 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:

Code channels off, no helper-agents row

Fresh install, right after turning Code channels on (before saving): the helper-agents sub-toggle comes on with it and its text says so.

Code channels on, helper agents on by default

An install that already saved helper agents off: turning Code channels on keeps it off.

Code channels on, helper agents kept off

Related Issues

N/A -- requested by the owner in chat; no tracking issue.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners November 16, 2026 21:38
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f12f440c88853db276a1a30f34c52b599c999ffc — 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. Helper agents coming on with a first enable is a product-shape default, and the base already records it: rfc-slack-code-channels.md is partial, and its "Helper agents" amendment (2026-11-16) and its Backward compatibility section describe exactly this rule.

What this change ships

Inventory (7 items) — 7 justified

Intent: 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).

  1. A save that first turns Code channels on, with no helper-agents value stored, also saves helper agents on. Any stored value, including an explicit off, is kept — justified
  2. On a first enable, an off chosen in the same save is stored as an explicit off — justified
  3. If config.local.json sets the key or can't be read, the save writes no helper-agents value — justified
  4. On the Settings card, switching Code channels on also flips the helper-agents sub-toggle on, and switching it back off before saving undoes that — justified
  5. The GET returns a new read-only field, code_channel_dispatch_on_enable, with one consumer (slackCodeDraft.ts) — justified
  6. The save decides again inside the lock, so a value stored after the first read isn't overwritten. It reuses the existing _LockedSectionWrite finalize hook — justified
  7. The sub-toggle text, the config help, the generated registries, 12 locales and the specs now describe the first-enable rule — justified

[FIRST-PRINCIPLES-REVIEWED] f12f440

Description read

[DESCRIPTION-READ] b60200d8f3cf3e173c3044b436390b0491ed84d3f086284c00b35c48e46d5b32

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 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 .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 16, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

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

  • The reader asked, "if I turn Code channels off and back on, I can't tell whether helpers will switch themselves back on." After the first enable is saved, later enables keep whatever is stored, so code_channel_dispatch_desc shouldn't read as a rule that applies every time. Suggested wording: "Turned on with Code channels the first time; after that it stays as you set it."
  • The reader hesitated on shot-02: "It switched itself on, and helpers can change files." Change the opener "On by default…" so it names what the user gets, e.g. "Lets the code channel hand work to helper agents. On the first time you turn on Code channels."
  • The screenshots show "5 permissions", but code_channels_desc says 6. Retake shot-02 on this build so the pixels match the strings that ship.

[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 .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 16, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] f12f440

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

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f12f440c88853db276a1a30f34c52b599c999ffc and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f12f440

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@kyleseaman
kyleseaman force-pushed the feat/code-channel-helpers-default-on branch from 0041c86 to 0b3e40a Compare November 17, 2026 03:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
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.
@kyleseaman
kyleseaman force-pushed the feat/code-channel-helpers-default-on branch from 0b3e40a to f12f440 Compare November 17, 2026 03:34
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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 f12f440c88 · 371 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

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 slack.code_channel_dispatch on, which turns on the code channel containment exemption by default, so a maintainer decides that widening.

Review result on this head: no blocking findings. The review read the full diff, every caller of validate_code_settings, and the locked write's finalize and restore path. The first-enable rule matches the RFC text on main. A stored value, including an explicit off, is kept. A pinned or unreadable config.local.json still means no base write. The hand-off gate in code_channel_exemption is unchanged, so the owner-only, workspace-only, one-level and approval-mode limits still apply. PR Readiness is green. Done well: the server re-decides the value inside the sidecar lock, so a value that kirocrew config set stored between the read and the write is kept, and a test pins that by interposing on update_config_locked, with no timing.

Optional:

  • The first-enable decision lives in two places. The Settings card always sends the shown value on an enabling save, so the server's own default branch (slack_code_settings.py near line 449) and the finalize re-decision in slack_settings.py (near lines 303 to 316) run only for an API client that leaves out the key. If you keep both, say in the PR why you need two deciders.
  • No test covers the "this save turns Code channels on" half of enabling (slack_code_settings.py:424). One case would close that gap: on a fresh config, PUT {"agent_sessions": true}, then assert that code_channel_dispatch is not stored.
  • Turning Code channels back on after an off, with no stored helper value, also turns helpers on. The new spec line "an existing or upgraded install changes nothing" (session-control.md:2456) says more than the code does. The RFC wording "an upgrade alone changes nothing" fits better.

@iamwhatever
iamwhatever merged commit 65f347f into main Nov 17, 2026
99 checks passed
@iamwhatever
iamwhatever deleted the feat/code-channel-helpers-default-on branch November 17, 2026 15:32
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 17, 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