[5283] fix(agent): Keep Pi skill paths stable on cold resume - #5295
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Local skill-path QA is complete. Pi actually read the inline skill from |
c90a588 to
eb0c39a
Compare
03cdd42 to
0746a92
Compare
eb0c39a to
e0593b4
Compare
0746a92 to
14b09da
Compare
|
🤖 The AI agent says:\n\nFinal verification of the stacked skill-workspace PR:\n\n- Head: 14b09da\n- Base: fix/pi-transcript-persistence at e0593b4\n- The upper delta is exactly the intended seven-file skill-workspace change.\n- The final upper tree is byte-identical to the tree already exercised in live local QA.\n- Live QA confirmed that Pi reads skills from agents/skills/, unchanged skills reuse the digest, changed skills create a new digest without removing the old snapshot, and a real cold container recreation can load the persisted native transcript.\n- GitHub CI is fully green, including runner unit, integration, and acceptance tests, plus API, SDK, services, web, contribution checks, CLA, and Vercel.\n- This PR does not alter replay, warm/cold selection, token use, or prompt-cache behavior. |
Context
Configured Pi skills currently live under a random per-run agent directory. Teardown deletes that directory, so a cold resume can contain references to skill files that no longer exist.
This PR is stacked on #5292. The lower PR persists Pi transcripts. This PR gives configured skills a stable session-workspace path without changing replay, continuation, token, cache, or Claude behavior.
Changes
Pi now receives one content-addressed skill snapshot at:
The runner computes the digest from skill names, file paths, modes, and contents. It publishes through a unique temporary directory, writes a completion marker last, and reuses only a matching complete snapshot. Existing or older snapshots are never reconciled, replaced, or deleted during acquisition.
The
pi-acppatch passes the exact snapshot to Pi with--no-skills --skill <path>. Only the current snapshot is advertised, while old paths remain readable by a cold-resumed transcript. The runner no longer copies configured skills into the temporary local or Daytona Pi agent directory.This deliberately accepts append-only storage growth until the session workspace is removed. Snapshot immutability is a runner convention because the cwd remains agent-writable.
Live local QA
Verified on the EE deployment at port 8280 against the actual service-targeted subscription sidecar. The live installed
pi-acpwas checked forPI_CODING_AGENT_SKILL_DIRbefore the run.continuity-probeskill. Pi calledreadon<cwd>/agents/skills/4d2431.../continuity-probe/SKILL.md, then returnedSKILL-COLD-7Q42-OK..agenta-skill-set.jsonmarker, and the skill file under that digest./tmp. Once the existing 120-second owner lease expired, the session loaded natively and returnedSKILL-COLD-7Q42-OK PI-COLD-MEM-9Q7Rwithout receiving the earlier message again.session/load ... loaded=true, and recalled the same private marker.The first immediate post-restart retry was rejected by the existing local-runner ownership guard. That is expected affinity behavior and is not caused by this PR. A stable
AGENTA_RUNNER_REPLICA_IDavoids the lease wait in orchestrated restarts.Tests
pnpm exec vitest run --project unit tests/unit/sandbox-agent-pi-assets.test.ts tests/unit/sandbox-agent-orchestration.test.ts: 65 passed.pnpm run typecheck: passed.pnpm test: 69 files and 1,066 tests passed.How to review
pi-assets.tsfor digesting, atomic publication, marker validation, and fail-closed behavior.workspace.tsandsandbox_agent.tsfor local and Daytona ordering.pi-acppatch for the narrow explicit-skill argument.Depends on #5292. Closes #5283.