Skip to content

Improve bridge dispatch and Codex app-server handshake#50

Merged
axeldelafosse merged 2 commits intomainfrom
codex/bridge-slice-1
Mar 27, 2026
Merged

Improve bridge dispatch and Codex app-server handshake#50
axeldelafosse merged 2 commits intomainfrom
codex/bridge-slice-1

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

Summary

  • extract shared bridge dispatch and guidance helpers
  • validate Claude bridge replies against the active bridge chat id
  • send initialized after initialize for Codex App Server clients and bridge injections
  • opt bridge injections out of unused Codex App Server notifications
  • add regression coverage for stale tmux delivery status and bridge/app-server handshake behavior

Verification

  • bun run check
  • bun test
  • bun run build

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the bridge messaging system by modularizing dispatch logic and agent guidance into dedicated files. It also enhances the Codex app server integration by implementing a formal initialization handshake and allowing for notification method opt-outs. A validation check for the active bridge conversation was added to the reply tool. Feedback suggests exporting the notification opt-out constant to improve test maintainability.

Comment on lines +82 to +88
const BRIDGE_OPT_OUT_NOTIFICATION_METHODS = [
METHOD_ERROR,
METHOD_ITEM_COMPLETED,
METHOD_ITEM_DELTA,
METHOD_TURN_COMPLETED,
METHOD_TURN_STARTED,
] as const;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve test maintainability and avoid hardcoding values, consider exporting BRIDGE_OPT_OUT_NOTIFICATION_METHODS. This would allow the test file (tests/loop/codex-app-server.test.ts) to import and use this constant directly, making the tests less brittle to future changes in these notification methods.

Suggested change
const BRIDGE_OPT_OUT_NOTIFICATION_METHODS = [
METHOD_ERROR,
METHOD_ITEM_COMPLETED,
METHOD_ITEM_DELTA,
METHOD_TURN_COMPLETED,
METHOD_TURN_STARTED,
] as const;
export const BRIDGE_OPT_OUT_NOTIFICATION_METHODS = [
METHOD_ERROR,
METHOD_ITEM_COMPLETED,
METHOD_ITEM_DELTA,
METHOD_TURN_COMPLETED,
METHOD_TURN_STARTED,
] as const;

@axeldelafosse axeldelafosse marked this pull request as ready for review March 27, 2026 21:32
@axeldelafosse axeldelafosse merged commit 4db5f2b into main Mar 27, 2026
2 checks passed
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