mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #326] POSIX startup pack is not persisted because the template workspace is deleted before recording completes #86
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MisaKokoro on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/326
Affected component
Snapshot / template builder
AgentENV version
875faeecfbHost environment
Operation and configuration
Steps to reproduce
Build and run AgentENV from upstream commit
875faeecfb.Configure
snapshot.repository_backend = "posix_fs"and enable[snapshot.memory_startup_pack]as shown above.Run:
Wait for the template build to finish successfully and then wait longer
than
record_budget_secs, so the detached recording continuation has hadtime to finish.
Inspect the committed snapshot directory:
Inspect the catalog record:
Observe that
memory-startup.packis absent andcommitted.memory_startupis not populated.Start a sandbox from the template and observe that POSIX memory-ublk
startup prefetch is not performed.
Expected behavior
The detached startup-pack recorder should retain the template build workspace
until recording and repository attachment have completed.
After a successful recording:
<snapshot_store>/snapshots/<snapshot_id>/memory-startup.packshould exist;committed.memory_startup; andSnapshot publication should remain asynchronous and should not wait for the
recording to finish.
Actual behavior
The template snapshot is published successfully, but the detached recorder
loses its temporary output directory before it writes
memory-startup.trace.tmp.As a result:
memory-startup.packis not created;committed.memory_startupis not attached to the catalog record; andThe server reports:
Logs and diagnostics
Reproduction frequency
Always
Regression information
Additional context
The failure is caused by a lifetime mismatch between the template build
workspace and the detached startup-pack recording.
TemplateBuilder::execute_and_publish()stores the build artifacts underTemplateBuildContext.workspace, which owns aTempDir. It starts recordingwith:
The POSIX repository publishes the snapshot synchronously, spawns
finish_posix_startup_manifest()as a detached continuation, and returns thecommitted record.
After
execute_and_publish()returns,TemplateBuildContextis dropped andits
TempDiris removed. The recorder may still be trying to create:The unit
keep_alivedoes not retain the workspace, so the write fails withENOENT and the continuation exits without attaching a startup manifest.
A possible fix is to wrap the template workspace in
Arc<TempDir>and use theexisting
StartupRecording::spawn_with_capture_lease()mechanism. This givesboth the recorder task and repository continuation a workspace lease without
making publication wait for recording.
Pre-submission checklist