You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] ocx hub invite prints only "Minting a pairing code failed (rejected)" when corsAllowOrigins is missing or not yet loaded #8319
On a fresh Hub, ocx hub invite --clients codex fails with only Minting a pairing code failed (rejected). It still fails after adding corsAllowOrigins, until the runtime is restarted. The message doesn't say which origin was rejected, which setting fixes it, or that a restart is needed.
Expected: the invite works from the Hub's own CLI, or the error names the rejected origin, the setting and the restart.
Reproduction
On a fresh Hub (Windows, OpenCodex Desktop), run ocx hub invite --clients codex → Minting a pairing code failed (rejected).
ocx config set corsAllowOrigins '["http://localhost:10100"]', invite again without restarting → same message.
Restart OpenCodex Desktop, invite again → works.
Cause: the request is refused by the browser-origin check (isRemoteGuiBrowserOriginAllowed). corsAllowOrigins is only read at startup (and ocx config set reports success without saying a restart is needed), and the CLI prints only the reason code.
Suggested fix:
Have the local CLI use an origin the Hub always allows from loopback, or skip the browser-origin check for local CLI calls.
Print the rejected origin, the setting that fixes it, and whether a restart is needed.
More generally, have ocx config set print "saved; takes effect after restart" for keys that aren't live-reloaded.
Version
2.98.0
Operating system
Windows 11 Pro 10.0.26300
Provider and model
No response
Logs or error output
Minting a pairing code failed (rejected).
Screenshots and supporting files
No response
Redacted configuration
corsAllowOrigins = ["http://localhost:10100"] (only effective after restart)
Checks
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
#8079 - feat(client): relay the hub management plane for local callers [open]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Thanks, the mechanism is confirmed on origin/dev f8dfc2f:
ocx hub invite picks the bound browser origin from the config on disk (src/cli/hub.ts:107-115, used at :330).
The running runtime checks that origin against the config it loaded at startup. The pairing route passes that startup config to createGuiPairingGrant (src/server/index/serve-options.ts:734), which refuses any origin not in hub.managementPublicOrigin or corsAllowOrigins (src/server/gui-session.ts:110-116, :278-280). The 403 is mapped to rejected (src/cli/gui-pair-client.ts:161), and runInvite prints only the reason (src/cli/hub.ts:335).
ocx config set prints only Set <path>. (src/cli/config-command.ts:297). We found no runtime reload path for corsAllowOrigins, so the running runtime needs a restart to pick it up.
Proposed small change (not implemented): on rejected, print the bound origin and a hint that a running runtime may predate corsAllowOrigins and must be restarted. Have config set print a restart note for keys that are read only at startup.
Making the local invite bypass the origin check would be a design change. A hub admits no loopback origin by default (src/server/gui-session.ts:110-116), so we are not proposing it here.
Fixed by #8495 (41536f6), merged into dev. A refused mint now names the bound origin, hub.managementPublicOrigin/corsAllowOrigins, and the restart command for this install. A 429 rate limit or any other refusal no longer points at the allow-list. ocx config set notes when corsAllowOrigins, hub, hub.managementPublicOrigin or hub.managementIngress need a restart. @shu-chen-dot-ca, thanks for offering to take this one. No PR had appeared after two days, so it was carried in an issue lane.
Activity
coderabbitai commentedon Nov 7, 2026
🔗 Related PRs
#8079 - feat(client): relay the hub management plane for local callers [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Ingwannu commentedon Nov 8, 2026
Thanks, the mechanism is confirmed on origin/dev f8dfc2f:
ocx hub invitepicks the bound browser origin from the config on disk (src/cli/hub.ts:107-115, used at:330).createGuiPairingGrant(src/server/index/serve-options.ts:734), which refuses any origin not inhub.managementPublicOriginorcorsAllowOrigins(src/server/gui-session.ts:110-116,:278-280). The 403 is mapped torejected(src/cli/gui-pair-client.ts:161), andrunInviteprints only the reason (src/cli/hub.ts:335).ocx config setprints onlySet <path>.(src/cli/config-command.ts:297). We found no runtime reload path forcorsAllowOrigins, so the running runtime needs a restart to pick it up.Proposed small change (not implemented): on
rejected, print the bound origin and a hint that a running runtime may predatecorsAllowOriginsand must be restarted. Haveconfig setprint a restart note for keys that are read only at startup.Making the local invite bypass the origin check would be a design change. A hub admits no loopback origin by default (
src/server/gui-session.ts:110-116), so we are not proposing it here.shu-chen-dot-ca commentedon Nov 9, 2026
I'll take this one and open a PR with the small change proposed above.
fix(cli): explain a rejected hub invite and startup-only config keys
lidge-jun commentedon Nov 10, 2026
Fixed by #8495 (41536f6), merged into
dev. A refused mint now names the bound origin,hub.managementPublicOrigin/corsAllowOrigins, and the restart command for this install. A 429 rate limit or any other refusal no longer points at the allow-list.ocx config setnotes whencorsAllowOrigins,hub,hub.managementPublicOriginorhub.managementIngressneed a restart. @shu-chen-dot-ca, thanks for offering to take this one. No PR had appeared after two days, so it was carried in an issue lane.fix(cli): explain a rejected hub invite and startup-only config keys (l…