Skip to content

test(opencode): consolidate session prompt tests into Effect style#23710

Merged
kitlangton merged 1 commit intodevfrom
kit/prompt-test-merge
Apr 21, 2026
Merged

test(opencode): consolidate session prompt tests into Effect style#23710
kitlangton merged 1 commit intodevfrom
kit/prompt-test-merge

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Merge old Promise-style test/session/prompt.test.ts into prompt-effect.test.ts and rename back to prompt.test.ts.
  • The old file predated the testEffect / provideTmpdirServer helpers and duplicated Bun.serve + Instance.provide scaffolding — exactly the pattern test/AGENTS.md calls out as deprecated.
  • All 9 tests migrated (missing-file handling, # in filename, empty-assistant-turn regression, cancel mid-stream, agent variant, 3× agent/command not-found). 35 + 9 = 44 tests, all passing.

Notes

  • Cancel mid-stream test swaps the hand-rolled hanging ReadableStream for llm.hang + llm.wait(1).
  • The empty-turn regression drops Bun.serve + alibaba provider stub in favor of provideTmpdirServer + llm.text.
  • Agent variant test adds variants: { xhigh: {}, high: {} } to the test-model config so variant resolution actually matches (equivalent of the gpt-5.2 variants the original relied on).
  • Agent/command resolution errors switched from 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

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.
@kitlangton kitlangton enabled auto-merge (squash) April 21, 2026 15:49
@kitlangton kitlangton merged commit 9579429 into dev Apr 21, 2026
13 checks passed
@kitlangton kitlangton deleted the kit/prompt-test-merge branch April 21, 2026 15:54
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant