Repository navigation
fix(acp): map stored skill-view mode names to their source agent - #15202
Conversation
2ddc62c to
6f99a77
Compare
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (8 items) — 7 justifiedIntent: a chat or crewmate that stored a generated skill-view name starts on the agent it was built from, and the failure messages stop costing the operator their config — a FIX.
[FIRST-PRINCIPLES-REVIEWED] a2fbf25 Description read[DESCRIPTION-READ] 90a06a7555f029fae26106588193e86a992cafdc950a0fe14f60e03cfc3bb501 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The new persisted artifact Watch
[DESIGN-REVIEWED] a2fbf25 Description read[DESCRIPTION-READ] ff827e4ed3dd1dc1ba5be3fa9b4c544d6f0e4106b1650eff68827e5b7f74d5eb 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 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Opus 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: |
6f99a77 to
479f1c3
Compare
Fixed in 479f1c3: verified in code that the boot drain ( |
479f1c3 to
a2fbf25
Compare
Fixed in a2fbf25: verified in code that a sidecar or ledger value reached
Adjudicated as a downgrade, fixed anyway because it is one line: both stores now use |
chenmingwei23
left a comment
There was a problem hiding this comment.
Bulk approve: readiness passed, board green, no outstanding changes requested.
Backport of #15132 (name skill-view aliases without MCP env values, keep the source path in the name) and #15125 (set_mode never sends an alias kiro-cli has not loaded: the fresh alias, a forced rescan and a 3 s retry, then the authored agent only while its grants are unchanged since spawn) to release/0.8.0, squashed to keep the backport within two commits. #15202's view-source map is not on this branch, so only #15125's own lines were kept where its commit touches that code. (cherry picked from commit 96888ff) (cherry picked from commit 689291f) Co-authored-by: buluoray <38930179+buluoray@users.noreply.github.com>
Backport of #15132 (name skill-view aliases without MCP env values, keep the source path in the name) and #15125 (set_mode never sends an alias kiro-cli has not loaded: the fresh alias, a forced rescan and a 3 s retry, then the authored agent only while its grants are unchanged since spawn) to release/0.8.0, squashed to keep the backport within two commits. #15202's view-source map is not on this branch, so only #15125's own lines were kept where its commit touches that code. (cherry picked from commit 96888ff) (cherry picked from commit 30840bb) Co-authored-by: buluoray <38930179+buluoray@users.noreply.github.com>
Backport of #15132 (name skill-view aliases without MCP env values, keep the source path in the name) and #15125 (set_mode never sends an alias kiro-cli has not loaded: the fresh alias, a forced rescan and a 3 s retry, then the authored agent only while its grants are unchanged since spawn, with every non-volatile MCP env value in the alias name) to release/0.8.0, squashed to keep the backport within two commits. #15202's view-source map and #15278's AcpFrameTooLarge are not on this branch, so only #15125's own lines were kept where its commit touches that code, and its agent-name admission uses this branch's registered-name grammar directly. (cherry picked from commit 96888ff) (cherry picked from commit 5434873) Co-authored-by: buluoray <38930179+buluoray@users.noreply.github.com>
Backport of #15132 (name skill-view aliases without MCP env values, keep the source path in the name) and #15125 (set_mode never sends an alias kiro-cli has not loaded: the fresh alias, a forced rescan and a 3 s retry, then a clear start failure rather than any older copy, with every non-volatile MCP env value in the alias name) to release/0.8.0, squashed to keep the backport within two commits. #15202's view-source map and #15278's AcpFrameTooLarge are not on this branch, so only #15125's own lines were kept where its commit touches that code, and its agent-name admission uses this branch's registered-name grammar. (cherry picked from commit 96888ff) (cherry picked from commit 0f54509) Co-authored-by: buluoray <38930179+buluoray@users.noreply.github.com>
…15574) * fix(acp): backport skill-view mode errors and alias naming (#15140, #15132) fix(acp): stop sending skill-view mode errors to setup --clean (#15140) (cherry picked from commit ac0c8bb) fix(acp): name skill-view aliases without mcp env values (#15132) * fix(acp): name skill-view aliases without mcp env values A sandboxed kiro-cli launcher that rewrites a fresh per-write value into every agent file's MCP server env changed each projected view on every spawn, so each spawn named a new kirocrew-skill-view alias per agent and the agents directory grew without bound. The alias digest now hashes the view with each server's env reduced to its sorted key list. A changed env value reuses the alias and publication rewrites the file with the full view; an added or removed env key still names a new alias. Refs #15119 * fix(acp): keep the source path in the skill-view alias name Dropping env values from the alias digest let two agent files that differ only in env values share one alias, so a project agent copied into two workspaces with its own token each could publish one workspace's credential into the alias the other launches. The source spec path is now part of the digest, so each agent file keeps its own alias while env value rewrites still reuse it. (cherry picked from commit 96888ff) * fix(acp): backport skill-view mode-name mapping and settings retry (#15202, #15177) fix(acp): map stored skill-view mode names to their source agent (#15202) Co-authored-by: Joe Guo <zejiangg@amazon.com> (cherry picked from commit 49df1b6) fix(acp): retry the Kiro settings read in the native skill projection (#15177) A transiently refused gated read of a healthy cli.json (a rename-over between open and the descriptor check, or a saturated path resolver) made _settings raise, so a new dashboard chat failed to start. _settings now retries: an immediate re-check, then one resolver-budget pause and a final attempt, off the event loop only. A path that stays refused still raises. Co-authored-by: Joe Guo <zejiangg@amazon.com> (cherry picked from commit 2b91a6b) --------- Co-authored-by: Ray Xu <38930179+buluoray@users.noreply.github.com> Co-authored-by: Joe Guo <zejiang.guo@gmail.com> Co-authored-by: Joe Guo <zejiangg@amazon.com>
Problem / Motivation
Goal: A chat or crewmate that stored a
kirocrew-skill-view-<hash>name starts on the agent that view was built from, and a skill-view miss names that agent and a repair that keeps the operator's config.After upgrading to 0.8, turns fail with
Agent spec 'kirocrew-skill-view-<hash>' is not installed ... repair with kirocrew setup --agent-only --clean, then restart the gateway.Some of these names are stored ones: crewmate rows an older sync generated for alias files (#15103), or a mode a frame reported from an earlier projection. Kiro Crew sends such a name straight tosession/set_mode, but the boot drain (#13502) or a content change has already removed that file, so kiro-cli can only answerMode not found. The message then points at--clean, which skips merging the existing config and drops the operator's own MCP servers and tools.Why it matters
A user on a stored view name gets a failed turn every time, and the one fix the error suggests costs them their MCP config. The message also names a hash instead of the agent, so nobody can tell which agent broke.
Not a goal
set_modenaming an alias the running kiro-cli never loaded). fix(acp): set_mode never activates a stale skill-view alias; fail the start with the remedy instead #15125 fixes that in_activate_mode_bracketed, and this PR keeps out of that function so the two do not conflict.~/.kiro/agents(skill-view aliases not reclaimed on 0.7.0-insider.9 (post #13225): live-source orphans retained, breaks bare kiro-cli /context and Kiro IDE ProfileLoader #13362, [bug] Skill-view agent projections leak into ~/.kiro/agents/ and flood the Kiro IDE picker #13750).--cleanhints (boot install check, prerequisite gate).What changed (motivation → approach → change)
Symptom:
set_modenames a view file that is gone. Cause: nothing maps a stored view name back to an agent before it is sent, and a projection only translates names it minted itself. Change:skill_projection.pyremembers every view name this process publishes, mapped to its agent (bounded, and admitting only a registered agent name, the same check the sidecar and ledger reads apply).source_agent_name()maps a view name back through that memory, then the view's ownership sidecar, then a bounded view ledger (view-sources.jsonin the sidecar directory, newest 2048 entries, the same bound as the in-memory map, rewritten under the publication lock). The ledger is what still answers after a restart, when the boot drain has removed both the alias and its sidecar. A name neither records raisesRetiredSkillViewwith a sentence telling the user to pick the agent again. It never guesses an agent, because the guess could be a broader one.NativeSkillProjection.agent()andframe()apply the in-memory map, so a stale view name is sent as the agent's CURRENT view and is reported back as the agent.AcpRuntimespawn (self._agent),create_session,load_session,AcpSessionHandle.set_mode, andAcpClientspawn (inside its existing executor hop).runtime._format_runtime_rpc_error: the skill-view sentence fix(acp): stop sending skill-view mode errors to setup --clean #15140 added now names the source agent when this process minted the view. The missing real spec hint drops--clean.Backwards compatibility
Compatible: agent names pass through untouched with no file read. Only a name with the
kirocrew-skill-view-prefix changes behaviour, and today every such name that is not the current view fails atset_modeanyway.Tests
test/test_skill_view_mode_recovery.py: the view memory keeps no oversized, newline-bearing or view-named agent; a view resolves after the drain removed its alias and sidecar; the ledger keeps its newest admissible entries and drops malformed ones; a view from an earlier process maps back through its sidecar with the alias file deleted; an unrecorded view is refused, not guessed; an agent name makes no read;set_modewith a stale view (the agent was edited, so a new alias exists) sends the current view and a frame reports the agent; the runtime entry helper,AcpSessionHandle.set_modeand the direct client all map the name; a view miss names the source agent, or 'this agent' when nothing remembers it; a missing real spec suggests setup without--clean.test_agent_spec_preflight.pyandtest_acp_runtime.pyrepair-hint assertions updated.NativeSkillProjection.agent, inAcpSessionHandle.set_mode, and the ledger lookup.Manual verification
N/A. The mapping and message are pure functions of the name, the sidecar and the in-memory map, and unit tests drive every entry path with those inputs.
Related Issues
Refs #13362, #13750. Related #13502, #15103, #1548, #15125, #15140.
Pattern harvest
Not generalizable: the defect is the one place a generated transport name was persisted and later replayed as an agent name.
Checklist