Skip to content

fix(workflows): keep a run's chat title and folder on rerun - #37023

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/conductor/r254-rerun-fallback-title
Nov 14, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/conductor/r254-rerun-fallback-title

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A rerun of a workflow run keeps the chat title and folder its run was launched with, instead of delivering to an untitled chat filed nowhere.

A run started with a fallback title and folder stores both on its handle. rerun_subtree passed the prior run's name, args and budget to run_background but not those two, so the rerun's result went to an untitled Workflow: <name> (rerun@0) chat filed in no folder:

original: 'Nightly digest' 'fld_123'
rerun   : '' ''

Why it matters

The title and folder exist so many runs of one workflow can be told apart and found (the common case is a webhook-driven run whose ephemeral chat is gone by delivery). A rerun is how a user recovers such a run, and its result then lands in an unnamed chat at the top level of the sidebar.

Not a goal

  • Letting a rerun take a different title or folder: only the launch arguments are kept, as for the run's limits.
  • Changing how the fallback chat is named or filed when the run first starts.

What changed (motivation → approach → change)

  • Cause: rerun_subtree did not forward two fields the handle already stores.
  • Change, src/kiro_crew/workflows/service.py (rerun_subtree): the run_background call passes fallback_title=prior.fallback_title and fallback_folder_id=prior.fallback_folder_id. The other three launch routes already pass them from their own arguments.
  • Spec updated in the same commit (docs/system-specs/modules/workflows.md, beside the fallback title and folder text).

Backwards compatibility

Compatible: a rerun keeping its own original title and folder is the intended behavior. A run launched without them stores empty strings, so its rerun behaves as on main. The stored folder id was resolved when the run started; if that folder has since been deleted, the delivery path already files the slot only when the folder still exists.

Removes nothing: no field, argument or status is removed or tightened.

Tests

  • test_workflow_rerun_keeps_limits.py::test_a_rerun_keeps_the_fallback_chat_title_and_folder: a run started with a title and folder id, rerun from call 0, has the same title and folder on the rerun's handle. Fails on a clean main worktree (both are empty).
  • The workflow service and rerun backend tests pass.

Proof: PROVEN test/test_workflow_rerun_keeps_limits.py::test_a_rerun_keeps_the_fallback_chat_title_and_folder (head e2c2110)

Manual verification

N/A — unit coverage sufficient: the test drives the real WorkflowService.start and rerun_subtree with a stub agent.

Related Issues

Fixes #37022

Sibling sweep

Swept: git grep -n "fallback_title|fallback_folder_id" -- src/kiro_crew/workflows
Sibling: src/kiro_crew/workflows/service.py -- changed here -- rerun_subtree was the only caller of run_background that did not forward them
Sibling: src/kiro_crew/workflows/service.py (start, start_from_intent, start_definition) -- not affected -- each already passes its own arguments
Sibling: src/kiro_crew/workflows/registry.py -- not affected -- the handle already stores and reloads both fields

Pattern harvest

Rule candidate: review-prompt
Pattern: "a rerun path that rebuilds a run from its stored record while a launch option the record already stores is not forwarded"

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.

A run started with a fallback title and folder stores both on its
handle, but rerun_subtree never passed them on. The rerun's result went
to an untitled "Workflow: <name> (rerun@0)" chat filed in no folder.

The rerun now starts with the prior run's fallback title and folder, the
same way it already keeps the prior run's limits.
@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 14, 2026 02:24
@RohanK6
RohanK6 requested a review from mbriones98 November 14, 2026 02:24
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision e2c2110bc804e7b748ed64b0ce0799ff24387449 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the change is a two-field forward of values the handle already stores, it matches the other three launch routes, and it takes nothing away.

[DESIGN-REVIEWED] e2c2110

Description read

[DESCRIPTION-READ] 8b63e548dacf8299ad941ef525d7e117a29e92788e73b0cb583824f203d5b085

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

One-line mechanism fix: rerun_subtree now passes on two fields the handle already stores. Grepping run_background( in src/kiro_crew/workflows/service.py finds 4 calls, and after this change none leaves them out.

What this change ships

Inventory (3 items) — 3 justified

Intent: when a user reruns a workflow run, the result arrives in the same titled, filed chat as the original run. This is a FIX (#37022).

  1. A rerun's fallback chat keeps the original run's title and folder instead of being untitled and filed nowhere — justified
  2. The workflows spec gains a sentence saying a rerun keeps its fallback title and folder — justified
  3. A new test shows the title and folder survive a rerun; per the description it fails on main — justified

[FIRST-PRINCIPLES-REVIEWED] e2c2110

Description read

[DESCRIPTION-READ] 951f1590a5edfe1d834022d7f7412e5836c25e65a042ac349bcb01e5cff9cca1

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] e2c2110

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

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

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e2c2110

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

@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 14, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 14, 2026 04:06

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

Approving. On head e2c2110 we checked that rerun_subtree was the only run_background caller in workflows/service.py that dropped fallback_title and fallback_folder_id. start and start_from_intent already pass them, and so does start_definition through start. We also checked that the rerun's new RunHandle.__post_init__ bounds and redacts both values again, that delivery still checks the folder exists and runs chat_folder_refuses_store, and that the new test drives the real start and rerun_subtree with a bounded wait and goes red if the two kwargs are removed. PR Readiness is green on this head.

What works well: it is the smallest fix at the root cause, and it follows the same pattern as the existing budget_total forwarding.

Optional:

  • In docs/system-specs/modules/workflows.md, the new sentence says the rerun "lands in the same titled, filed slot". The rerun actually gets its own workflow-<run_id> slot with the same title and folder. Rewording it, and moving it after the paragraph that introduces the fallback slot, would make it more accurate.
  • The module docstring of test/test_workflow_rerun_keeps_limits.py still describes only the time and budget limits.
  • Open PRs #29594 and #27663 edit the same run_background call, so whichever lands second may need a small rebase.

@KiroCrewCaptain
KiroCrewCaptain merged commit ad4dc5f into main Nov 14, 2026
96 of 97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/conductor/r254-rerun-fallback-title branch November 14, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow rerun forgets the chat title and folder its run was started with

2 participants