After an in-place plugin update, new sessions keep spawning the old `aft` binary (shared standalone pool keeps the first binary path)
When OpenCode installs a new @latest AFT mid-run (here 0.67.1 → 0.68.0, server not restarted), the new plugin instance resolves the new binary but new sessions still get bridges running the old one, for as long as the process lives.
Log (aft-plugin.log, 0.68.0 loaded at 18:30:47Z):
18:48:06Z Resolved binary … v0.68.0
18:48:06Z Spawning binary: ~/.cache/aft/bin/v0.67.1/aft
Binary version: 0.67.1
The same pattern repeats for every new session root afterwards; ~20 minutes later all four running aft processes were v0.67.1/aft, none v0.68.0. So fixes in the new release (e.g. the #1441 memory work) don't reach a running server until a full restart.
Cause (v0.68.1, packages/aft-bridge/src/location-lifecycle.ts): the lifecycle state lives on globalThis (lifecycleState(), lines 85-92), so every module copy in the process shares one standalone owner. acquireBridge creates the pool only when state.standalone is empty, with the first caller's options.binaryPath (236-264); later callers, including the new module instance, just add a reference and get a lease on that pool (266-276), and their own binaryPath is ignored. The pool shuts down only when references reach 0 (290-292), and neither path in pool.ts that swaps binaries fires: the binary-change check compares the same path (pool.ts:308-329), and replaceBinary (pool.ts:384) only runs from the version-mismatch callback, which an older-but-acceptable binary doesn't trigger.
Suggested fix: in acquireBridge, compare options.binaryPath with the owner's pool binary; when it differs, replaceBinary (or start a new owner and let the old one drain as its leases are released).
Thanks, @null-axiom, for the precise trace. Confirmed by reading the code: in OpenCode's standalone mode, the shared bridge pool keeps the binary path of the first plugin copy that created it, so sessions opened after an in-place update still start the old binary until the host restarts. Restarting OpenCode after updating picks up the new binary. The standalone pool is being replaced by the CortexKit daemon, so rather than reworking the pool now, we'll keep this issue open and close it when that change ships.