Skip to content

Document colocated localhost Grok Bot bridge setup - #2

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
cursor/colocated-bridge-docs-d0d9
Aug 14, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
cursor/colocated-bridge-docs-d0d9

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

The working grok-bot path today is a host-process-only topology: npm start on the Grok Bot computer so both the gateway and the callback stay on that host's localhost:

  • GROK_BOT_GATEWAY_URL=http://127.0.0.1:1340
  • BRIDGE_PUBLIC_URL=http://127.0.0.1:8788
  • BRIDGE_HTTP_HOST=127.0.0.1

This is not docker compose on that computer. Inside a container, 127.0.0.1:1340 is the container, not the host gateway, and binding the callback to the container loopback makes Compose's published port unreachable. Docker on the same host is documented as a different setup (host.docker.internal / extra_hosts; do not bind the callback to container localhost if you need a published port).

The split-machine + Tailscale/tunnel path remains for when the bridge runs elsewhere.

Also documented:

  • Copy .env.example → .env, set AGENT_BACKEND=grok-bot and the localhost URLs
  • GROK_BOT_TOKEN from that computer’s gateway.json (example path used by Grok Bot computers: /home/box/sand-data/gateway.json)
  • GROK_BOT_AGENT_ID from POST /api/listAgents (no real id in the repo)
  • Generate BRIDGE_REPLY_TOKEN; do not commit it
  • npm ci && npm run build && npm start
  • A while true loop only restarts a crashed child while that shell stays alive. A Grok Bot computer Update stops running processes, including the wrapper; something outside that shell must start the bridge again after an Update
  • Keep the Discord application private / allowlisted

Identity sweep: no operator-specific Discord app secrets, snowflakes, personal names, emails, or real agent UUIDs in tracked files. Tests keep obviously fake values. .gitignore still excludes .env and *.log. Runtime behavior is unchanged; .env.example comments only.

Test plan

  • README + PHASE2 describe both topologies (colocated host process, split-machine + Tailscale/tunnel)
  • Colocated localhost is host-process-only; Docker on the same host is a different setup
  • Restart loop is documented as crash-only; Update requires an external relaunch
  • .env.example comments match both topologies without changing defaults
  • npm test (53 tests) and npm run build pass
Open in Web Open in Cursor 

Describe running the Node bridge on the Grok Bot computer (127.0.0.1:1340/8788) as a first-class option, and keep the split-machine Tailscale/tunnel path for when the bridge is elsewhere.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@FlyOverCoderKY
FlyOverCoderKY marked this pull request as ready for review August 14, 2026 18:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be1de5ecfb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/PHASE2-GROK-BOT-BACKEND.md Resolved
Comment thread README.md Resolved
Exclude Docker Compose from the 127.0.0.1 topology, and document that the while-loop only restarts a crashed child — it does not survive a Grok Bot computer Update.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 3657468 into main Aug 14, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the cursor/colocated-bridge-docs-d0d9 branch August 30, 2026 00:26
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.

2 participants