Repository navigation
fix(cron): pin the session title in ScriptContext.open_session - #16867
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check one case: a closed cron session saved with no title now ignores the script's [DESIGN-REVIEWED] 2586584 Description read[DESCRIPTION-READ] e2f187a68fb50b03df951c64f90ea6015537fe5b121bc25b1cad6098b730fbae 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 Check before merge: a closed-session cron reopen whose saved metadata has no title drops the cron's name. The resume rule in What this change shipsInventory (5 items) — 5 justifiedIntent: when a script cron opens a session, the sidebar shows the name the cron chose, and a later reopen does not overwrite a title the user renamed. This is a FIX (#16866).
[FIRST-PRINCIPLES-REVIEWED] 2586584 Description read[DESCRIPTION-READ] 2f660145062d52edc2f49f9c157b2127a5fe89e3dbcd9b69aaea13cb83997ad5 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: |
3f1554a to
cedc314
Compare
|
Fixed in cedc314: a cron reopen now keeps the session's current title, and a test and a spec line pin it. |
cedc314 to
a7adc98
Compare
|
Fixed in a7adc98: reopening a saved cron session now keeps its user-renamed title and title origin, with regression coverage. |
a7adc98 to
a5a3ab4
Compare
|
Fixed in a5a3ab4: a closed-session reopen keeps the normal create path, restores only the saved title and origin, and tests cover both rules. |
a5a3ab4 to
e9a060d
Compare
|
e9a060d to
fd1da4e
Compare
|
Reviewed again at the new head (now based on main), not approving yet (crew-pr-reviewer). Seven checks are red on this head (Automated Rule Check, GPT 6.1 Review, Inclusive Language, Issue Gate, PR Hygiene, SAST, Screenshot Evidence). My earlier approval was on the stacked head. I will re-review once CI is green. |
e653d93 to
775bedb
Compare
Script cron sessions now pin the redacted name as their title when created. Reopening the session keeps its current title so a user rename remains intact.
775bedb to
2586584
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
The cron's chosen name now shows in the sidebar, and a later reopen keeps a title the user renamed. Both are covered by new tests on the live-reopen and closed-reopen paths. The 7 red checks that held my last review are all green on 2586584901. The base is now main, and #16681, the PR this was stacked on, has merged. The creator fence still fails closed: a read error refuses and a blank creator matches nobody. The title restore reuses only the metadata that fence just read, so a cron gets no new reach. One small point is still unanswered from my earlier review and the Design/First Principles lanes: a closed cron session saved without a title reopens under an auto-title, not the cron's name. That is fine as a follow-up, so I'm approving.
Problem / Motivation
Goal: Keep a script cron's chosen session name visible without undoing a later user rename.
A script cron opens a session with a name, but the sidebar later shows an auto-generated title instead. Sending the name again during a reopen can also replace a title that the user renamed.
Why it matters
The session name identifies the scheduled work. Replacing that name makes script-opened sessions harder to recognize, while replacing a user rename removes the user's chosen label.
Not a goal
What changed (motivation → approach → change)
ScriptContext.open_sessionsent the chosen value only asname, which the slot creation handler uses for key derivation. The request already supports a separatetitlefield for the visible label. The method now sends a non-empty redacted value as both fields. The gateway applies that title when a script cron creates the session. A live reopen keeps its current title. A closed-session reopen restores only the saved title and its origin. A restored automatic title rebases its refresh budget against the new live window. All other fields follow the current create path, including a new creation time. The full history-resume path is not used because it requires the transcript rows and owns a separate rollback lifecycle. Existing title behavior for other clients remains unchanged. The specification and gateway tests pin these rules.Backwards compatibility
Compatible: existing callers still receive the same slot key and return value. Existing title updates from other clients keep their current behavior.
The creator-refusal wrapper is removed. Each reader uses the surviving admission result directly.
Reader: src/kiro_crew/dashboard/chat_handlers.py:api_chat -- chat -- reads
cron_creator_admission(...).refusaldirectly.Reader: src/kiro_crew/dashboard/chat_handlers.py:api_chat_slot_create -- chat -- reads the admission refusal and saved-title metadata directly.
Reader: test/test_chat_routes_cron_switch.py:TestCronCreatorAdmission -- chat -- tests the admission refusal directly.
Reader: docs/system-specs/modules/session-control.md:script-cron-chat-routes -- cron -- names the surviving admission helper.
Tests
Manual verification
N/A: focused unit coverage exercises session creation and reopen behavior through the gateway handler.
Screenshots / video
N/A: no frontend component changed.
Related Issues
Closes #16866
Stacked on #16681.
Pattern harvest
Rule candidate: review-prompt
Pattern: A create-or-reopen endpoint must apply creation-only display metadata only when it creates a resource.
Checklist
Contribution License Agreement