Skip to content

fix: codex webhook receiver launched without env, crash-looping on missing secret#41

Merged
ThinkOffApp merged 1 commit into
mainfrom
fix/codex-webhook-env-chain
Jul 16, 2026
Merged

fix: codex webhook receiver launched without env, crash-looping on missing secret#41
ThinkOffApp merged 1 commit into
mainfrom
fix/codex-webhook-env-chain

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Problem

start_receiver in scripts/codex-webhook-supervisor.sh builds a backslash-continuation chain of WEBHOOK_WAKE_* env assignments that ends with NODE_BIN=$(command -v node ...) on its own continuation line. That makes the entire chain an assignment-only statement: the variables become plain shell variables of the supervisor and are never exported. The node receiver is then launched on the next line with none of them set, so webhook-wake.mjs exits code 2 on the missing WEBHOOK_WAKE_SECRET and the supervisor relaunches it every 30s.

Net effect: @codexmb's low-latency wake webhook has been dead the whole time (log full of WEBHOOK_WAKE_SECRET missing or too short), and codex only woke via the slow poller. The claudemb twin (webhook-supervisor.sh) never had the bug because its env prefix sits on the same line as the node invocation.

Fix

Resolve NODE_BIN on its own line first, keep the env-assignment prefix attached to the node command. Comment added so the next edit doesn't reintroduce it.

Verification (live on the MB)

  • launchctl kickstart -k gui/501/com.thinkoff.codex-webhook-supervisor
  • receiver up: webhook-wake listening on 127.0.0.1:8791, node LISTENing on :8791
  • tunnel registered with GroupMind: http 200
  • POST to /hook/<secret> returns 200; non-owner/self payload correctly skipped (skip: not owner/mention)

🤖 Generated with Claude Code

…ssing secret

start_receiver's env-assignment chain ended with NODE_BIN=$(...) on its own
continuation line, turning the whole chain into an assignment-only statement.
The node receiver was then launched on the next line with none of the
WEBHOOK_WAKE_* variables exported, so webhook-wake.mjs exited immediately on
the missing secret and the supervisor relaunched it every 30s. Net effect:
@codexmb's low-latency wake webhook has been dead since the chain was added,
codex only woke via the slow poller.

Resolve NODE_BIN on its own line first, keep the env prefix attached to the
node invocation. Verified live on the MB: receiver listening on :8791,
tunnel registered (http 200), POST with secret accepted and self-messages
skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@ThinkOffApp ThinkOffApp left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Adversarial review complete. The fix correctly resolves NODE_BIN before the environment-assignment command, preserving the env prefix on the node invocation. I found no blocking correctness issue in this 5-line change. Merge remains subject to Petrus's approval. GitHub does not allow this account to approve its own pull request, so this is recorded as a comment review.

@ThinkOffApp
ThinkOffApp merged commit 03d8b01 into main Jul 16, 2026
3 checks passed
@ThinkOffApp
ThinkOffApp deleted the fix/codex-webhook-env-chain branch July 16, 2026 08:52
ThinkOffApp added a commit that referenced this pull request Jul 16, 2026
Approve-by-reply on cards, native-CLI-prompt limitation, no-push-
without-relay caveat, and the webhook-doorbell-vs-polling sentence
(with the dead-doorbell-looks-like-a-slow-agent warning from #41).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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