GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — feat(ai): add first-class TestLLM controls by kitlangton · Pull Request #45828 · anomalyco/opencode Conversation
|
| Scenario | New Contract |
|---|---|
Construct stream or generate without executing it |
No recording, script consumption, or responder invocation |
| Execute the same stream/Effect twice | Two observations and two response assignments |
Queue replies and install serve or always |
FIFO queued replies take precedence; the fallback answers only after exhaustion |
| An arrival waiter immediately starts another request | The current reply and gate are reserved before that waiter resumes |
| A responder throws | Its defect is preserved, and arrival waiters are still notified |
Read requests() |
Receive an array snapshot, not the mutable backing array |
serve(request => response) receives the original canonical request; transformRequest affects observations only. always and serve replace each other without changing queued replies.
Gates remain countable and scoped. Raw event arrays and arbitrary response Streams are still consumed directly, preserving failure identity, malformed/incomplete output, finalizers, and tails after terminal events. There is no implicit reply repair, truncation, title routing, or settlement framework.
Small Core fixtures now use the single layer. The SDK workspace-tool fixture uses serve instead of duplicating stream/generate implementation.
The published Service, layer, clientLayer, module-level controls, and live legacy requests array remain available. Their thin adapter is backed by the same implementation, not a second test client. New tests use Test and testLayer; legacy construction only allocates its adapter when that entry point is used.
The existing large SessionRunner suite continues to exercise the legacy surface, including retained request-array references, explicit array clearing, concurrent gates, retries, and interruption.
AI's TestLLM implementation, focused contract/export tests and documentation, plus its small Core/SDK consumers. No simulation unification, new script language, dependency upgrades, public OpenCode protocol changes, or npm release is included.
Run from the indicated package directories:
# packages/ai bun run test test/testing.test.ts test/exports.test.ts bun run test test/testing.test.ts test/exports.test.ts --concurrent --rerun-each 10 bun typecheck bun run build RECORD=false bun run ../core/script/test.ts --timeout 30000 # packages/core bun run test test/session-step.test.ts test/generate.test.ts test/session-runner.test.ts bun run test bun typecheck # packages/sdk bun run ../core/script/test.ts --timeout 5000 bun typecheck
The full isolated AI suite has 809 passed, 25 skipped, and the same 15 pre-existing failures reproduced on the unchanged base during #45819. The candidate failure-name set matches that baseline exactly; those provider/fixture failures are fixed separately in #45826 rather than hidden in this PR.
Normal CI passed, including Linux/Windows unit and E2E jobs, at head 0a981216b7dcd2d06334bfca9171089a444c9a20. However, turbo.json currently does not register AI's test task, so those jobs did not execute the new TestLLM runtime tests. The configured AI typecheck includes the actual new contract test file, and direct local focused/repeated runs plus Core/SDK suites and the built-API smoke establish behavior. Registering the omitted AI, Server, and Codegen suites is a separate tracked follow-up; green CI alone is not evidence that those suites ran.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.