Skip to content

feat(session-control): hide session_create backend behind a Feature Preview - #33659

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/worker-backend-preview
Nov 9, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/worker-backend-preview

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Hide the per-session harness choice (session_create(backend=...), work_dispatch(backend=...)) behind a new Feature Preview, off by default.

#33145 and #33220 let a conductor start a worker on a harness it names. Maintainers want this held back for now: per-Bot harness selection, covering conductor and worker together, is being built, and how the choice is offered in settings is not settled.

Why it matters

Agents read the session_create tool schema and use what it offers. While backend is advertised, conductors start picking harnesses per worker, and that habit and its stored picks become a contract the per-Bot design then has to keep.

Not a goal

What changed (motivation → approach → change)

Preview session_harness Off (default) On
backend in session_create / work_dispatch schema absent present
MCP call with backend refused, nothing sent as today
POST /api/session-control/create with backend 403 session_harness_preview_off as today
spawn_run(backend=...), Bot harness pin unchanged unchanged

The switch follows the existing gateway-read previews (dashboard_stale_fields, crew_oauth): a name in FEATURE_PREVIEW_FLAGS and previewFlags.ts, read per call from dashboard.feature_previews, with a card in Settings > Developer > Feature previews named "Agent Harness for worker chats". Its copy uses the product's existing words: "main chat" for the conductor and "Agent Harness" for the harness, matching the Settings > Agent Harness page. The new session_harness_preview.py holds the reader, the refusal text and the schema filter. mcp_dashboard._list_tools drops backend the same way it already adds crew only while remote dispatch is on.

Off, the refusal comes first: the MCP tools refuse before any gateway call (work_dispatch before it creates the item), and the HTTP route refuses before the crew and backend checks, so nothing is created. An empty backend is no pick and is not refused.

The boundary is exactly what #33145 and #33220 added at creation: the backend argument on session_create, work_dispatch and the create route. What #33145 added downstream (a slot carrying a pick, spawns inheriting it, restore) is left alone, so a session made while the preview was on keeps working after it is turned off.

The card lives in pages/settings/FeaturePreviewsSection.tsx, and the name joins config/sections_dashboard.py. Its copy is in all twelve website/src/i18n catalogs (locales/en.manual.json and the rest), as the catalog parity and new-string gates require. Generated files are regenerated: config-baseline.json, settingsRegistry.gen.ts under components/commandPalette, the settings registry and the UI index. Docs: docs/system-specs/modules/session-control.md, the tool table in session-control.md and configuration.md name the preview.

Backwards compatibility

Breaking: with the preview off (the default), session_create and work_dispatch no longer take backend, and the create route refuses it. Writer sweep on origin/main @ 63d560b: the only writers are the two MCP tools (mcp_dashboard_session_runs._create_session, _run_work_dispatch); no dashboard page, app or built-in skill posts backend to /api/session-control/create.

Reader: src/kiro_crew/dashboard/handlers/session_control.py:api_session_control_create -- chat|subagent -- refuses backend while off; test_off_the_route_refuses_a_backend_and_creates_nothing
Reader: src/kiro_crew/mcp_dashboard_session_runs.py:_run_session_create -- chat|subagent -- refuses before any call; test_off_session_create_refuses_a_backend_without_calling_the_gateway
Reader: src/kiro_crew/mcp_dashboard_session_runs.py:_run_work_dispatch -- chat|subagent -- refuses before creating the item; test_off_work_dispatch_refuses_before_it_creates_the_item
Reader: src/kiro_crew/mcp_dashboard.py:_list_tools -- chat|subagent|cron -- drops backend from two schemas only; test_off_the_schema_does_not_offer_backend
Reader: src/kiro_crew/dashboard/messaging_api/spawn.py:api_spawn -- chat|subagent -- not gated, still takes backend and inherits a slot's pick; test_spawn_backend.py

Tests

  • test/test_session_harness_preview.py (new): off, the schema has no backend, the route refuses with 403 session_harness_preview_off and creates no slot, both MCP tools refuse without a POST; an empty backend still creates; on, the schema offers it and the route takes it; the flag reads off unless exactly true, and off on an unreadable config. spawn_run's schema is left alone.
  • With the gate code reverted (handler, _list_tools, MCP runs), 5 of its 16 tests fail.
  • test/test_session_create_backend.py: an autouse fixture turns the preview on, so it keeps pinning the on behaviour unchanged.
  • website/src/test/previewSurfaces.test.tsx: Feature previews card and switch counts 11 -> 12.
  • Ran locally: the four Python files above plus test_feature_previews_config.py and test_spawn_backend.py (143 passed); vitest previewSurfaces, previewFlagServerSync, catalogParity, settingsSearchGovernance (174 passed); npm run i18n:check, tsc, eslint, flake8, isort, black, mypy clean.

Proof: not provable -- other: feat PR; the gate-revert run above is the equivalent check

Manual verification

Built the SPA and opened Settings > Developer > Feature previews against stubbed APIs: the new card renders off by default, and its switch turns on when clicked.

Screenshots / video

The new "Agent Harness for worker chats" card, off (default):

Agent Harness for worker chats card, off

Switched on

Agent Harness for worker chats card, on

Related Issues

Closes #33658

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@chenmingwei23
chenmingwei23 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 03:46
@chenmingwei23
chenmingwei23 requested a review from Zedmor November 9, 2026 03:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from 854b00f to c8bcf42 Compare November 9, 2026 03:47
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: this is a reversible preview gate, off by default, at the creation boundary only. Stored picks and spawn_run are left alone, and the only writers are the two tools it gates.

[DESIGN-REVIEWED] 402d9d8

Description read

[DESCRIPTION-READ] 4a4caccc6d27c9958e28aeabaabc3a646c1b4e69df4915b94b1051a50bbfec7f

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 402d9d849ea1bde584faae8b4711e3a7e02427c3 — 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

No item blocks. Off by default, the preview takes backend off the tool schemas and the create route refuses it, which stops conductors from picking a harness per worker. A plain revert would do that with less code.

Notes

  • Items 1–3: oversized. The goal is to hold backend back until the per-Bot design lands. Deleting the backend argument from session_create/work_dispatch/the route (reverting the creation half of feat(session-control): start a session on a chosen harness with session_create(backend=...) #33145/fix(session-control): name the backend refusal code in the session_create reply #33220) does that without a new config key, Settings card, 12 catalog strings and refusal code. The PR's own description, "how the choice is offered in settings is not settled", points to a preview with no plan to turn it on.
    Subtraction: remove backend from the two schemas and the route instead of adding session_harness_preview.py, the session_harness flag and the card.
  • Item 5: this adds a third copy of the "load config, read feature_previews.get(name) is True, read failure means off" reader. The two existing copies are connections/crew_oauth.py:enabled and dashboard_agentic.py:stale_fields_enabled (2 found by grepping for KiroCrewConfig.load().dashboard.feature_previews).

What this change ships

Inventory (7 items) — 5 justified

Intent: stop conductors from picking a harness per worker until per-Bot harness selection is built. This is an ADDITION (a gate).

  1. session_create/work_dispatch no longer offer backend by default — oversized
  2. The MCP tools refuse a backend while the preview is off, before anything is created — justified
  3. The create route returns 403 session_harness_preview_off while off — justified
  4. A new "Agent Harness for worker chats" card in Feature previews — justified
  5. New config key dashboard.feature_previews.session_harness — oversized, third copy of the reader pattern
  6. An empty backend is still accepted — justified
  7. Specs and user docs name the preview — justified

[FIRST-PRINCIPLES-REVIEWED] 402d9d8

Description read

[DESCRIPTION-READ] 06fbdec023d10960736a960128b6f709ec26745bd13ddf6d8fedc9a49124627d

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The one new switch appears off and on in the two screenshots, and the blind reader read it correctly ("the side chats would run on another AI").

Notes

  • The reader was unsure ("a guess", "maybe") and said: "I don't know what 'Agent Harness' or 'worker chats' mean." Change session_harness_desc_summary so it names the result in plain words, e.g. "Lets a main chat run its helper chats on another AI, such as Claude or Codex."
  • When the switch turns on, nothing else on the page changes, and the reader looked for that. The card gives no sign that the setting only changes what agents can do. Add one short clause saying the effect is on the agent's tools, not on this page.

[UX-REVIEWED] 402d9d8

Description read

[DESCRIPTION-READ] f374a098c6cd0bf7da017dce382e56b5d61b43dc14c7ca159b04bec45a4630b4

That sha256 names everything this verdict read: the PR description, plus the 5 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 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 402d9d8

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

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

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 402d9d8

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

@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from c8bcf42 to fe4e2d8 Compare November 9, 2026 04:06
@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • The "Harness per session" card can't be understood from its own text

fixed in fe4e2d8: the card is now "Agent Harness for worker chats", summary "Lets a main chat run its worker chats on a different Agent Harness, such as Claude or Codex."
The long text leads with the user-visible effect, names Settings > Agent Harness, and says a bot's own Agent Harness setting keeps working; the mechanism sentence is gone.
Same wording in all twelve catalogs, using each catalog's existing words for "main chat" and "Agent Harness". New screenshots are in the description.

@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 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from fe4e2d8 to 8c17ebf Compare November 9, 2026 04:44
@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 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from 8c17ebf to 7895aae Compare November 9, 2026 05:59
@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 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from 7895aae to 012f413 Compare November 9, 2026 06:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from 012f413 to ef4344d Compare November 9, 2026 08:10
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 9, 2026
…review

Adds the session_harness Feature Preview (default off). Off, session_create and work_dispatch do not advertise backend, and an explicit backend is refused with session_harness_preview_off before anything is created. spawn_run(backend=...) and a Bot's own harness pin are unaffected.
@chenmingwei23
chenmingwei23 force-pushed the feat/worker-backend-preview branch from ef4344d to 402d9d8 Compare November 9, 2026 10:54
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@chenmingwei23
chenmingwei23 enabled auto-merge (squash) November 9, 2026 12:44

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved at 402d9d8.

This puts backend on session_create and work_dispatch behind a new session_harness feature preview, default off. It's a product hold on a harness pick that isn't settled yet, not a security boundary, so I read it as a feature gate rather than added strictness.

  • session_harness_preview.py reads dashboard.feature_previews.session_harness per call, and only a real True counts as on. A config that can't be read counts as off.
  • With the preview off, _list_tools drops backend from the two gated schemas only. spawn_run's own backend stays, and a test covers that.
  • _run_session_create and _run_work_dispatch refuse a backend before any write. work_dispatch refuses before step 1, so no orphan item is created. The HTTP route refuses a non-empty backend with 403 session_harness_preview_off before the crew check, and reads config off the event loop.
  • Sessions that already carry a pick keep it, and a Bot's own harness pin is untouched. The spec and both user docs say so.
  • The Settings toggle, the 12 locale strings, and the generated registry and UI index are all updated, and the switch-count tests moved from 11 to 12.
  • The existing schema tests now hold the preview on, so they still compare only what they meant to.

Tests cover schema on and off, the route refusing with nothing created, an empty backend still working, both tools refusing without a gateway call, the default-off read, and an unreadable config. There is no regex.

CI: all 97 checks are green. You already hold auto-merge, so I'm approving without setting it.

@chenmingwei23
chenmingwei23 merged commit b1b8a42 into main Nov 9, 2026
134 of 136 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/worker-backend-preview branch November 9, 2026 13:14
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 9, 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.

Hide per-session harness choice (session_create backend) behind a Feature Preview

2 participants