Skip to content

Send the gateway port token (fixes 404 'The request could not be routed') - #169

Open
lamazzing wants to merge 1 commit into
ScriptedAlchemy:mainfrom
lamazzing:fix/gateway-port-token
Open

lamazzing wants to merge 1 commit into
ScriptedAlchemy:mainfrom
lamazzing:fix/gateway-port-token

Conversation

@lamazzing

Copy link
Copy Markdown

Since mid-November 2026, every gateway call (bots list, thread, ...) fails with listAgents failed: 404 The request could not be routed. The load balancer in front of the box now requires the x-anyrun-port-token header.

EnsureSandBox already returns that token as gatewayPortToken, and the Grok Bot app (1.1.0) sends it on every gateway request. This PR adds it to the headers derived from EnsureSandBox (headersFromEnsureSandbox), next to the network token.

  • The token is only sent to the allowlisted gateway URL, and it is never logged or stored.
  • Tests: new cases in test/gateway.test.js. npm test passes (510).
  • Verified live against Grok Bot 1.1.0: gbot bots list works again without any local patch.

🤖 Generated with Claude Code

Since mid-November 2026 the box's load balancer answers every gateway call
with 404 "The request could not be routed" unless it carries
x-anyrun-port-token. EnsureSandBox returns the token as gatewayPortToken and
the Grok Bot app (1.1) sends it on every gateway request; the CLI now adds it
to the EnsureSandBox-derived gateway headers. The token only goes to the
allowlisted gateway URL and is never logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 86046d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
grok-bot-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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