Skip to content

test: snapshot-tool-race.test.ts throws Unbound layer node: LocationServiceMap #194

Closed

Description

@alltomatos

Split out from #181, whose "Unbound layer node" half turned out to be an unrelated root cause from the InterruptError half tracked there (confirmed: this reproduces 100% deterministically in isolation, not intermittently — see analysis below), so keeping both under one issue was misleading.

What's broken

`packages/opencode/test/session/snapshot-tool-race.test.ts` builds its Effect layer graph with the raw `LayerNode.compile(root, replacements)`. `Session.node` (part of `root`) depends on `LocationServiceMap.node`, and this file's replacement list never supplies it — so compiling the layer graph throws:

```
error: Unbound layer node: @opencode/example/LocationServiceMap
at packages/core/src/effect/layer-node.ts:260:48
```

Every other test file that pulls in `Session.node` (`session.test.ts`, `compaction.test.ts`, etc.) uses `AppNodeBuilder.build` instead, which auto-injects a `LocationServiceMap` replacement whenever the graph has an unbound dependency on it. This file was the one outlier still calling `LayerNode.compile` directly.

This reproduces deterministically on every single run of the file in isolation (the layer graph is built synchronously at module load) — not just during CI's `--only-failures` isolated rerun as originally suspected in #181.

Fix

Closes via #190 — switches to `AppNodeBuilder.build`, same pattern as the rest of the suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions