fix(bridge): align inspector messages to kind field convention - #432
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 3 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe inspector bridge renames message discriminator fields from ChangesInspector bridge message contract
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 withtypeas the discriminator field (e.g.{ source: 'amicode', type: 'run:iteration', ... }), but the relay scripts inchat_panel.tsanddeck/shell.tsfilter ond.kind(d.kind.indexOf('run:') === 0). Every other extension message useskind— this was the only holdout, causing a complete failure of the run data path into the SolidJS app iframe.Fix: Rename
type→kindin theRunBridgeMessage,DeviceBridgeMessage, andInspectorReversetype 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
kindfield across run, device, and reverse messages.