test(opencode): consolidate session prompt tests into Effect style#23710
Merged
kitlangton merged 1 commit intodevfrom Apr 21, 2026
Merged
test(opencode): consolidate session prompt tests into Effect style#23710kitlangton merged 1 commit intodevfrom
kitlangton merged 1 commit intodevfrom
Conversation
Merge the old Promise-style prompt.test.ts into prompt-effect.test.ts and rename to prompt.test.ts. The old file predated testEffect/provideTmpdirServer and duplicated Bun.serve + Instance.provide scaffolding for 9 tests covering missing files, special characters, regression cases, agent variants, and agent/command resolution errors.
xywsxp
pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
Donwulff
added a commit
to Donwulff/opencode
that referenced
this pull request
Apr 27, 2026
Six files kept fork's barrel-style imports after upstream's remove-module-barrels PR; the merge also missed PR anomalyco#23710's rename of prompt-effect.test.ts -> prompt.test.ts (with ~360 lines of consolidated tests). Imports redirected to direct paths in config/config.ts, provenance/index.ts, provider/models.ts, tool/webfetch.ts, tool/websearch.ts, util/fetch.ts. Test file renamed to upstream's canonical name with consolidated content; fork's Auth.defaultLayer addition re-applied.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/session/prompt.test.tsintoprompt-effect.test.tsand rename back toprompt.test.ts.testEffect/provideTmpdirServerhelpers and duplicatedBun.serve+Instance.providescaffolding — exactly the patterntest/AGENTS.mdcalls out as deprecated.#in filename, empty-assistant-turn regression, cancel mid-stream, agent variant, 3× agent/command not-found). 35 + 9 = 44 tests, all passing.Notes
ReadableStreamforllm.hang+llm.wait(1).Bun.serve+ alibaba provider stub in favor ofprovideTmpdirServer+llm.text.variants: { xhigh: {}, high: {} }to the test-model config so variant resolution actually matches (equivalent of thegpt-5.2variants the original relied on).Effect.runPromise(...).then((), (e) => e)to.pipe(Effect.exit)+Cause.squash.Test plan
bun typecheck(packages/opencode) ✓bun run test test/session/prompt.test.ts→ 44 pass, 0 fail