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

View File

@@ -1,6 +1,7 @@
import { afterEach, describe, expect, test } from "bun:test"
import { Effect } from "effect"
import { Instance } from "../../src/project/instance"
import { WithInstance } from "../../src/project/with-instance"
import { Server } from "../../src/server/server"
import { Session as SessionNs } from "@/session/session"
import { MessageV2 } from "../../src/session/message-v2"
@@ -76,7 +77,7 @@ describe("session messages endpoint", () => {
test("returns cursor headers for older pages", async () => {
await using tmp = await tmpdir({ git: true })
await withoutWatcher(() =>
Instance.provide({
WithInstance.provide({
directory: tmp.path,
fn: async () => {
const session = await svc.create({})
@@ -105,7 +106,7 @@ describe("session messages endpoint", () => {
test("keeps full-history responses when limit is omitted", async () => {
await using tmp = await tmpdir({ git: true })
await withoutWatcher(() =>
Instance.provide({
WithInstance.provide({
directory: tmp.path,
fn: async () => {
const session = await svc.create({})
@@ -126,7 +127,7 @@ describe("session messages endpoint", () => {
test("rejects invalid cursors and missing sessions", async () => {
await using tmp = await tmpdir({ git: true })
await withoutWatcher(() =>
Instance.provide({
WithInstance.provide({
directory: tmp.path,
fn: async () => {
const session = await svc.create({})
@@ -147,7 +148,7 @@ describe("session messages endpoint", () => {
test("does not truncate large legacy limit requests", async () => {
await using tmp = await tmpdir({ git: true })
await withoutWatcher(() =>
Instance.provide({
WithInstance.provide({
directory: tmp.path,
fn: async () => {
const session = await svc.create({})