Repository navigation
REPL resume: put cwd and environment reset first in the restore summary #4267
ckw-123
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What happened
This came from
openai-codex/gpt-6.2-solactually operating Prime Agent during a long Windows benchmark and GitHub review. Reported with the operator’s approval. The model is the workflow operator here, not a prerequisite for this behavior. Private transcript, credentials, paths, and IDs are omitted.A resumed Prime Agent
0.10.6-beta.39session revived Python values, but not the process environment or the working-directory changes. The actual restore notice listed many recovered names and then said: “The working directory and environment variables were reset to the session defaults.” The REPL and the next shell commands were running against those defaults, as documented by the notice. The problem is not that this reset occurred; it is that the operational boundary is easy to miss at the end of a long list.What to change
Put a short summary first:
Kernel restarted · N restored values · M restore failures · cwd and environment reset. Keep the existing variable details expandable or in a second section. Give a short recovery hint when values were skipped or could not be restored; don't suggest repeating an already completed external action. Optionally expose those same facts as structured fields so the UI and automation can use them without scraping prose. Do not auto-restore credentials, environment values, or arbitrary live process handles. Persistent shells on supported platforms have their own reattachment behavior.Current restore-notice code already has the information for the prose: restored names, failed names, and cwd/environment reset. The structured details currently only carry the boolean
restored. This can be a narrower presentation change, not a new checkpoint system.Acceptance without live model requests
Related but different: #3781 concerns background completion/handle survival. This request is about making the existing restore boundary clear, not changing job durability.
Follow-up: keep completed evidence outside the kernel namespace
A restore summary tells the operator what came back; it does not make a Python variable a durable result or make a missing handle safe to rerun. For long/evidence-producing work, document an opt-in handoff: save the finished output or a small manifest in a known workspace/session artifact location, then report its path and what was actually verified. For example, store run name, completion state, source coverage, and the artifact location (optionally a checksum where integrity matters). After resume, read the artifact back and distinguish
present and checked,present but unverified, andmissing. A missing artifact does not prove that an external write or command did not happen; check before replaying side effects.As a small offline check, we wrote a synthetic JSON result and reopened it in a fresh Python process, verifying its checksum and content. That verifies the artifact workflow, not an automatic checkpoint/restore change. Keep this a documented pattern or optional helper, not a requirement to save every variable, record credentials, or restore process state. Job reattachment/completion replay remains separate work in #3781.
Related: #4270 — distinguish loaded data from inspected evidence.
All reactions