Skip to content

fix(bridge): align inspector messages to kind field convention - #432

Merged
jeonghun-jj-lee merged 1 commit into
mainfrom
fix/inspector-bridge-kind-field
Aug 19, 2026
Merged

fix(bridge): align inspector messages to kind field convention#432
jeonghun-jj-lee merged 1 commit into
mainfrom
fix/inspector-bridge-kind-field

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a silent relay bug where all run/device messages from the inspector bridge were being dropped at the chat panel and deck shell relays.

Root cause: The inspector bridge (inspector_bridge.ts) was emitting messages with type as the discriminator field (e.g. { source: 'amicode', type: 'run:iteration', ... }), but the relay scripts in chat_panel.ts and deck/shell.ts filter on d.kind (d.kind.indexOf('run:') === 0). Every other extension message uses kind — this was the only holdout, causing a complete failure of the run data path into the SolidJS app iframe.

Fix: Rename typekind in the RunBridgeMessage, DeviceBridgeMessage, and InspectorReverse type unions, and in all broadcast call sites. The relay scripts and test mocks (which call the function API) require no changes.

Impact: Unblocks live optimization data flow to the Pulse Inspector sidebar tab in harmoniqs/opencode#214.

Testing: TypeScript compiles clean. 937/938 tests pass (1 pre-existing packaging test failure unrelated to this change).

Summary by CodeRabbit

  • Refactor
    • Updated inspector bridge message handling to use a consistent kind field across run, device, and reverse messages.
    • Preserved existing message payloads and behavior while improving communication consistency.

The relay scripts in chat_panel.ts and deck/shell.ts filter on
`d.kind.indexOf('run:') === 0`, but inspector_bridge.ts was emitting
messages with `type` as the discriminator field. This mismatch caused
all run/device messages to be silently dropped at the relay, never
reaching the SolidJS app iframe.

Rename `type` → `kind` in RunBridgeMessage, DeviceBridgeMessage, and
InspectorReverse unions + all broadcast call sites. The relay scripts
and test mocks (which call the function API) require no changes.

Part of harmoniqs/opencode#214.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 27489b50-ffa1-4e77-a344-cc90c9febc0a

📥 Commits

Reviewing files that changed from the base of the PR and between bcb0763 and 977f51e.

📒 Files selected for processing (1)
  • packages/extension/src/inspector_bridge.ts

Included review availability: Your plan provides up to 3 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The inspector bridge renames message discriminator fields from type to kind across run, device, and reverse message unions. Run and device broadcast envelopes emit the renamed field. Payloads and control flow remain unchanged.

Changes

Inspector bridge message contract

Layer / File(s) Summary
Rename message discriminators and broadcast fields
packages/extension/src/inspector_bridge.ts
Run, device, and reverse message unions use kind as their discriminator. Run and device broadcast functions emit kind without changing payload construction or control flow.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 977f5

This localized change aligns inspector messages with the existing relay contract and restores the intended run and device message flow; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the inspector bridge fix and the discriminator field change from type to kind.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/inspector-bridge-kind-field

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee merged commit b0b6908 into main Aug 19, 2026
7 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