Repository navigation
feat(session-environments): copy a remote session's skills into its workspace - #34302
kyleseaman wants to merge 2 commits into
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: remote sessions only run on KAS ( Notes
[DESIGN-REVIEWED] 32dd0c8 Description read[DESCRIPTION-READ] c2cf2418577087e9e69d1147348d7a37cda62bff4b5cbda709d6857f484d158f 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 Copying skills into the workspace answers a reported defect (a Coder agent could not run Notes
What this change shipsInventory (10 items) — 8 justifiedIntent: let a remote session's agent run its skills' scripts in the workspace, as it can locally. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 32dd0c8 Description read[DESCRIPTION-READ] ab86184039bc81007fa3bd19524bf058fe94a935df81d7dcb4c8cbf511d9430e That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The four screenshots cover the new Settings switch and the Skills row's copied, off and failed states, and the blind reader read each one correctly. Notes
[UX-REVIEWED] 32dd0c8 Description read[DESCRIPTION-READ] 15fd4d48cd7be33b0ee37ce1cf05e9f1cf3320c64fe63e0e0b4b4c9392c17bee That sha256 names everything this verdict read: the PR description, plus the 7 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 — 🔴 changes requested (blocking)Reviewed BLOCKING: the YAML block-scalar scan in the skill copy gets quadratically slower as a skill's config file grows. One 1 MiB config file in a skill, which can come from a third party, pushes every remote session start past the 90-second copy deadline. The copy then fails, and the worker thread keeps the CPU busy for minutes afterwards. BLOCKING — src/kiro_crew/remote_session/skills_copy.py:387 [BLOCK-MERGE] 32dd0c8 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: |
ef3b140 to
b7d51dd
Compare
b7d51dd to
1edceb6
Compare
1edceb6 to
e18b6e5
Compare
e71e64e to
4875448
Compare
4875448 to
0c57060
Compare
0c57060 to
2da9b8c
Compare
6f5be1b to
85158ca
Compare
85158ca to
3724e96
Compare
The config label scan read only a value on the key's own line, so a YAML block scalar (password: |-), a JSON value after a line break and a TOML triple-quoted string were seen as empty and the password was copied to the remote workspace. Each is now decoded before the existing value check, which keeps its placeholder and empty-value exemptions.
|
Stale-PR cleanup note. I rebased this onto main and fixed the GPT security finding (multiline secret values) in 32dd0c8. Opus now flags a new problem in that same fix: |
Problem / Motivation
Goal: In a remote session, the skills its agent can use are in the workspace too, so
python3 <skill dir>/scripts/x.pyruns there as it does locally.A remote session's agent reads its skills on the gateway (the skills index,
skill_search, KAS's own skill tool), but every command it runs goes to the workspace. A skill'sscripts/,references/and assets never reach that machine: an agent in a Coder session reported it could read thekirocrew-prepare-prinstructions but could not runpreflight.py,push_guard.py,diff_signals.py,local_review.pyorpr_status.py.src/kiro_crew/remote_session/andsrc/kiro_crew/coder/have no skill handling on main.Why it matters
Any skill that ships a script is half-usable in a remote session: the agent follows instructions it cannot carry out, then improvises around the missing script or stops. The PR loop itself is one of these skills.
Not a goal
ghproxy for GitHub API calls from the workspace (a sibling PR).What changed (motivation → approach → change)
At every runtime start of a remote session (new, resumed, workspace or engine restart), before the engine starts, the gateway copies the skills that session's agent may see into its workspace, read-only, and every skill path the agent is shown names that copy.
acp/kas_skill_scope.loaded_skill_files, shared withrefused_skill_copies; a checkout's spec cannot widen it), and only skills whose resolved folder sits strictly inside Crew's own skill folders: the Crew skills dir,~/.kiro/skills, or an app's<app>/skills/<name>. A linked allowed folder is refused. A skill mapped from elsewhere still loads but is not copied, and is named with the reason.pinned_fs). The folder andSKILL.mdidentity judged at selection are what is read; nothing is resolved again. A skill is dropped whole, and named, if it holds host state, a path the sensitive-path fence oris_unsafe_prompt_pathrefuses, a recognisable credential (content or name), or a config file with a labelled password. Left out per file: links, hidden files, nested skills, credential file names, files over 1 MiB; 32 MiB in total.coder ssh), bytes on stdin like the worker files. No new port, no credential. A new guest script,skills_install.py, writes~/.kirocrew-worker/skills/<digest>/<skill key>/and renames it into place. Unchanged sets are reused and shared.[SKILLS]line every turn naming the copy, rewritten paths in the skills index, and askill_searchread that names the skill's folder in the workspace (or says it was not copied).python3version and any copied.pythat will not compile. The[SKILLS]line and the card name an interpreter older than the gateway's and the count of copied scripts that do not compile there.python3when older, and, as an error notice with the agent hand-off, how many copied scripts do not compile on it). Settings > Session Environments gets Copy skills to the workspace (session_environments.copy_skills, default on). Off, nothing is copied and the agent is told.Session Environments stay behind
KIROCREW_DEV_MODE.Where:
remote_session/skills_copy.pyandskills_install.py(new); the scope read inagent_sdk/kas_skill_view.py(new, listed in the admission-path ratchet as a non-start reader) and the shared classifier inacp/kas_skill_scope.py(KAS start behaviour unchanged; a parity test runs both callers over one fixture set); the start hook inproviders/acp_runtime_start.py; context incontext_assembly/inclusion.py,session_start.pyandturn.py; the read route indashboard/handlers/prompts_skill_catalog.pyandmcp_tools/skills.py; the card's data indashboard/handlers/session_environments.py; the key inconfig/sections_session.py,config/session_environments.py,dashboard/handlers/core_config_*.py,change_card_catalog_kinds.py(on widens) and the regeneratedconfig-baseline.jsonandsrc/kiro_crew/docsregistries; UI inwebsite/src/components/EnvironmentHealthCard.tsx,website/src/pages/settings/SessionEnvironmentsCard.tsx,website/src/api/client.ts, strings in allwebsite/src/i18ncatalogs, tests inwebsite/src/test.Backwards compatibility
Compatible:
copy_skillsis a new optional key that defaults on; sessions without a remote workspace are unchanged.Removes nothing: the diff adds a config key, a guest file, context lines and a UI row; no key, path or reader is taken away.
Tests
test/test_remote_session_skills_copy.py: the repro (the realkirocrew-prepare-prfolder copied through a guest shell,push_guard.py --helpexits 0 there,pr_statusimports), each refusal (symlink out, a folder swapped for a link mid-walk, hard link out, a FIFO, a credential in a binary file or base64-encoded, a name the guest refuses,SKILL.mdlink, hidden/credential name/credential content, file over the cap, nested skill, total cap, unsafe key, guest path escape, guest size bound, guest reports that do not name this copy), the scope (a mapped agent gets only its skill; a checkout spec of the same name cannot widen it; an inheriting custom agent gets~/.kiro/skills; a crewmate's worker gets its crewmate's merged scope; a whole-catalog agent also gets the KAS tree; a catalog still building is waited for, never taken as complete, and a read taken before it finished is read again), a folder left by a killed install not blocking the next one, ended sessions' records evicted before a live one's, reuse with no transfer, an edited skill (new copy, old one intact), two sessions on one workspace, a workspace that lost its copy, the switch off, a failed copy, an old interpreter (python3.7), the[SKILLS]line, the index rewrite, and theskill_searchread route.config/besideskills/; an appskillslinked out; a linked skills folder; the opened root checked on its descriptor; config files with a password (UTF-16/32, backup suffixes); a credential in a file or folder name; prose and code that only mention a password still copy. On this host's catalog, 111 of 112 skills copy; 1 holds a config password.test_remote_git_governance.py: the start path calls the copy with the session key, the template agent and the launch's shell, and a start cancelled during the copy closes the workspace relay (providers/acp_runtime_start.py).test_session_environment_handlers.py: the health card reports the copy and the switch-off state.copy_skillsvalidation, lenient load, the leaf write, and a whole-section save that omits a hand-edited value keeps it off.-n0, 10 at-n 4 --dist loadgroupbesidetest_remote_session_launch.pyandtest_session_environment_handlers.py, and a shuffled order (seed 26073, 53 passed), all green.Proof: not provable -- other: new feature with no prior behavior to revert to; refusal tests were mutation-checked instead.
Manual verification
Not run against a live Coder workspace; the guest side is exercised end to end through a temporary-HOME shell running the same commands
coder sshwould.Screenshots / video
Related Issues
No issue: tracking issues are opened only on the owner's request.
Checklist
providers.mdSkills in the workspace,config.md)