Skip to content

Commit ee98326

Browse files
ralyodioclaude
andauthored
fix(release): install the workspace on the release runner so the automation runtime ships (#98)
Every release tarball since the automation runtime landed has shipped without sdk/, automate/ and analyze/: build-release.sh stages them only when it can run `pnpm ... build`, and the release job never installed pnpm or the workspace, so the stage skipped with a one-line note nobody read. v3.9.13 and v3.10.0 both have zero sdk/ entries, which is why `tron mcp`, `tron analyze`, `tron run` and now `tron automate` all answered "This TronBrowser build lacks ... Run: tron upgrade" on a fresh install. - release.yml: corepack + `pnpm install --frozen-lockfile --filter @tronbrowser/sdk...` before packaging on linux/macos, and a step that fails the job when the archive has no sdk/automate-bin.js. - build-release.sh: keep the staging build log and print its tail on failure. - services/api mcp/tron: the GET health reply reports the caller's scheme (x-forwarded-proto) instead of http:// behind Railway's TLS edge. Claude-Session: https://claude.ai/code/session_018WGZpo8on6XLGYnccXV3dP Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 611d8e4 commit ee98326

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,29 @@ jobs:
5757
- name: Sync version
5858
run: node scripts/set-version.mjs "${{ needs.create-release.outputs.version }}"
5959

60+
# The automation runtime (tron snapshot/analyze/run/mcp/automate) is the
61+
# compiled browser-core, agent-runtime and sdk packages, which
62+
# build-release.sh stages only when it can build them. That takes pnpm and
63+
# the workspace's dev dependencies; without this step the stage is skipped
64+
# with a one-line note and every release ships without `sdk/`.
65+
- name: Install workspace (for the automation runtime)
66+
if: matrix.platform != 'windows'
67+
run: |
68+
corepack enable
69+
corepack prepare pnpm@9.12.0 --activate
70+
pnpm install --frozen-lockfile --filter @tronbrowser/sdk...
71+
6072
- name: Package (linux/macos)
6173
if: matrix.platform != 'windows'
6274
run: bash apps/desktop/scripts/build-release.sh "v${{ needs.create-release.outputs.version }}" ${{ matrix.platform }}
6375

76+
- name: Check the automation runtime is in the archive
77+
if: matrix.platform != 'windows'
78+
run: |
79+
if [ "${{ matrix.platform }}" = linux ]; then list="tar -tzf dist/tronbrowser-linux-x64.tar.gz"; else list="unzip -Z1 dist/tronbrowser-macos.zip"; fi
80+
$list | grep -q 'sdk/automate-bin.js' \
81+
|| { echo "::error::release archive has no sdk/automate-bin.js (automation runtime was not staged)"; exit 1; }
82+
6483
- name: Package (linux deb + rpm + AppImage)
6584
if: matrix.platform == 'linux'
6685
run: |

‎apps/desktop/scripts/build-release.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ stage_automation() { # dest dir
4242
local s="$1"
4343
command -v node >/dev/null 2>&1 && command -v pnpm >/dev/null 2>&1 || {
4444
echo " ! automation runtime skipped (needs node + pnpm)"; return; }
45-
if ( cd "$REPO_ROOT" && pnpm --filter @tronbrowser/browser-core --filter @tronbrowser/agent-runtime --filter @tronbrowser/sdk build >/dev/null 2>&1 ); then
45+
# Keep the build log: a silent skip here shipped releases with no sdk/ for a
46+
# while (nothing installed pnpm on the release runner) and the only trace was
47+
# one line in the job log.
48+
local log="$s/../automation-build.log"
49+
if ( cd "$REPO_ROOT" && pnpm --filter @tronbrowser/browser-core --filter @tronbrowser/agent-runtime --filter @tronbrowser/sdk build >"$log" 2>&1 ); then
50+
rm -f "$log"
4651
rm -rf "$s/automate" "$s/analyze" "$s/sdk"
4752
cp -R "$REPO_ROOT/packages/browser-core/dist" "$s/automate"
4853
printf '{\n "type": "module"\n}\n' > "$s/automate/package.json"
@@ -52,7 +57,9 @@ stage_automation() { # dest dir
5257
printf '{\n "type": "module"\n}\n' > "$s/sdk/package.json"
5358
echo " + bundled automation + analyze + SDK (tron snapshot/extract/analyze/run)"
5459
else
55-
echo " ! automation runtime skipped (browser-core/agent-runtime/sdk build failed)"
60+
echo " ! automation runtime skipped (browser-core/agent-runtime/sdk build failed):"
61+
tail -n 20 "$log" 2>/dev/null | sed 's/^/ /'
62+
rm -f "$log"
5663
fi
5764
}
5865

‎services/api/src/mcp/tron.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ export function tronRelay(deps: TronRelayDeps = {}): TronRelay {
169169
c.json({
170170
ok: true,
171171
name: 'TronBrowser',
172-
mcp: `${new URL(c.req.url).origin}/mcp/tron`,
172+
// Railway terminates TLS, so the origin seen here is http://; report what the caller used.
173+
mcp: `${(c.req.header('x-forwarded-proto') ?? new URL(c.req.url).protocol.replace(':', '')).split(',')[0]}://${new URL(c.req.url).host}/mcp/tron`,
173174
descriptor: DESCRIPTOR_URL,
174175
tools: toolNames,
175176
engines: engines

0 commit comments

Comments
 (0)