cloudaxe-opencode/packages/opencode/test/session
Kit Langton ddbd119dcb test: drop AppRuntime usage from tests
Removes all direct AppRuntime usage from packages/opencode/test —
`grep -r AppRuntime packages/opencode/test` now returns nothing.

Two patterns are applied:

1. Event tests rewritten in the httpapi-cors.test.ts style. The two
   /event SSE tests now serve HttpApiApp.routes on
   NodeHttpServer.layerTest and hit them via HttpClient. Pub/sub
   identity with the in-process routes is preserved via a new opt-in
   `testEffectShared` (in test/lib/effect.ts) that builds the test
   layer through the shared process-wide memoMap so Bus.defaultLayer
   resolves to the same Bus.Service the routes subscribed to.

   The SSE reader helpers move to test/lib/sse.ts and use HttpClient +
   Effect.Stream + Queue<SseEvent>.

   The D7 diagnostic case is removed: the AppRuntime-vs-test-runtime
   distinction it diagnosed no longer exists.

2. Surgical swap in the remaining four files
   (provider/{amazon-bedrock,provider}, session/llm,
   control-plane/workspace). Each `AppRuntime.runPromise(...)` becomes a
   module-level `ManagedRuntime.make(Service.defaultLayer, { memoMap })`.
   The shared memoMap preserves service identity, so behavior is
   unchanged.

Tests: event (9/9), amazon-bedrock (19/19), provider (84/84),
workspace (35/35); 147 pass across the 5 affected files. The 3
pre-existing failures in session/llm.test.ts are independent of this
change (verified by stashing the diff).
2026-05-20 20:50:32 -04:00
..
compaction.test.ts Preview native LLM runtime stack (#27114) 2026-05-18 14:41:36 -04:00
instruction.test.ts refactor(flags): migrate claude code prompt flag (#27690) 2026-05-15 14:17:04 +05:30
llm-native-recorded.test.ts Refactor LLM route-first provider API (#28523) 2026-05-20 20:15:52 -04:00
llm-native.test.ts Refactor LLM route-first provider API (#28523) 2026-05-20 20:15:52 -04:00
llm.test.ts test: drop AppRuntime usage from tests 2026-05-20 20:50:32 -04:00
message-v2.test.ts fix(session): prevent double auto-compaction from filterCompacted reorder (#27545) 2026-05-14 13:56:12 -04:00
messages-pagination.test.ts fix(session): make message reads effectful (#27291) 2026-05-13 14:40:12 +05:30
processor-effect.test.ts Skip git setup for processor tool test (#28406) 2026-05-19 18:09:15 -04:00
prompt.test.ts Skip LLM server for prompt tests without LLM calls (#28391) 2026-05-19 16:27:36 -04:00
retry.test.ts Remove effect-zod bridge (#26956) 2026-05-11 21:14:55 -04:00
revert-compact.test.ts
schema-decoding.test.ts Drop unused opencode Zod statics (#26935) 2026-05-11 17:14:18 -04:00
session-schema.test.ts Track session usage totals (#26644) 2026-05-12 01:18:57 -04:00
session.test.ts feat: add experimental background subagents (#27084) 2026-05-14 22:10:15 +05:30
snapshot-tool-race.test.ts refactor(repository): add cache service (#28184) 2026-05-18 21:25:38 +05:30
structured-output-integration.test.ts test(session): migrate structured output integration test (#27143) 2026-05-12 20:30:35 +00:00
structured-output.test.ts Validate structured output tests with Effect Schema (#26919) 2026-05-11 16:11:25 -04:00
system.test.ts fix(skill): allow missing descriptions (#26391) 2026-05-08 18:50:06 +00:00