Skip to content

feat(core): cut the remaining five bridges over to createBridgeMesh - #59

Merged
Mearman merged 2 commits into
mainfrom
feat/p2-remaining-bridges
Sep 11, 2026
Merged

feat(core): cut the remaining five bridges over to createBridgeMesh#59
Mearman merged 2 commits into
mainfrom
feat/p2-remaining-bridges

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Stacked on #58 (needs its createBridgeMesh factory). Completes step 5 of #47's sequencing: every bridge (codex, claude-code, opencode, pi, user/controller.ts) now runs on WireMeshTransport via createBridgeMesh, matching the mcp bridge's own cutover in #58.

Also included: a real, reproducible test-infra bug found while running the full suite to verify this change. uniquePort() in approval.integration.test.ts/wire-mesh-transport-approval.integration.test.ts derived a second port by adding an arithmetic offset to an OS-assigned free port; when the OS handed back a port already near the top of the valid range, the combined offset pushed the result past 65535 and the test failed with ERR_SOCKET_BAD_PORT. Fixed by asking the OS for each port independently instead of deriving one from another.

All 92 tests pass, typecheck and lint clean.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-11T18:41:40.349377Z e754f68 PR opened

Security findings

Advisory findings (1)

ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Base automatically changed from feat/p2-cut-mcp-bridge to main September 11, 2026 18:33
@Mearman
Mearman force-pushed the feat/p2-remaining-bridges branch from e754f68 to c290f36 Compare September 11, 2026 18:35

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: e754f68c29

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/bridges/codex/tool.ts
codex, claude-code, opencode, pi, and user/controller.ts all repeated the
same four-line block constructing MeshStore/TlsTransport directly against
identity.fingerprint. Replace each with createBridgeMesh, matching the mcp
bridge's own cutover and completing step 5 of P2's sequencing: every bridge
now runs on WireMeshTransport with peerId derived from the device-id.

user/controller.ts's constructor takes an optional coordinatorPort, which
createBridgeMesh already accepts as its own second argument, so no
adaptation was needed there beyond the substrate swap itself.
uniquePort() returned an OS-assigned free port plus an ever-growing offset,
and every caller then added another 100 on top to derive a second port.
When the OS happened to hand back a port already near the top of the valid
range, the combined offset pushed the result past 65535, failing with
ERR_SOCKET_BAD_PORT -- reproduced directly while running the suite in this
session.

Each port a test needs is now its own independent call to the OS for a free
ephemeral port, with no arithmetic layered on top, removing the overflow
entirely. The original offsetting existed to guard against two rapid
findFreePort() calls returning the same port; that guard was misplaced,
since the OS already won't hand out a port currently bound by an open
listener, and two independent free-port lookups are not exposed to the
same risk this fix removes.
@Mearman
Mearman force-pushed the feat/p2-remaining-bridges branch from c290f36 to 312703a Compare September 11, 2026 19:16
@Mearman
Mearman merged commit 84613af into main Sep 11, 2026
5 checks passed
@Mearman
Mearman deleted the feat/p2-remaining-bridges branch September 11, 2026 19:18
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant