Repository navigation
fix(chat): a fork of a legacy chat keeps the agent its parent ran as - #19973
Conversation
|
note (non-blocking): this fixes a bug (issue #19972), and the fork account cannot add labels. Could a maintainer add the |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One unfixed sibling of the same alias-as-template cause is still open: What this change shipsInventory (6 items) — 6 justifiedIntent: a fork of a chat from before execution identities existed can answer its first message on the agent the parent used. This is a FIX (#19972).
[FIRST-PRINCIPLES-REVIEWED] c3a213f Description read[DESCRIPTION-READ] 79f238a1f5db188f12b5cf2ff9cadcab1b9543f4c86e6e21e0d49f4d63b4e36b That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] c3a213f Description read[DESCRIPTION-READ] 5b22e50a9efb10daa9c924c367696e8732af5c629b435fae1dae3128f6c66239 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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/dashboard/chat_fork.py:113 -- Function-local |
ab166a9 to
ce6d29a
Compare
|
issue (non-blocking): A forked crewmate-alias chat lost the crewmate's workspace and model pin. Upheld and fixed in ce6d29a. For a carrier-less parent whose agent is a
|
ce6d29a to
6955f1e
Compare
|
note (non-blocking): rebased on main as 6955f1e.
question (non-blocking): design review, a legacy alias parent whose recorded store differs from the crewmate's current store. That fork is refused on purpose. The existing recorded-store check already refuses a fork when the parent's stored memory store does not match the resolved one, and this PR keeps that check. The parent chat keeps running; only the fork is refused. issue (blocking): first-principles review, a legacy parent with no recorded store whose crewmate uses V2 memory. Upheld. Before this commit, an empty recorded store skipped the V2 refusal, so the fork was attached to the crewmate's private V2 store. The fork now checks the store returned by |
6955f1e to
482170d
Compare
|
span=9703a2c0dd8b issue (non-blocking): fixed in 482170d.
|
|
span=17e6d76947a7 suggestion (non-blocking): fixed in 482170d.
|
|
span=83b55fcac10a note (non-blocking): fixed in 482170d, by the same change as the duplicate-predicate item.
|
e107901 to
6b4d944
Compare
|
note (non-blocking): rebased on main, no behaviour change. The failures on e107901 in |
6b4d944 to
64438fb
Compare
|
note (non-blocking): rebased on main, no behaviour change. The Windows (7) failure on 6b4d944 was |
|
question (non-blocking): could a maintainer re-run the Automated Rule Check job in run 38780200744 on 64438fb? The fork account cannot re-run jobs. The job hit its 10-minute |
64438fb to
33b8465
Compare
|
note (non-blocking): rebased on main, no behaviour change. This push re-runs Automated Rule Check, which was cancelled on 64438fb after its 10-minute limit while still in |
33b8465 to
2797328
Compare
|
note (non-blocking): rebased on main, no behaviour change. Backend Tests (Windows) (6) on 33b8465 failed |
|
HOLD at 2797328. The fix looks sound. A carrier-less parent now resolves the same way its own turns do: skill-view names map back to their source agent, and a Two things keep it on hold:
To clear: link the spawn.py follow-up issue, and a maintainer reviews the fork identity change. — crew-pr-reviewer (r106) |
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 2797328; no behavior change.
A parent chat with no execution record forked to a template carrier whose template_id was the slot alias, so a fork of a `default` chat asked the backend for an agent called default. The fork now records what the parent resolved to: a config.agents alias on a slot not stamped template becomes that crewmate's member-kind record (template, model pin, store); any other name stays a template under the name as written.
2797328 to
c3a213f
Compare
|
note (non-blocking): rebased on main, no behaviour change. Main had gained 631 commits since 2797328, including 5 that touch |
|
question (non-blocking): could a maintainer approve the workflow runs on c3a213f? CI, Build, Fast Gate, Design Review and the other fork workflows have sat at "action required" since the 20:30Z push, so no test has run on this head yet. The commit is a no-conflict rebase of the approved 2797328 onto main. |
|
HOLD at c3a213f. The fix looks sound. A carrier-less parent now resolves the way its own turns do: a skill-view name maps back to its source agent, a What keeps it on hold:
— crew-pr-reviewer (r113) |
| issue (non-blocking): upheld and fixed in 6cad824. The `_source_of_view` import now sits at module scope in `chat_fork.py`. `session_agent_selection` imports nothing from `kiro_crew.dashboard`, so moving it adds no import cycle. `resolve_member_execution` was already a function-local import in this function before this PR, which only added `_source_of_view`, so I left it where it was. The same commit is rebased on main, which had gained 66 commits including #22150 in `chat_fork.py`, with no conflicts. On the new base, 363 chat fork, session-control fork and dashboard composition-contract tests pass, and flake8 and isort are clean. |
|
note (non-blocking): correction to my 03:16 comment. This PR merged at 03:15:06Z with head c3a213f, before my push of 6cad824 landed, so the |
Problem / Motivation
Goal: A fork of a chat that predates execution identities starts on the agent the parent chat used.
Forking a chat that has no
execution_contextin its transcript header writestemplate_idas the parent's agent alias. For a chat on thedefaultagent the child records{"selection_kind": "template", "template_id": "default"}.defaultis aconfig.agentsrow that binds thekirocrewtemplate, and no kiro-cli agent nameddefaultexists. The child's first turn asks the backend for agentdefaultand fails with "Agent default is not available".Why it matters
Every pinned or long-lived chat created before execution identities existed is a legacy parent. Forking one, or forking a fork of one, is the normal way to branch an old conversation, and the child cannot answer a single message. The user has to open a new chat and loses the copied transcript.
Not a goal
template_id. They need the agent picked again or a new chat.execution_contextis forked. That carrier is copied as is.dashboard/messaging_api/spawn.py:326, which buildsExecutionContext(None, ..., "template", agent or "kirocrew")when no crew is given. It is deferred to a follow-up PR so this one stays on the fork path.What changed (motivation → approach → change)
A forked legacy chat failed on its first turn because the fork wrote the agent alias where the carrier expects a kiro-cli template name.
resolve_session_agent_bindingslaunchesexecution.template_idverbatim, so an alias there is a missing agent._fork_execution_contextindashboard/chat_fork.pynow records the identity the parent's own turns resolve to with no carrier. For aconfig.agentsalias on a slot whoseagent_kindis nottemplate, that is the crewmate, so the child gets the member-kind recordresolve_member_executionbuilds, the same one an owner's create writes. That record carries the crewmate's template, model pin and store.defaultlauncheskirocrew, and a crewmate such asbuilderkeeps itsamzn-buildertemplate and its model pin instead of dropping to a plain template session. A template-stamped slot, or a name that is not an alias (possibly a template only the parent's project declares), stays a template carrier under the name as written, as before. The fork asksresolve_agent_identityfor that alias-or-template call, the same_resolve_agent_selectionrule the parent's own turns use, so the two cannot drift apart. Before that call the fork maps a stored skill-view name back to the agent it was built from with_source_of_view, asresolve_session_agent_bindingsdoes first, so a view built from a crewmate alias forks as that crewmate. The slot'sagent_kindjoins the frozen fork identity tuple, so a parent whose stamp changes mid-fork is refused like any other identity drift. The store check and memory mode are unchanged. The V2 refusal now also checks the crewmate's resolved store: a carrier-less parent with no recorded store used to pass that check on the default store, and would have bound the child to the crewmate's private V2 memory.Backwards compatibility
Compatible: only the legacy-parent branch changes. For an alias parent it replaces a template carrier that could not launch with the member-kind carrier the parent's own turns resolved to. Template-stamped and non-alias parents get the same carrier as before.
Removes nothing. A crewmate parent whose store differs from the slot's recorded store is refused by the existing recorded-store check, where before it got a carrier that could not launch. That parent still runs; only the fork is refused, with the same
store_unavailable503 as any other identity drift. A carrier-less parent of a V2 crewmate is refused the same way.Tests
test_legacy_fork_keeps_the_identity_the_parent_ran_asintest/test_chat_fork_member_memory.pyforks five carrier-less parents. Fordefaultand for abuildercrewmate pinned tosonnet, on blank andmemberstamps, it asserts a member-kind carrier, then resolves the child throughresolve_session_agent_bindingsand checks the template, alias and model pin match the parent's. Atemplate-stampedbuilderand a plain template name stay template carriers under the name as written. On main thedefaultchild recordstemplate_id == "default".test_legacy_fork_of_a_v2_crewmate_alias_is_refusedforks a carrier-less parent of a V2 crewmate with an empty and adefaultrecorded store and asserts a 503 with no child; the empty case fails on the previous head.test_legacy_fork_of_a_skill_view_name_resolves_its_source_agentforks a parent whose stored agent is a skill-view name built frombuilderand asserts thebuildermember carrier; it fails on the previous head with a template carrier under the view name.test/test_session_control_fork.pynow expects the seven-field identity tuple. The related backend set fromscripts/run_scoped_tests.pypasses (1916 tests after the rebase on main), andtest_session_control_fork.pywith the fork tests passes (61). After the skill-view change, 229 fork and retired-agent-name tests pass.Manual verification
The failing session on a live install had header
"agent": "default"and"execution_context": {"selection_kind": "template", "template_id": "default", ...}, forked from a parent with noexecution_context. The new test reproduces that header shape.Related Issues
Fixes #19972
Pattern harvest
Rule candidate: review-prompt
Pattern: an agent alias from
config.agentsstored or passed where a kiro-cli template name is expected, without going throughresolve_agent_identityorresolve_agent_bindings.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)