Skip to content

fix(session-control): let the owner's Conductor dispatch workers - #24653

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/conductor-owner-tab-dispatch
Oct 29, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/conductor-owner-tab-dispatch

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Conductor the person starts in their own dashboard chat can open and drive its worker chats even when agent.session_control is false, reaching only the sessions it created.

On an install whose config stores agent.session_control: false (the pre-#8375 default, which Doctor reports but never overrides), a kirocrew-conductor chat cannot dispatch anything: session_create refuses with session control is disabled in config (agent.session_control) (session_control_disabled). Crew members already bypass that switch; the owner's own Conductor does not, so Crew Mode cannot do its one job out of the box on those installs.

Why it matters

Crew Mode and the shipped Conductor exist to dispatch workers. Anyone with the stored old default gets a Conductor that can only chat, with a refusal that points at a switch they may never have set on purpose.

Not a goal

  • Changing the agent.session_control default or migrating stored values.
  • Giving cron, channel-linked (Slack/Discord/...), app-scoped, crew-member or agent-created conductors any new reach.
  • A new config key: the existing agent.member_dispatch ceiling governs this bypass.
  • Changing what an owner-tab Conductor can reach while agent.session_control is on.

What changed (motivation → approach → change)

Security-relevant authorization change. It adds a switch bypass to session control, so it needs a careful review.

The switch gates in create_session, fork_session and authorize_target exempted only crew members (_member_bypass). The owner's Conductor is now exempt on the same terms:

Piece What it does
Who (_owner_tab_conductor) Positive identity off the caller's own slot: a chat- tab key, agent in CONDUCTOR_AGENTS (kirocrew-conductor and its deprecated alias), no _created_by, no channel or cron link, not channel-born, not app-scoped, no non-user origin, not a crew member
Ceiling (_conductor_bypass) That predicate AND member_dispatch_enabled(), so agent.member_dispatch: false, an unreadable config, or a degraded agent section withdraws it, the same as for members
Fence (_conductor_fenced) While the switch is off, the Conductor is one more population of _caller_is_ownership_fenced and _delegation_lineage_fenced: it reaches only sessions it created (not_creator otherwise, with Conductor-specific wording) and binds no private-member store
Gates _dispatch_bypass (member OR Conductor) replaces _member_bypass at the three switch gates

A worker the Conductor creates carries _created_by, so it gets no bypass and stays fenced whatever agent it inherits. With the switch on, the Conductor keeps the owner's reach, as before. I reused member_dispatch instead of adding a sibling key: it is already the operator's one ceiling on "a dispatching agent works without session_control", it already fails closed, and a second key would be a second thing to find when withdrawing it.

The session-control spec gains "The owner's Conductor" section, and its refusal table and member_dispatch config entry name the new bypass. The operator-facing text says the same: the session_control and member_dispatch field descriptions in sections_agent.py (and config-baseline.json, regenerated) and the packaged src/kiro_crew/docs/session-control.md switches table. The superseded-default note for agent.session_control (superseded_defaults.py and the config spec's table) says a stored false withdraws session control from ordinary agents, with members and the owner-tab Conductor keeping the fenced bypass unless agent.member_dispatch is also false.

Backwards compatibility

Compatible: a call refused today with session_control_disabled can now succeed for the owner-tab Conductor only. Every other caller sees the same answers, and nothing main accepts is rejected.

Removes nothing: the diff adds a bypass and a fence population; no key, path, record or public function is removed or renamed.

Tests

test/test_session_control_conductor_bypass.py (29 tests), through the real create_session / authorize_target paths:

  • owner-tab Conductor creates a worker and can send / read / stop / close it with the switch off;
  • the same Conductor gets not_creator on the person's other chat and on a peer Conductor's worker;
  • with the switch on it keeps the owner's reach;
  • cron-keyed and channel-linked Conductors are still refused session_control_disabled;
  • a child of the Conductor (running the Conductor agent) gets no bypass, is refused with the switch off, and is not_creator-fenced with it on; the lineage walk fences both for private-member dispatch;
  • member_dispatch=false, a degraded agent / whole config, and an unreadable config each withdraw the bypass;
  • predicate table: every non-conductor shape (other agent, _created_by, Slack or cron link, channel-born, app, cron/app origin, cron/workflow/member keys, member store, missing slot) answers false.

Proof: PROVEN test/test_session_control_conductor_bypass.py::TestOwnerTabConductorEndToEnd::test_is_refused_on_a_session_it_did_not_create (head 184f058)

Related suites (43 session-control, member, cron and facade test files, 1538 tests) pass locally. Determinism: the new file passed 5 consecutive runs and one run in a shuffled node order (seed 7).

Manual verification

N/A: unit coverage drives the real gate, fence and create paths. A live-gateway check with a Conductor tab was not run.

Related Issues

Closes #24620

Sibling sweep

Swept: git grep -n "_member_bypass|session_control_enabled()" -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/session_control_parts/session_create.py -- changed here
Sibling: src/kiro_crew/dashboard/session_control_parts/target_authorization.py -- changed here
Sibling: src/kiro_crew/dashboard/session_control_parts/session_tree.py -- changed here
Sibling: src/kiro_crew/dashboard/handlers/session_control.py -- not affected -- its scoped-caller gate lets an owner (unscoped) caller through unchanged
Sibling: src/kiro_crew/dashboard/handlers/_shared_route_guards.py -- not affected -- it gates only scoped (private-store) callers, never the owner tab

Pattern harvest

Not generalizable: the defect is one missing caller class at a deliberate operator switch, not a repeated code shape a rule can match.

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

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners October 27, 2026 00:15
@kyleseaman
kyleseaman requested a review from buluoray October 27, 2026 00:15
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 184f058d8b54e829e21d586da273c7cfd7384a17 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 added the readiness: checking Automated validation is still running label Oct 27, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Local adversarial review (a fresh subagent that saw only the diff) tried to break the ownership fence. Nothing breaks it outright; each conditional attack checked against the code:

  • Fork laundering: not a defect. fork_session stamps child._created_by = caller_key (session_tree.py:337), and the source goes through authorize_target (session_tree.py:181), so a fork is fenced and gets no bypass.
  • Handoff clears _created_by: not a defect. Handoff moves the manager record, never _created_by. The only writers are create, fork, revive, rehydrate and session_managers' UNVERIFIED_CREATOR, and none clears it.
  • Restart drops _created_by: not a defect. Rehydrate restores it (metadata_codec.py:779), pinned by test_save_and_rehydrate_keep_attribution_but_never_lineage.
  • Owner switches the tab's agent mid-request: Low, rebutted. Only the owner can do it, in their own tab, and a create re-checks caller identity (_refuse_moved_caller_identity). The Opus lane rejected the same candidate on validation.
  • Project-local agent named kirocrew-conductor: Low, rebutted. The owner picks that agent in their own tab, the name is how the other Conductor checks key too, and the Conductor stays creator-fenced.
  • Spoofed caller key: pre-existing, not introduced here. The MCP gate accepts only the gateway-issued strict key (_session_control_gate).
  • Degraded agent section reads session_control as its default: pre-existing for every caller and outside this PR's goal. The Conductor bypass itself fails closed on it (member_dispatch_enabled()), as the tests pin.
  • Facade patch might not reach _conductor_fenced: not a defect. _facade_mirror forwards the patch to every owner, and the not_creator assertions only pass when the fence engaged.

The GPT local lane raised one Medium: an autouse fixture used the shared monkeypatch. Fixed in this head with _floor_monkeypatch. The Opus local lane found nothing.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the bypass checks the caller's identity directly, it is capped by the existing member_dispatch setting, and it is fenced to sessions the Conductor created, the same way the member bypass is.

Notes

  • A stored agent.session_control: false can't be told apart from a deliberate operator choice, so this quietly narrows what an explicit withdrawal does. The way back is agent.member_dispatch: false, which the help text now says, so the change can be undone. Consider having Doctor point at member_dispatch when it reports the old stored default.

[DESIGN-REVIEWED] 184f058

Description read

[DESCRIPTION-READ] 8a4079ed53c07e9fbe547648967792337efdf954defc32d184f0c972ef4bc99e

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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 184f058d8b54e829e21d586da273c7cfd7384a17 — 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 bypass fixes the reported defect (#24620) under the existing member_dispatch ceiling. Two notes: the PR reverses a recorded "including a conductor" decision without calling it a reversal, and it adds a third copy of a conductor-name set.

Notes

  • Item 6 — inherited: the base comment in superseded_defaults.py said "A stored False keeps every peer-session tool disabled, including a conductor whose agent spec deliberately mounts the dashboard server … an operator's explicit security choice". The description presents its rewrite as a wording sync, not as reversing that decision; only Conductor in an owner dashboard tab can't open worker chats when agent.session_control is false #24620 supports the reversal.
  • Item 7 — duplicate of src/kiro_crew/autonudge_selfarm.py:57 / src/kiro_crew/context_assembly/agent_spec.py:52: grepping frozenset({"kirocrew-conductor", "kirocrew-ledger-conductor"}) finds 2 existing identical literals, and CONDUCTOR_AGENTS is the 3rd. Subtraction: point CONDUCTOR_AGENTS at one of the existing sets, so there is one set to edit when the alias retires.

What this change ships

Inventory (7 items) — 5 justified

Intent: let a person's own-tab Conductor dispatch workers on installs that stored session_control: false. This is a FIX.

  1. With session_control off, an owner-tab Conductor can create, fork and drive worker chats — justified
  2. With the switch off, that Conductor reaches only the sessions it created (not_creator otherwise, with Conductor wording) — justified
  3. With the switch off, it and its descendants cannot mint private-member workers — justified
  4. agent.member_dispatch: false now also withdraws the Conductor's bypass — justified
  5. The Session Control and Member Dispatch help text, the packaged docs and the spec describe the bypass — justified
  6. The superseded-default note reversed: a stored false no longer covers the Conductor — inherited (pin rewritten without stated evidence)
  7. New exported CONDUCTOR_AGENTS / OWNER_CHAT_SLOT_PREFIX constants — duplicate of autonudge_selfarm.py:57

[FIRST-PRINCIPLES-REVIEWED] 184f058

Description read

[DESCRIPTION-READ] dfa3786ccdd790467df0b259d7eb26d6d1df6c302eb8ee9b4176a770e1d6fa7d

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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 184f058

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 184f058

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 184f058d8b54e829e21d586da273c7cfd7384a17 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 Oct 27, 2026
@kyleseaman
kyleseaman force-pushed the fix/conductor-owner-tab-dispatch branch from 3fdda3c to 7a2ef94 Compare October 27, 2026 01:48
@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 labels Oct 27, 2026
@kyleseaman

kyleseaman commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: no

  • span=97aa098e381f: operator-facing descriptions omit the Conductor bypass

fixed in 7a2ef94: the session_control and member_dispatch field descriptions (sections_agent.py, config-baseline.json regenerated) and the packaged src/kiro_crew/docs/session-control.md switches table now say the owner-tab Conductor bypasses session_control: false, creator-fenced, and that agent.member_dispatch: false withdraws it.
The two docstring notes are fixed too: the mirrored-slot line now reads "sixth population", and _delegation_lineage_fenced limits the owner-tab exemption to session_control on.

@kyleseaman

Copy link
Copy Markdown
Contributor Author
  • span=item-1: Product-shape change without accepted RFC: the meaning of agent.session_control: false

needs-a-decision: the lane is right that this changes what a stored agent.session_control: false means. Before this PR it withdrew peer-session tools from every agent except crew members. With it, it no longer withdraws them from the owner-tab Conductor either, which stays creator-fenced, and agent.member_dispatch: false withdraws both.
Maintainer question: should a stored false keep the owner's Conductor chat-only, as superseded_defaults.py records today? Or should the Conductor get the same fenced bypass crew members already have? If the bypass is accepted, record the ruling with /ai-review override first-principles <head> product-shape: <decision>, or with an RFC. If it is rejected, the alternative is to close this PR and leave the fix to Doctor's stale-default notice.
Item 7, the stale comment at superseded_defaults.py:354 and config.md:723, is being fixed in the next push either way.

@kyleseaman
kyleseaman force-pushed the fix/conductor-owner-tab-dispatch branch from 7a2ef94 to 9e24101 Compare October 27, 2026 02:11
@kyleseaman
kyleseaman force-pushed the fix/conductor-owner-tab-dispatch branch from 9e24101 to 184f058 Compare October 27, 2026 02:26
@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 Oct 27, 2026
@kyleseaman
kyleseaman enabled auto-merge (squash) October 27, 2026 04:08
@iamwhatever

Copy link
Copy Markdown
Contributor

Holding 184f058 for a maintainer, for two reasons.

  1. It is an authorization change. It lets the owner-tab Conductor bypass agent.session_control: false at the create, fork and target gates (caller_access.py L86-L160). Changes to who may control peer sessions are reserved for human review.
  2. The author's own disposition on the First Principles item asks a maintainer to decide whether a stored false should keep the Conductor chat-only, as superseded_defaults.py recorded, or give it the fenced bypass. There is no ruling yet.

I found no defect. The predicate is positive identity on the caller's own slot: a chat- key, a Conductor agent, no _created_by, and no channel, cron or app link. It is capped by member_dispatch_enabled() and creator-fenced while the switch is off. Checks are green and the GPT and Opus lanes have no findings. A small cleanup the lane noted: CONDUCTOR_AGENTS duplicates the existing literals in autonudge_selfarm.py and context_assembly/agent_spec.py.

What clears it: a maintainer ruling on the product question (an override or RFC note, as the disposition proposes) and a human review of the bypass.

— crew-pr-reviewer (r128)

@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.

Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head (or skipped / author override), UX skipped or pass, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 44afe1f into main Oct 29, 2026
107 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/conductor-owner-tab-dispatch branch October 29, 2026 19:58
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 29, 2026
@buluoray

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]: The open policy question (a stored agent.session_control: false no longer withdraws the owner Conductor's dispatch) merged without a recorded ruling. Tracked in 25930.

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.

Conductor in an owner dashboard tab can't open worker chats when agent.session_control is false

5 participants