[5283] fix(agent): Persist Pi transcripts in session workspaces - #5292
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 cold-resume QA is complete. The Pi JSONL was present under |
c90a588 to
eb0c39a
Compare
eb0c39a to
e0593b4
Compare
|
🤖 The AI agent says:\n\nFinal verification after rebasing onto the current big-agents base:\n\n- Head: e0593b4\n- The lower PR now contains only transcript-persistence code and its lower-level tests; the stacked skill-workspace imports and assertions were removed from this lane.\n- I exported the exact lower commit tree into an isolated directory and ran the runner typecheck plus the complete runner suite: 69 files, 1,059 tests passed.\n- GitHub CI is fully green, including runner unit, integration, and acceptance tests, plus API, SDK, services, web, contribution checks, and Vercel.\n- The initial unrelated SDK catalog failure was rerun and passed without any SDK changes.\n- This PR does not change replay, warm/cold selection, token use, or prompt-cache behavior. It only keeps Pi transcripts in the session workspace so they survive cold sandbox replacement. |
…a-* markers) from the Files UI Pi now persists its native transcripts into the durable session cwd at agents/sessions/pi/ (#5292), and the runner writes dot-markers there (.agenta-skill-set.json, .agenta-usage.json, .agenta-pi). Our drive listing recurses the whole cwd tree, so these internal files were about to surface in the Files / context rail / config Files UI as noise. Add isInternalDrivePath and exclude those paths in driveFiles (flat lists, counts, sizes, recents) and buildDriveTree (tree view). The agent's own agent-files/ folder is intentional and not matched (no dot, not under agents/).
Context
Pi stored native transcripts below its agent directory. Local runs create a temporary agent directory whenever they carry skills or a system prompt, then delete that directory at teardown. The next cold continuation could therefore point at a transcript path that no longer existed.
This is the lower PR in the launch stack. It fixes transcript persistence only. #5295 stacks the stable skill path on top.
Changes
Pi now writes native transcripts to
<cwd>/agents/sessions/pi, inside the existing durable conversation workspace. The runner creates that directory before starting Pi on local and Daytona runs.Pi already honors
PI_CODING_AGENT_SESSION_DIR. The pinnedpi-acp@0.0.29did not consult that variable when rebuilding its session index, so this PR carries a narrow package patch that makes its scan use the same directory.Before:
After:
This PR does not change warm or cold decisions,
session/load, replay selection, continuity IDs, token usage, prompt caching, or Claude behavior. Healthy Pi resumes continue to use native history exactly as before.Live local QA
Verified on the EE deployment at port 8280 against the actual service-targeted subscription sidecar and
pi_corewithopenai-codex/gpt-5.4-mini.<cwd>/agents/sessions/piand stored the private markerPI-COLD-MEM-9Q7R./tmpworkspace.hydrated ... turn=0andsession/load ... loaded=true, then recalled the marker.session/load ... loaded=true, and recalled the marker again.The ownership retry is existing local-runner affinity behavior, not introduced by this PR. A stable
AGENTA_RUNNER_REPLICA_IDavoids that delay across normal orchestrated restarts.Tests
pnpm exec vitest run --project unit tests/unit/sandbox-agent-pi-assets.test.ts tests/unit/sandbox-agent-orchestration.test.ts: 60 passed.pnpm run typecheck: passed.How to review
pi-assets.tsfor the single session-directory contract.sandbox_agent.tsfor local and Daytona directory creation before Pi starts.pi-acppatch. It only adds environment-variable precedence to the existing scan-directory resolver.Part of #5283. The upper #5295 completes the issue.