Repository navigation
fix(workflows): keep a run's chat title and folder on rerun - #37023
Conversation
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.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One-line mechanism fix: What this change shipsInventory (3 items) — 3 justifiedIntent: 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).
[FIRST-PRINCIPLES-REVIEWED] e2c2110 Description read[DESCRIPTION-READ] 951f1590a5edfe1d834022d7f7412e5836c25e65a042ac349bcb01e5cff9cca1 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
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 ownworkflow-<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.pystill describes only the time and budget limits. - Open PRs #29594 and #27663 edit the same
run_backgroundcall, so whichever lands second may need a small rebase.
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
titleandfolderstores both on its handle.rerun_subtreepassed the prior run's name, args and budget torun_backgroundbut not those two, so the rerun's result went to an untitledWorkflow: <name> (rerun@0)chat filed in no folder: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
What changed (motivation → approach → change)
rerun_subtreedid not forward two fields the handle already stores.src/kiro_crew/workflows/service.py(rerun_subtree): therun_backgroundcall passesfallback_title=prior.fallback_titleandfallback_folder_id=prior.fallback_folder_id. The other three launch routes already pass them from their own arguments.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).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.startandrerun_subtreewith 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_subtreewas the only caller ofrun_backgroundthat did not forward themSibling: src/kiro_crew/workflows/service.py (
start,start_from_intent,start_definition) -- not affected -- each already passes its own argumentsSibling: 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.