Skip to content

fix(build): emit OpenTUI runtime chunk and build agent-sdk#28

Merged
ZouR-Ma merged 1 commit into
stepfun-ai:mainfrom
li-xiu-qi:fix/opentui-runtime-chunk
Jul 11, 2026
Merged

fix(build): emit OpenTUI runtime chunk and build agent-sdk#28
ZouR-Ma merged 1 commit into
stepfun-ai:mainfrom
li-xiu-qi:fix/opentui-runtime-chunk

Conversation

@li-xiu-qi

@li-xiu-qi li-xiu-qi commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Closes #25

Problem

After running bash scripts/setup.sh and then step, the process exits immediately with:

step-cli error: OpenTUI runtime did not export createLocalTuiClientApp()

This is especially visible on WSL and other environments where the bundled OpenTUI chunk ends up empty.

Root cause

Two separate build issues:

  1. tsdown / rolldown 1.0.0-beta.7 code-splits src/runtime/local-tui-app.ts into dist/local-tui-app-<hash>.js, but the resulting chunk is effectively empty (only imports) and does not export createLocalTuiClientApp or the LocalStepCliTuiApp class.
  2. extensions/realtime-voice/src/bridge/coding-bridge.ts imports @step-cli/agent-sdk, but scripts/build-packages.mjs never builds packages/agent-sdk, so its dist/index.js is missing and the bundler treats it as external.

Changes

  • tsdown.config.ts: add runtime/local-tui-app as an explicit entry point, which forces the bundler to emit a real chunk with the required exports.
  • scripts/build-packages.mjs: add @step-cli/agent-sdk to the package build targets.

Verification

  • pnpm build completes successfully.
  • node bin/step-cli.js --version works using the built dist/index.js.
  • dist/runtime/local-tui-app.js now contains createLocalTuiClientApp and LocalStepCliTuiApp.
  • packages/agent-sdk/dist/index.js is now produced.

Manual test plan

bash scripts/setup.sh
# open a new shell
step --version
step voice

Note on runtime: step voice (OpenTUI) requires Bun. If the installed launcher falls back to Node, or if a Windows Bun is picked up under WSL, you may hit the runtime errors described in #29. The installer fix in #37 ensures a Linux-native Bun is selected on WSL and a native binary is installed.

Related

Lion-1209 added a commit to Lion-1209/Step-Realtime-CLI that referenced this pull request Jun 16, 2026
…ression

Neither the installer smoke test (`step --version`) nor CI exercise the
interactive TUI path, so when tsdown/rolldown tree-shook the
`local-tui-app` dynamic-import target into an empty chunk (stepfun-ai#25), it shipped
undetected — `step` failed at runtime with "OpenTUI runtime did not export
createLocalTuiClientApp()".

Add a build-output sentinel that checks the built `local-tui-app` chunk for
the required exports and warns when they're missing. It is non-blocking
(`continue-on-error`) on purpose so it can land independently of stepfun-ai#28: on
current `main` it warns (expected, since stepfun-ai#25 is unfixed); once stepfun-ai#28 merges the
warning clears automatically. Flipping to `--enforce` (and dropping
`continue-on-error`) turns it into a hard gate for the future.

Runs on the Windows CI lane, which already produces a build; tsdown output
shape is platform-consistent, so one lane covers the build regression.

Complements stepfun-ai#28. See stepfun-ai#25.
@ZouR-Ma

ZouR-Ma commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

To get this ready to merge:

  • Reference an issue in the description with Closes #<number> (our link-check CI requires it; open one first if needed).
  • Make sure pnpm check passes locally (lint, type-check, dependency/dead-code guards, formatting, and tests — also enforced in CI).

Full conventions:
https://github.com/stepfun-ai/Step-Realtime-CLI/blob/main/CONTRIBUTING.md

- Add runtime/local-tui-app as an explicit tsdown entry so the dynamic
  import resolves to a chunk that actually exports createLocalTuiClientApp.
- Add @step-cli/agent-sdk to build-packages.mjs targets because
  extensions/realtime-voice imports it and its dist was never produced.

Fixes stepfun-ai#25
@li-xiu-qi
li-xiu-qi force-pushed the fix/opentui-runtime-chunk branch from 4c7dccc to ef0be96 Compare June 18, 2026 06:27
@github-actions github-actions Bot added the area/build scripts, .github, build/config files label Jun 18, 2026
@li-xiu-qi

Copy link
Copy Markdown
Contributor Author

@ZouR-Ma Thanks for the review. I've rebased onto the latest main and confirmed pnpm check passes locally (Node 20.20.2). The PR description already references Closes #25. This fix is complementary to #47, which adds a CI sentinel for the same regression. Please let me know if anything else is needed.

@li-xiu-qi

Copy link
Copy Markdown
Contributor Author

Hi @li-xiu-qi, thanks for the build fix. This PR overlaps with #97 on adding @step-cli/agent-sdk to the build pipeline (scripts/build-packages.mjs). #97 is currently open and covers the same change. Wanted to flag the overlap in case you want to coordinate or consolidate.

@ZouR-Ma
ZouR-Ma merged commit 4f45875 into stepfun-ai:main Jul 11, 2026
6 checks passed
Lion-1209 added a commit to Lion-1209/Step-Realtime-CLI that referenced this pull request Jul 13, 2026
…ression

Neither the installer smoke test (`step --version`) nor CI exercise the
interactive TUI path, so when tsdown/rolldown tree-shook the
`local-tui-app` dynamic-import target into an empty chunk (stepfun-ai#25), it shipped
undetected — `step` failed at runtime with "OpenTUI runtime did not export
createLocalTuiClientApp()".

Add a build-output sentinel that checks the built `local-tui-app` chunk for
the required exports and warns when they're missing. It is non-blocking
(`continue-on-error`) on purpose so it can land independently of stepfun-ai#28: on
current `main` it warns (expected, since stepfun-ai#25 is unfixed); once stepfun-ai#28 merges the
warning clears automatically. Flipping to `--enforce` (and dropping
`continue-on-error`) turns it into a hard gate for the future.

Runs on the Windows CI lane, which already produces a build; tsdown output
shape is platform-consistent, so one lane covers the build regression.

Complements stepfun-ai#28. See stepfun-ai#25.
ZouR-Ma pushed a commit to Lion-1209/Step-Realtime-CLI that referenced this pull request Jul 17, 2026
…ression

Neither the installer smoke test (`step --version`) nor CI exercise the
interactive TUI path, so when tsdown/rolldown tree-shook the
`local-tui-app` dynamic-import target into an empty chunk (stepfun-ai#25), it shipped
undetected — `step` failed at runtime with "OpenTUI runtime did not export
createLocalTuiClientApp()".

Add a build-output sentinel that checks the built `local-tui-app` chunk for
the required exports and warns when they're missing. It is non-blocking
(`continue-on-error`) on purpose so it can land independently of stepfun-ai#28: on
current `main` it warns (expected, since stepfun-ai#25 is unfixed); once stepfun-ai#28 merges the
warning clears automatically. Flipping to `--enforce` (and dropping
`continue-on-error`) turns it into a hard gate for the future.

Runs on the Windows CI lane, which already produces a build; tsdown output
shape is platform-consistent, so one lane covers the build regression.

Complements stepfun-ai#28. See stepfun-ai#25.
ZouR-Ma added a commit to Lion-1209/Step-Realtime-CLI that referenced this pull request Jul 17, 2026
stepfun-ai#28 (the build fix that makes the OpenTUI runtime chunk carry its exports)
has landed on main, so the sentinel no longer needs to warn-only. Drop
continue-on-error and pass --enforce so a missing/empty chunk fails the
Windows lane. Rebased onto current main so the chunk is populated.
ZouR-Ma added a commit that referenced this pull request Jul 17, 2026
* ci: add non-blocking sentinel for the #25 OpenTUI chunk regression

Neither the installer smoke test (`step --version`) nor CI exercise the
interactive TUI path, so when tsdown/rolldown tree-shook the
`local-tui-app` dynamic-import target into an empty chunk (#25), it shipped
undetected — `step` failed at runtime with "OpenTUI runtime did not export
createLocalTuiClientApp()".

Add a build-output sentinel that checks the built `local-tui-app` chunk for
the required exports and warns when they're missing. It is non-blocking
(`continue-on-error`) on purpose so it can land independently of #28: on
current `main` it warns (expected, since #25 is unfixed); once #28 merges the
warning clears automatically. Flipping to `--enforce` (and dropping
`continue-on-error`) turns it into a hard gate for the future.

Runs on the Windows CI lane, which already produces a build; tsdown output
shape is platform-consistent, so one lane covers the build regression.

Complements #28. See #25.

* ci: enforce the #25 build-output sentinel as a hard gate

#28 (the build fix that makes the OpenTUI runtime chunk carry its exports)
has landed on main, so the sentinel no longer needs to warn-only. Drop
continue-on-error and pass --enforce so a missing/empty chunk fails the
Windows lane. Rebased onto current main so the chunk is populated.

---------

Co-authored-by: ZouR-Ma <2605315944@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build scripts, .github, build/config files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: bundled OpenTUI chunk is empty, step fails with createLocalTuiClientApp not exported

2 participants