Skip to content

test(opencode): fix session tools test typecheck and runtime - #46677

Merged
rekram1-node merged 1 commit into
devfrom
fix-tools-typecheck
Sep 1, 2026
Merged

test(opencode): fix session tools test typecheck and runtime#46677
rekram1-node merged 1 commit into
devfrom
fix-tools-typecheck

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

dev typecheck has been red since #32596 landed (https://github.com/anomalyco/opencode/actions?query=branch%3Adev+workflow%3Atypecheck). That PR was authored against an older API and its new test/session/tools.test.ts no longer typechecks or runs against current dev:

  • SessionTools.resolve now requires RuntimeFlags.Service, which the test layer did not provide
  • Session.Info grew enough fields that the partial as Session.Info cast is rejected; needs as unknown as
  • ToolExecutionOptions now requires messages
  • At runtime, resolve calls mcp.clients(), which the fake MCP service did not implement

Change

Test-only. Add RuntimeFlags.layer() to the layer, stub clients() on the fake MCP, cast the partial session through unknown, and pass messages: [] to execute.

Verification

@rekram1-node
rekram1-node merged commit 86387e9 into dev Sep 1, 2026
9 of 10 checks passed
@rekram1-node
rekram1-node deleted the fix-tools-typecheck branch September 1, 2026 20:24
Liddo-kun pushed a commit to Liddo-kun/Tandem that referenced this pull request Sep 3, 2026
daniel-liu-carsales added a commit to wellofspirit/opencode that referenced this pull request Sep 7, 2026
Upstream's tools.test.ts (anomalyco#46677) builds a Permission fake that satisfies
Permission.Interface. The hermetic-session patch adds `seal` to that
interface, so the fake needs the extra member to typecheck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant