Skip to content

fix(labs/openclaw): correct env-substitution syntax (${VAR}, not __VAR__) - #150

Merged
mashkovd merged 1 commit into
mainfrom
fix/trading-data-bridge-env-syntax
May 7, 2026
Merged

mashkovd merged 1 commit into
mainfrom
fix/trading-data-bridge-env-syntax

Conversation

@mashkovd

@mashkovd mashkovd commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

PR #148 used __TRADING_DATA_URL__ placeholders by analogy with the existing coinglass entry. After deploy the bridge failed every ~30 s with:

[bundle-mcp] failed to start server "trading-data": MCP error -32603:
  Failed to parse URL from __TRADING_DATA_URL__

mctl-openclaw/src/config/env-substitution.test.ts confirms the real syntax is bash-style ${VAR}. The __NAME__ pattern in coinglass' entry is a literal string that the coinglass bridge has presumably never actually been consuming as a working API key — it just doesn't surface in skill output today because the snapshot pipeline pulls CVD via inline Binance + OKX REST (Phase 1.6 + Hook A) and not via coinglass MCP.

Switches trading-data env to ${TRADING_DATA_URL} and ${TRADING_DATA_TOKEN}. The pod env block in this same chart exposes TRADING_DATA_URL literally; TRADING_DATA_TOKEN comes from the labs-trading-data-client envFrom secret. openclaw resolves both placeholders against pod env at config load → bridge spawned process receives the resolved values.

Test plan

  • codex review (skipped per the operator's request)
  • After merge + ~3 min reconcile + labs-openclaw Recreate: openclaw logs show no more Failed to parse URL from __TRADING_DATA_URL__
  • kubectl exec deploy/labs-openclaw-base-service -- bash -c 'echo {...} | node /scripts/trading-data-mcp-proxy.js' returns 200 SSE init result
  • /eth ETH in Telegram populates cvd_24h.per_exchange.{bybit, bitget} (or <venue>_window_incomplete if the trading-data pod is fresh)

…R__)

PR #148 used __TRADING_DATA_URL__ / __TRADING_DATA_TOKEN__ as env-var
placeholders by analogy with the existing coinglass entry. Pod logs after
deploy showed the bridge failing every ~30 s with:

  [bundle-mcp] failed to start server "trading-data" (node /scripts/...):
    McpError: MCP error -32603: Failed to parse URL from __TRADING_DATA_URL__

Reading mctl-openclaw src/config/env-substitution.test.ts confirms the
real syntax is bash-style \${VAR}. The __NAME__ pattern in coinglass'
own entry is just a literal string that the coinglass bridge hasn't
been actually consuming as the API key — it only worked-by-accident
either because the operator never relied on coinglass-MCP tools
(skill snapshots use Binance + OKX inline REST, not coinglass MCP for
CVD), or because of a separate fallback path.

Switch trading-data to \${TRADING_DATA_URL} / \${TRADING_DATA_TOKEN}.
The pod env block in this same chart already exposes TRADING_DATA_URL
as a literal string, and TRADING_DATA_TOKEN comes from the
labs-trading-data-client envFrom secret — both end up in pod env at
boot, openclaw substitutes from pod env into mcp.servers.<x>.env at
config load, and the bridge spawned process gets the resolved values.

Pod will Recreate to reload openclaw.json. After recreate the bridge
should handshake successfully and the next /eth ETH call will populate
cvd_24h.per_exchange.{bybit, bitget}.
@mashkovd
mashkovd merged commit 29343d5 into main May 7, 2026
@mashkovd
mashkovd deleted the fix/trading-data-bridge-env-syntax branch May 7, 2026 06:45
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