Normalize instance lifecycle wiring (#25501)

This commit is contained in:
Kit Langton
2026-05-02 20:39:20 -04:00
committed by GitHub
parent a6464062b7
commit 7d91d3b1ed
71 changed files with 852 additions and 936 deletions
@@ -112,6 +112,7 @@ beforeEach(() => {
// Import modules after mocking
const { MCP } = await import("../../src/mcp/index")
const { Instance } = await import("../../src/project/instance")
const { WithInstance } = await import("../../src/project/with-instance")
const { tmpdir } = await import("../fixture/fixture")
test("first connect to OAuth server shows needs_auth instead of failed", async () => {
@@ -132,7 +133,7 @@ test("first connect to OAuth server shows needs_auth instead of failed", async (
},
})
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
const result = await Effect.runPromise(
@@ -162,7 +163,7 @@ test("state() generates a new state when none is saved", async () => {
await using tmp = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
const auth = await Effect.runPromise(
@@ -203,7 +204,7 @@ test("state() returns existing state when one is saved", async () => {
await using tmp = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
const auth = await Effect.runPromise(
@@ -252,7 +253,7 @@ test("authenticate() stores a connected client when auth completes without redir
},
})
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
await Effect.runPromise(