Parent: #502 Discovered while validating the follow-up to #1028.
Executed reproductions
On current main cce66bb724fa25945efbd11322155c86b1e632f9 with the real collector:
zig build test -Dtest-filter='real agents: broadcast rendezvous' -j1The selected test never completes. A process sample shows the main thread repeatedly executing $262.agent.sleep(1) in the Atomics.notify(...) === 0 loop and no live agent thread.
The related focused case:
zig build test -Dtest-filter='Atomics.waitAsync: not-equal sync' -j1fails after the cross-agent waiter remains unsettled. Exact parent 3c139f9f reproduces the same failure, so this is not caused by #1028's follow-up.
Disposable-snapshot instrumentation of the production path establishes:
agent.start before active=0 limit=9 waiters=0
agent.start after active=0 limit=9 waiters=0
agentMain entered
agentThreadRun globals installed
agentThreadRun parsed
agentThreadRun vm Throw
agentThreadRun exception ReferenceError: Can't find variable: $262The typed agent is admitted and enters normally. agentThreadRun calls installGlobals, then creates a fresh global_obj, but unlike normal Context realm construction it never publishes the installed environment bindings as own properties of that global object. Bytecode global lookup therefore cannot resolve $262 (and would likewise miss the other installed globals). Agent execution swallows the throw by design, so the parent observes only a missing rendezvous/report.
Required change
- Publish every installed agent-realm global binding onto the fresh global object with the same attributes as ordinary Context realm creation.
- Wire
$262.globalto that exact object after publication. - Preserve agent group ownership: an agent realm must not reset the parent group's broadcast/report state.
- Do not special-case
$262, force tree-walker execution, add polling, or weaken the rendezvous assertions.
Definition of done
- Focused real-agent rendezvous passes normally and under unsuppressed TSan.
- Cross-agent
Atomics.waitAsyncnotification settles normally and under unsuppressed TSan. - A focused regression proves representative installed globals are own properties of the agent global object before VM execution.
- Full unit suite completes with zero failures and leaks, or any unrelated exact-parent blocker is documented precisely.