Skip to content

chore: use native runtime conditions in development - #46644

Merged
rekram1-node merged 3 commits into
devfrom
fix-dev-runtime
Sep 1, 2026
Merged

chore: use native runtime conditions in development#46644
rekram1-node merged 3 commits into
devfrom
fix-dev-runtime

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Removes the global --conditions=browser flag from CLI dev scripts and subprocess test launchers. With Bun 1.3.14, the flag mixes Smithy's Node UTF-8 implementation with browser exports, causing Bedrock streaming to fail with TypeError: utilBufferFrom.fromArrayBuffer is not a function (the resolved value is a Symbol).

OpenTUI's existing preload already supplies reactive Solid core/store implementations. Update the backend/debug command examples to match. Actual browser tests retain their browser condition. The session view is unchanged; the separate Dynamic import cleanup is in #46649.

This follows the production-build fix in #30873 (June 5, 2026), which removed browser for the same Smithy Symbol failure. #31566 subsequently added bun alongside node. The build condition was never restored to browser in dev history; the dev scripts retained their original flags throughout.

This is independent of the SDK bump in #45520. The regression reproduces with the current dev dependency, Bedrock 4.0.158. No dependency, lockfile, provider-option, or build-setting changes are included; production builds already use bun/node conditions.

How did you verify your code works?

  • During investigation, temporary subprocess probes reproduced the Smithy failure with the original flags and decoded the same synthetic Bedrock stream successfully without them. These probes are not included in the PR.
  • packages/opencode: bun test test/cli test/provider/amazon-bedrock.test.ts --timeout 30000 --only-failures: 389 passed, 5 skipped, 0 failed.
  • bun typecheck passes in packages/opencode.
  • Prettier and git diff --check pass.

No new tests or fixtures. Existing CLI suites exercise real subprocess entrypoints. Verified locally on macOS ARM64 with Bun 1.3.14; interactive TUI behavior and arbitrary third-party plugins were not exhaustively verified.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node rekram1-node changed the title fix(opencode): use native runtime conditions in development chore: use native runtime conditions in development Sep 1, 2026
@rekram1-node
rekram1-node merged commit 55c54d1 into dev Sep 1, 2026
11 checks passed
@rekram1-node
rekram1-node deleted the fix-dev-runtime branch September 1, 2026 18:50
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 2026
Ported from anomalyco/opencode 55c54d1.

Port note: applied by hand — the same files, minus CONTRIBUTING.md (ours does not mention
the flag) and with the app's browser test script left alone, as upstream left it. The CLI
process suite passes without the flag.

Upstream: 55c54d1
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 2026
Ported from anomalyco/opencode 55c54d1.

Port note: applied by hand — the same files, minus CONTRIBUTING.md (ours does not mention
the flag) and with the app's browser test script left alone, as upstream left it. The CLI
process suite passes without the flag.

Upstream: 55c54d1
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