Skip to content

Commit 9324653

Browse files
test(workspace): derive the second directory's overlay before its turn
1 parent a39d5c0 commit 9324653

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/opencode/test/altimate/workspace/engine-install-offer.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,17 @@ describe("offer routing — engine missing", () => {
236236
// a different workspace with the same name is a different verdict.
237237
const h = install({ headless: true })
238238
await beforeTurn("s1")
239-
syncInternals.instanceDirectory = () => "/tmp/analytics-2"
240-
syncInternals.resolveBinding = async () => ({ ...binding, datamateId: 43, projectPath: "/tmp/analytics-2" })
239+
// A second directory in the same process, bound to a namesake workspace:
240+
// its overlay is derived at its own config load, as the first one's was.
241+
const DIR2 = "/tmp/analytics-2"
242+
syncInternals.instanceDirectory = () => DIR2
243+
syncInternals.resolveBinding = async () => ({ ...binding, datamateId: 43, projectPath: DIR2 })
244+
const { overlay } = await import("../../../src/altimate/workspace/engine-overlay")
245+
const config2: { mcp?: Record<string, unknown> } = { mcp: {} }
246+
await overlay(DIR2, config2)
247+
syncInternals.config = { invalidate: async () => {}, get: async () => config2 }
241248
await beforeTurn("s2")
249+
expect(settledOutcome("s2")).toEqual({ kind: "engine-missing", declared: 2 })
242250
expect(h.printed).toHaveLength(2)
243251
})
244252
})

0 commit comments

Comments
 (0)