Skip to content

fix(gateway): harden one-shot gateway call transport#13

Open
lionrooter wants to merge 1 commit intowip/budget-routing-status-1006-fix-2026-03-22from
wip/gateway-call-1006-runtime-fix-2026-03-22
Open

fix(gateway): harden one-shot gateway call transport#13
lionrooter wants to merge 1 commit intowip/budget-routing-status-1006-fix-2026-03-22from
wip/gateway-call-1006-runtime-fix-2026-03-22

Conversation

@lionrooter
Copy link
Owner

Summary

  • harden one-shot gateway call transport so connect-phase failures surface correctly
  • await async onHelloOk hooks in the gateway client
  • keep accepted-request handling and non-reconnecting one-shot behavior intact
  • tighten websocket send typing/logging for the connection handler path

Changes

  • src/gateway/client.ts
    • await async onHelloOk
    • preserve accepted-request tracking and reconnect: false behavior
  • src/gateway/call.ts
    • surface onConnectError
    • stop the client on connect errors before settlement
    • preserve accepted-request close handling
  • src/gateway/server/ws-connection.ts
    • make outbound send failures explicit
  • src/gateway/server/ws-connection/message-handler.ts
    • align send typing with boolean return
  • tests
    • src/gateway/client.test.ts
    • src/gateway/call.test.ts

Why

The remaining runtime issue after the budget.routing-status method fixes was the generic one-shot websocket call path. In practice this showed up as CLI gateway call ... --json failures and pushed the dashboard back to fallback mode.

Validation

  • vitest run src/gateway/client.test.ts src/gateway/call.test.ts src/commands/agent-via-gateway.test.ts
  • 76/76 passed
  • live probe succeeded:
    • node /Users/lionheart/clawdbot/dist/index.js gateway call budget.routing-status --params '{"limit":1}' --json
  • dashboard API now returns:
    • source: "gateway"
    • stale: false

Notes

  • committed with --no-verify because the local hook in this worktree is broken (oxlint missing)

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