Skip to content

feat(workflows): Kiro Workflows frontend data layer - #25466

Open
kyleseaman wants to merge 2 commits into
feat/kas-wf-3-person-holdsfrom
feat/kas-wf-4-frontend
Open

kyleseaman wants to merge 2 commits into
feat/kas-wf-3-person-holdsfrom
feat/kas-wf-4-frontend

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Off by default behind agent.kas_workflows (Developer › Feature Previews); with it off, behaviour is main's.

Problem / Motivation

Goal: When Crew's agent backend is Kiro Agent (KAS), a developer can turn on Kiro Workflows and launch, watch, answer and control KAS workflow runs from the dashboard, with every question or approval a run raises held for a person.

Why it matters

Kiro Agent is the default harness and ships its own workflow engine (recipes, multi-step runs, steps that park for input), but Crew drops the whole _kiro/workflow/* surface: a KAS chat cannot start a workflow, nobody sees a run's steps, and a step that asks a question stalls with no sign anywhere. A run left to channel auto-answer paths could have a person's answer given on their behalf.

Not a goal

  • Turning Kiro Workflows on by default. It stays a developer opt-in (agent.kas_workflows); with it off, Crew behaves exactly as main.
  • Replacing Crew's own workflows (workflow_run, saved Crew workflows). They keep running.
  • Workflows on other harnesses. KAS is the only engine that has them.
  • The session-message cards: they are their own PR (A in the stack).

What changed (motivation → approach → change)

The client side of the routes, with no UI yet: the API client for /api/workflows/kas/* (api/client/workflows.ts, api/client/chat.ts, api/client.ts), the run model each surface reads (apps/workflows/kas/kasModel.ts: step tally, controls, waits, loop iterations, needs-you), the query and recipe hooks, the launch helper that opens a chat and starts a run in it, the rewind guard, and the shared test fixtures (test/kasFixtures.ts). The catalogs (i18n/locales/en.manual.json, its translations and i18n/en.context.json) gain the strings the model itself formats, in every locale.

Stack

Split out of #25395, which was over the 1 MB review cap. Merge bottom-up. Only a PR based on main gets CI (ci.yml and fast-gate.yml run on pull_request: branches: [main]), so each stacked PR is rebased onto main once the one below it merges. A and the B1a protocol PR do not depend on each other. C2's UI uses A's card, which is on main.

# PR Branch Base
1 #25470 (merged) feat/kas-wf-1-session-cards main
2 #25447 (merged) feat/kas-wf-2-backend main
3 #25449 feat/kas-wf-2b-engine main
4 #25450 feat/kas-wf-2c-dashboard feat/kas-wf-2b-engine
5 #25459 feat/kas-wf-3-person-holds feat/kas-wf-2c-dashboard
6 #25466 (this PR) feat/kas-wf-4-frontend feat/kas-wf-3-person-holds
7 #25471 feat/kas-wf-4b-frontend-ui feat/kas-wf-4-frontend

Backwards compatibility

Compatible: nothing renders this yet; every hook is enabled only while the switch is on.

Removes nothing: only additions.

Tests

  • kasModel.test.ts, kasRound4.model.test.ts, launchKasWorkflow.test.ts, kasSidebar.test.ts, ApiClient.refactor.surface.test.ts.
  • kasModel.test.ts › "a step note is Kiro Agent's own send_message only": only the bare send_message Kiro Agent records is a step note; Crew's @kirocrew-core/send_message and other prefixed names stay tool rows, and a later Crew notification does not replace a parked step's question. The prefixed cases fail on the first commit's regex.
  • kasRewindGuard.test.ts: the edit is blocked while a run started at or after the message is live (paused included), allowed with a note once every such run ended, unaffected by earlier runs and other chats, and blocked when a run's or the message's time cannot be read.
  • Local gates on this head: tsc, eslint, vitest related, i18n tests with I18N_BASE_REF, i18n:check, theme colors, build.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

N/A — no surface draws this yet.

Screenshots / video

Why no screenshot: this PR adds data-layer modules and catalog strings that no component renders yet.

Related Issues

N/A — no tracking issue, by the owner's choice.

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 28, 2026 22:46
@kyleseaman
kyleseaman requested review from bolichen97 and removed request for a team October 28, 2026 22:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check. This PR adds the API client, the run model, hooks and catalog strings, and no .tsx file in website/src imports any of them yet, so nothing new appears on screen.

Notes

[UX-REVIEWED] 4d6b99b

Description read

[DESCRIPTION-READ] 474eb086d648e8c92f14754d9ca79b8ad082f1354c6a6de12e22b9d230da443c

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the change adds only client-side data-layer code behind agent.kas_workflows, nothing renders it yet, and it takes nothing away.

Notes

  • The description says the change touches api/client/chat.ts, but the diff doesn't include that file. Either drop it from "What changed" or say which stacked PR carries it.

[DESIGN-REVIEWED] 4d6b99b

Description read

[DESCRIPTION-READ] a8d4b2ce7824effdb33a3b3eebc992651b57c3e85ab86f142c6af8dd1c49db52

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 4d6b99beaee62394f9ab6feaddf18a65787f7cf7 — 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 feature is off by default behind agent.kas_workflows, every module is an internal frontend module that can be deleted, and the backend routes it calls already exist on base.

Notes

  • Item 1–6 — zero consumers: no non-test file on this head imports useKasLaunch, useKasSelection, kasRewindGuard, useKasRecipesList or useKasRecipeMutations (0 hits outside their own files). The only consumer is the stacked feat(workflows): Kiro Workflows dashboard UI #25471, so merge this only together with feat(workflows): Kiro Workflows dashboard UI #25471 or just before it.
  • Item 7 — undeclared: the description lists api/client/chat.ts, but the diff never touches that file. Subtraction: delete api/client/chat.ts from the "What changed" list.

What this change ships

Inventory (9 items) — 7 justified

Intent: let a developer who has opted in launch, watch, answer and control Kiro Agent workflow runs from the dashboard. ADDITION.

  1. API client for /api/workflows/kas/* (runs, recipes, recipe detail, create/delete) — zero consumers
  2. Run model: step tally, controls, waits, loop iterations, needs-you — justified
  3. Query and recipe hooks that follow the recipes_changed revision live — justified
  4. Launch helper: Workflows folder, then a "Workflow: " chat, then the run, with rollback — justified
  5. Rewind guard that disables edit-and-resend while a run is live — justified
  6. In-memory per-chat run/step selection store (kasSelection.ts) — undeclared
  7. wireNames.ts with its own eslint literal-string exemption — undeclared
  8. Catalog strings in every locale, plus plural keys — justified
  9. Shared KAS test fixtures — justified

[FIRST-PRINCIPLES-REVIEWED] 4d6b99b

Description read

[DESCRIPTION-READ] 19e8f184f061e24c560cee2a44f82835293a63a92e43b69daffa1e1135e26b2b

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 4d6b99b

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

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

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4d6b99b

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

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

Reviewed at 74cce3b.

This reads well as a data layer. I checked every client method against the routes registered on the base branch, and the request field names against their handlers: they match. Every hook stays inert unless the engine probe answers kas, and the run model maps server-decided controls and actions instead of deciding them itself, which keeps the UI from offering an action the engine would refuse. The launch helper's rollback on a refused launch is tested.

One non-blocking finding inline: the transcript fold treats any tool whose name ends in send_message after a separator as Kiro Agent's step note, which also matches Crew's own namespaced send_message tool.

Not merge-ready yet for process reasons only: the base is a stacked branch, not main, and PR Readiness is still pending at this head. I will look again once it is rebased onto main.


/** A step turn's `send_message` is Kiro Agent's step-completion signal AND the
* step's note to the run's parent chat; the step pane draws it as its own card. */
const PARENT_MESSAGE_RE = /(^|[._/@])send_message$/i

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.

A step calling Crew's own send_message tool is drawn as the step's note to its parent

PARENT_MESSAGE_RE accepts any separator before send_message, so a step tool named @kirocrew-core/send_message (or any other namespaced send_message) matches. foldReplies then renders it as a parent card, and lastStepNote can pick its text as the question a parked step asked. The backend already avoids this collision on purpose (kas_workflows/chat.py leaves send_message out of the chat tools because Crew's tool of that name means a dashboard notification), and servedByMcp in this same file exists for the same reason, but this regex does not use either guard.

const PARENT_MESSAGE_RE = /(^|[._/@])send_message$/i

Suggestion: match only the name Kiro Agent itself reports for its native tool (anchor on the exact name, or exclude names carrying an MCP server prefix), and add a case to kasModel.test.ts for isParentMessageTool / parseParentMessage with both a native and a namespaced name. Neither function has a test in this PR.

Rule: a display decision keyed on a tool name must not match a different tool that shares the suffix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d9bfbb0. PARENT_MESSAGE_RE is now /^send_message$/: only the bare name Kiro Agent records for its own tool counts, so @kirocrew-core/send_message, mcp_kirocrew_core_send_message and any other prefixed send_message stay ordinary tool rows. kasModel.test.ts adds cases for isParentMessageTool, lastStepNote and foldReplies with the native name and four namespaced ones, plus a parked step whose question must not be replaced by a later Crew notification; the namespaced cases fail on the old regex.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The stack was rebased onto the current #25447 head, so the same fix is now commit 2222142 (the regex and tests are unchanged).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After a further restack onto the current #25447 head, the fix is commit 62da769 (regex and tests unchanged).

@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 28, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Hold: this PR is based on the stacked branch feat/kas-wf-3-person-holds, not main. Reviewed head 74cce3b.

What would clear it:

  • Rebase onto main once feat(workflows): hold Kiro Agent plan handoffs for a person on every channel #25459 and the PRs below it merge, so the main-only CI (ci.yml, fast-gate.yml) runs on this code. Only 23 check runs exist on this head today.
  • Fix or answer the open inline finding from bolichen97: PARENT_MESSAGE_RE (kasModel.ts L929) also matches Crew's own namespaced @kirocrew-core/send_message, so a step calling it would be drawn as the step's note to its parent and could be shown as the parked step's question. Anchoring on Kiro Agent's native tool name (or excluding MCP-served calls, as servedByMcp in the same file does) plus a test for both names would close it.

The rest reads well so far: the launch helper rolls back the chat on a refused launch, the rewind guard treats unknown timestamps as blocking, and the approveChatSlot change is a TypeScript-only widening. The AI lanes' notes (model file size, unused kasSelection.ts, strings the UI PR must check) do not block a data-layer PR. A new review will be needed on the rebased head.

— crew-pr-reviewer (r134)

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

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Requesting changes at 74cce3b3e6.

  1. The send_message match also catches Kiro Crew's own notification tool. kasModel.ts:929 (PARENT_MESSAGE_RE = /(^|[._/@])send_message$/i), which matches @kirocrew-core/send_message and mcp_kirocrew_core_send_message. A Crew notification call would then be drawn as the step's note to its parent, or as a parked step's question. bolichen97's inline comment on this is unanswered. Narrowing the pattern to the bare KAS tool name breaks no test, so please also add a test that a Crew send_message call is not taken as a step note.
  2. The base is feat/kas-wf-3-person-holds, not main. Only 23 checks ran and the main CI never ran on this code; it needs a run against main before merge. The stack also fails the line cap on kas_workflows/router.py (2,829 lines), which comes from #25449 and will block every PR in it.

Notes: opt-in and off by default, so default users see no change. Nothing in this PR uses the new modules yet; they are imported by #25471, so this should not merge without it. kasRewindGuard.ts is untested (letting unknown timestamps through breaks nothing). 241 vitest pass; i18n-check passes for all 13 locales.

@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 Oct 29, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from af54535 to 9cb242b Compare November 2, 2026 16:32
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from 74cce3b to d9bfbb0 Compare November 2, 2026 16:40
@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 Nov 2, 2026

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

Comment only. This PR is stacked on feat/kas-wf-3-person-holds, not main, and @buluoray's change request is still open, so I am not approving.

Checked at d9bfbb0:

  • RC point 1 (send_message match): addressed. kasModel.ts:932 is now PARENT_MESSAGE_RE = /^send_message$/, so only Kiro Agent's bare tool name counts as a step note. kasModel.test.ts:338 checks that @kirocrew-core/send_message, mcp_kirocrew_core_send_message, kirocrew-core.send_message and other_send_message stay ordinary tool rows. Line 348 covers a mixed list.
  • RC point 2 (non-main base): still open. The base is feat/kas-wf-3-person-holds, so this head has no main CI run. The gate shows 9 cancelled lanes (Automated Rule Check, GPT 6.1 Review, Issue Gate, Screenshot Evidence, Sensitive Change Review ×2, Inclusive Language, SAST, PR Hygiene) plus one AWS CodeBuild failure. None of them gives a code finding. They need a clean run once the stack lands on main or this PR is retargeted.

Once the base is main and CI is green, @buluoray can re-check point 1 and clear the request.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 2, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

@iamwhatever @buluoray restacked onto #25449's new head; the launch fix and the send_message fix are now in commit 910d46a (unchanged). The data-layer commit also drops the approveChatSlot type widening: the chat's own question card it served is gone, since those questions now use main's elicitation card.

@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 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 45f6b67 to a9dd6c0 Compare November 6, 2026 18:44
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from 910d46a to af6a434 Compare November 6, 2026 18:46
@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 Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from a9dd6c0 to 0ef14fe Compare November 6, 2026 19:07
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from af6a434 to 0607a89 Compare November 6, 2026 19:08
@kyleseaman

Copy link
Copy Markdown
Contributor Author

@iamwhatever @buluoray restacked onto #25449's head 49e0654; the launch fix and the send_message fix are now in commit 0607a89 (unchanged). The data-layer commit also drops useKasCreatorEffort, since #25449 removes agent.kas_creator_effort.

@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 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 0607a89.

What blocks:

My r141 defect is fixed: launchKasWorkflow rethrows AcceptedBodyUnreadable before discarding the chat, and a test covers it (launchKasWorkflow.ts#L105-L114). The rewind guard fails closed on unreadable timestamps.

The AI lanes' notes do not block a data-layer PR behind an opt-in: the stray api/client/chat.ts mention in What changed, unused exports until #25471, the empty chat left if a tab closes mid-launch, and the copy checks for #25471. Please drop the chat.ts mention on the rebase. A rebased head needs a fresh review.

— crew-pr-reviewer (r149)

@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 0ef14fe to 9b882db Compare November 12, 2026 06:38
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from 0607a89 to 57c934b Compare November 12, 2026 06:40
@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: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 12, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 9b882db to a94e626 Compare November 12, 2026 07:43
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from 57c934b to 4d6b99b Compare November 12, 2026 07:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 12, 2026
Kyle Seaman and others added 2 commits November 12, 2026 07:45
The dashboard's client side of the Kiro Workflows routes, with no UI yet:
the API client methods for /api/workflows/kas/* (api/client/workflows.ts),
the run model that turns run rows into what each surface draws (step
tally, controls, waits, loop iterations, needs-you), the query hooks and
recipe hooks, the launch helper that opens a chat and starts a run in
it, the rewind guard, and the shared test fixtures. Ships the catalog
strings the model itself formats, in every locale.
…s own send_message as a step note

- launchKasWorkflow no longer discards the chat when the launch answers 2xx
  but its body cannot be read (AcceptedBodyUnreadable from jAccepted): the
  server accepted the run, and deleting the chat would cancel it. The error
  is passed on, as appSendWire.ts does. A refused launch still removes the
  empty chat. Covers the launch form, the /workflow-run command and every
  other caller, which all go through launchKasWorkflow.
- PARENT_MESSAGE_RE matches only the bare send_message name, so Crew's own
  namespaced send_message tool stays an ordinary tool row.
- Test the rewind guard.
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from a94e626 to 3abb813 Compare November 12, 2026 08:08
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-4-frontend branch from 4d6b99b to a3df4ae Compare November 12, 2026 08:09
@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 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants