fix(runner): steered sessions keep their workspace mount (pre-existing) - #5764
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:
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 |
d75f18b to
00e5676
Compare
4f2bab2 to
9c35216
Compare
|
@coderabbitai review |
|
00e5676 to
9ef9f89
Compare
9c35216 to
7b34b97
Compare
9ef9f89 to
4c14e5b
Compare
7b34b97 to
f86d545
Compare
4c14e5b to
1544505
Compare
f86d545 to
5dce002
Compare
Railway Preview Environment
|
1544505 to
efe200e
Compare
5dce002 to
fddcfe3
Compare
efe200e to
fcdfb61
Compare
fddcfe3 to
cb05287
Compare
fcdfb61 to
d9d6f52
Compare
cb05287 to
4db68c4
Compare
0433b89 to
33936a4
Compare
803ae6d to
e44019a
Compare
33936a4 to
05731be
Compare
e44019a to
c19ceaf
Compare
05731be to
9d9e45e
Compare
c19ceaf to
d7dac02
Compare
9d9e45e to
a328742
Compare
d7dac02 to
1d88425
Compare
a328742 to
1546c09
Compare
1d88425 to
ae7c8c3
Compare
1546c09 to
3c66e23
Compare
ae7c8c3 to
edc00ec
Compare
3c66e23 to
ca2d1ec
Compare
edc00ec to
7b33b41
Compare
ca2d1ec to
5c6d5e6
Compare
7b33b41 to
8df7d62
Compare
5c6d5e6 to
e8c48d8
Compare
…robes the mount (pre-existing steer mount loss)
Context
A steered session died on its next turn. Start a long turn, send a second message mid-flight (the steer path), and the third turn on that session failed with
Internal error: Path /tmp/agenta/mounts/<id> does not exist. The session stayed broken until its pool entry aged out.This bug predates the agent-config-editing stack: the identical repro fails against a
git archiveextraction of release/v0.109.0, and a variant where the displaced turn aborts promptly (as it would after the separate API-side heartbeat fix) still fails. The E2E campaign for the stack found it; the stack did not cause it.What was broken
A cold turn was invisible to the keep-alive pool while it ran; nothing was inserted until park, after the turn returned. A steer therefore found no pool entry and cold-acquired a second environment for the same session. Both derive the same durable working directory, and mounting is idempotent, so the second adopted the first's live mount. Whichever environment tore down first unmounted and deleted the shared directory under the other. The next turn took the warm path, which never re-mounts, and crashed.
Changes
Two halves, independently tested:
SessionPool.reserve()seats the environment as busy before the turn runs, and the park converts the reservation (or an identity-checked evict removes it). A concurrent same-session request then takes the existing supersede branch, which completes the old teardown before the new acquire mounts. The reservation is refusable so the pool's capacity bound holds; on refusal the turn runs unreserved, exactly as before.Log-visible changes: a steer now logs
evict (supersede-busy)instead ofmiss, and tears the displaced turn's sandbox down mid-flight rather than letting it finish beside the new one. New lines:reserve,evict reason=pre-acquire,mismatch (mount-lost), andmount-probe threw, reusing.Tests / notes
session-steer-mount-loss.test.ts, including the exact production sequence and the approval-park variant. Each half bite-verified independently (reverting the reservation fails 4, the idle probe 1, the approval probe 1, the pre-acquire claim 1).is_current_turn) is a separate bug with its own repro and is not addressed here.Part of the agent-config-editing stack; targets its stack parent. Reading order bottom up.