@@ -168,10 +168,7 @@ const blockingProcessor = Layer.succeed( |
168 | 168 | }), |
169 | 169 | ) |
170 | 170 |
|
171 | | -function makePrompt(input?: { |
172 | | - mcpInstructions?: MCP.ServerInstructions[] |
173 | | - processor?: "blocking" |
174 | | -}) { |
| 171 | +function makePrompt(input?: { mcpInstructions?: MCP.ServerInstructions[]; processor?: "blocking" }) { |
175 | 172 | const deps = Layer.mergeAll( |
176 | 173 | Session.defaultLayer, |
177 | 174 | Snapshot.defaultLayer, |
@@ -243,17 +240,11 @@ function makePrompt(input?: { |
243 | 240 | ) |
244 | 241 | } |
245 | 242 |
|
246 | | -function makeHttp(input?: { |
247 | | - mcpInstructions?: MCP.ServerInstructions[] |
248 | | - processor?: "blocking" |
249 | | -}) { |
| 243 | +function makeHttp(input?: { mcpInstructions?: MCP.ServerInstructions[]; processor?: "blocking" }) { |
250 | 244 | return Layer.mergeAll(TestLLMServer.layer, makePrompt(input)) |
251 | 245 | } |
252 | 246 |
|
253 | | -function makeHttpNoLLMServer(input?: { |
254 | | - mcpInstructions?: MCP.ServerInstructions[] |
255 | | - processor?: "blocking" |
256 | | -}) { |
| 247 | +function makeHttpNoLLMServer(input?: { mcpInstructions?: MCP.ServerInstructions[]; processor?: "blocking" }) { |
257 | 248 | return makePrompt(input) |
258 | 249 | } |
259 | 250 |
|
@@ -537,27 +528,29 @@ it.instance("loop calls LLM and returns assistant message", () => |
537 | 528 | }), |
538 | 529 | ) |
539 | 530 |
|
540 | | -withMcpInstructions.instance("loop includes MCP instructions in model system context", () => |
541 | | - Effect.gen(function* () { |
542 | | - const { llm } = yield* useServerConfig(providerCfg) |
543 | | - const prompt = yield* SessionPrompt.Service |
544 | | - const sessions = yield* Session.Service |
545 | | - const chat = yield* sessions.create({ |
546 | | - title: "Pinned", |
547 | | - permission: [{ permission: "*", pattern: "*", action: "allow" }], |
548 | | - }) |
549 | | - yield* llm.hang |
550 | | - yield* user(chat.id, "hello") |
| 531 | +withMcpInstructions.instance( |
| 532 | + "loop includes MCP instructions in model system context", |
| 533 | + () => |
| 534 | + Effect.gen(function* () { |
| 535 | + const { llm } = yield* useServerConfig(providerCfg) |
| 536 | + const prompt = yield* SessionPrompt.Service |
| 537 | + const sessions = yield* Session.Service |
| 538 | + const chat = yield* sessions.create({ |
| 539 | + title: "Pinned", |
| 540 | + permission: [{ permission: "*", pattern: "*", action: "allow" }], |
| 541 | + }) |
| 542 | + yield* llm.hang |
| 543 | + yield* user(chat.id, "hello") |
551 | 544 |
|
552 | | - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) |
553 | | - yield* awaitWithTimeout(llm.wait(1), "timed out waiting for MCP instruction request", "10 seconds") |
| 545 | + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) |
| 546 | + yield* awaitWithTimeout(llm.wait(1), "timed out waiting for MCP instruction request", "10 seconds") |
554 | 547 |
|
555 | | - const hits = yield* llm.hits |
556 | | - const body = JSON.stringify(hits[0]?.body) |
557 | | - expect(body).toContain('<server name=\\"guide-server\\">') |
558 | | - expect(body).toContain("Use lookup before mutate.") |
559 | | - yield* Fiber.interrupt(fiber) |
560 | | - }), |
| 548 | + const hits = yield* llm.hits |
| 549 | + const body = JSON.stringify(hits[0]?.body) |
| 550 | + expect(body).toContain('<server name=\\"guide-server\\">') |
| 551 | + expect(body).toContain("Use lookup before mutate.") |
| 552 | + yield* Fiber.interrupt(fiber) |
| 553 | + }), |
561 | 554 | 15_000, |
562 | 555 | ) |
563 | 556 |
|
|