Skip to content

Conversation

@lucharo
Copy link
Contributor

@lucharo lucharo commented Jan 31, 2026

Summary

Fixes widget interactivity (sliders, dataframe sorting, etc.) in Islands mode by adding the required type discriminator field to control request messages.

The Islands bridge was sending control requests like:

{"objectIds":["Hbol-0"],"values":[58]}

But the kernel's msgspec parser expects:

{"type":"update-ui-element","objectIds":["Hbol-0"],"values":[58]}

Without the type field, msgspec throws ValidationError: Object missing required field 'type'.

Changes

  • Add type field to sendComponentValues, sendFunctionRequest, sendRun, and sendModelValue
  • Add token: generateUUID() to sendComponentValues for consistency with WASM bridge
  • Improve type safety: putControlRequest now uses CommandMessage instead of object
  • Add 7 unit tests for bridge control request formatting

Context

I discovered this bug while working on a project using marimo Islands. This PR was live-coded in ~20 minutes with Claude Code, including two rounds of external agent code reviews. I had minimal prior familiarity with this part of the codebase - just noticed the error in the console and traced it back to the missing type field by comparing with the WASM bridge implementation.

Test plan

  • TypeScript typecheck passes
  • 16 Islands tests pass (7 new + 9 existing)
  • Frontend lint passes
  • Manual test: Load Islands page with slider widget, verify interactions work without console errors

🤖 Generated with Claude Code

The Islands bridge was sending control requests without the required
`type` discriminator field, causing msgspec.ValidationError in the
kernel and breaking all widget interactivity (sliders, dataframe
sorting, etc.).

Changes:
- Add type field to sendComponentValues, sendFunctionRequest, sendRun,
  and sendModelValue methods
- Add token generation to sendComponentValues for consistency with
  WASM bridge
- Improve type safety by using CommandMessage instead of object
- Add unit tests for bridge control request formatting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 31, 2026 5:56am

Request Review

@mscolnick mscolnick merged commit bdaa0cb into marimo-team:main Jan 31, 2026
25 of 26 checks passed
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.8-dev4

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

Labels

None yet

2 participants