You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep a Location's services cached while a shell job started there remains backgrounded and running. Capture the shell's owning Location at job start rather than inferring it later from a Session that may have moved.
Recheck for shells admitted during eviction cleanup before detaching the cached graph.
Do not pin a parent Location just because it is waiting on a background sub-agent in another Location; completion enters the parent's durable inbox and wakes it normally.
Validation
SHELL=/bin/bash bun test test/location-activity.test.ts test/browser-idle.test.ts test/job.test.ts test/tool-shell.test.ts (88 pass, 42 platform skips)
bun typecheck from packages/core
bun --bun run lint from repo root
Full bun run check unavailable on this host's Node 18 (Astro requires Node >=22.12); attempting the whole-workspace check with Bun also hit a host-wide concurrent typecheck crash. Scoped checks above passed.
Supporting data for this PR — it fixes the notification-loss half of the eviction bug, not just the shell kill.
Independent repro on v2.0.22: background: true shell job launched at 18:02, worker idle at 18:03:05 (last durable event in the location), 60-min TTL evicts the location ~19:03, job actually finishes 19:11:33 — and no synthetic completion row is ever written (verified absent in session_message; session_inbox/session_pending empty). The .out file is also removed, matching the watcher's Effect.onInterrupt(() => shell.remove(...)) (tool/plugin/shell.ts:234). The waiting session stayed idle until woken manually 70 min later.
A second background job in the same session that ran < 60 min delivered normally, confirming the path works when the location survives.
Because notifyWhenDone is forkIn'd into the location/plugin scope, keeping the location's services cached while a backgrounded shell is live (as this PR does) is exactly what preserves sessions.synthetic(...) and the auto-resume. Kindly prioritise; this strands any background: true job that outlives the idle TTL, which is a common long-running-build/test pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
SHELL=/bin/bash bun test test/location-activity.test.ts test/browser-idle.test.ts test/job.test.ts test/tool-shell.test.ts(88 pass, 42 platform skips)bun typecheckfrompackages/corebun --bun run lintfrom repo rootbun run checkunavailable on this host's Node 18 (Astro requires Node >=22.12); attempting the whole-workspace check with Bun also hit a host-wide concurrent typecheck crash. Scoped checks above passed.Requested by: @jlongster (James via Slack)