Repository navigation
Implement canonical playground RunStore migration - #3786
Conversation
Move playground execution state behind Rust-owned RunStore snapshots and patches, delete browser runtime-event reconstruction, and add native/WASM run protocol support. Include TASK plan, references, and implementation findings for peer handoff context.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds run-based playground execution across the CLI, native server, WASM bridge, and editor UI, and packages playground assets into releases. It also expands tracing/profiling artifacts, wire formats, and reconstruction support. ChangesPlayground run protocol and profiling
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Allow baml lsp --playground-via-browser --workspace <path> to seed project discovery outside an editor client and open the first discovered project.
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
|
No description provided. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
baml_language/crates/baml_lsp_server/src/playground_server.rs (1)
128-144: Extract duplicatedencoded_success_outcomehelper function to shared location.This function has an identical implementation in
bridge_wasm/src/lib.rs:1086-1102. Consider moving it tobridge_ctypes(which already contains the underlyingexternal_to_outboundfunction and is a shared dependency of both crates) to avoid maintenance drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_lsp_server/src/playground_server.rs` around lines 128 - 144, The function encoded_success_outcome in playground_server.rs is duplicated in bridge_wasm/src/lib.rs with identical implementation. Move the encoded_success_outcome function to the bridge_ctypes crate (which is a shared dependency of both crates and already contains the external_to_outbound function it depends on), then remove the duplicate implementation from both playground_server.rs and bridge_wasm/src/lib.rs, and import the function from bridge_ctypes in both locations instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@baml_language/crates/baml_lsp_server/src/playground_server.rs`:
- Around line 128-144: The function encoded_success_outcome in
playground_server.rs is duplicated in bridge_wasm/src/lib.rs with identical
implementation. Move the encoded_success_outcome function to the bridge_ctypes
crate (which is a shared dependency of both crates and already contains the
external_to_outbound function it depends on), then remove the duplicate
implementation from both playground_server.rs and bridge_wasm/src/lib.rs, and
import the function from bridge_ctypes in both locations instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 425b61fb-ad6c-4074-aa09-038a6a50775b
📒 Files selected for processing (10)
baml_language/crates/baml_lsp_server/src/playground_server.rsbaml_language/crates/bex_events/src/prof/read.rsbaml_language/crates/bex_events/src/run.rsbaml_language/crates/bridge_wasm/src/lib.rstypescript2/pkg-playground/src/ExecutionPanel.tsxtypescript2/pkg-playground/src/FunctionSidebar.tsxtypescript2/pkg-playground/src/index.tstypescript2/pkg-playground/src/ports/WebSocketRuntimePort.tstypescript2/pkg-playground/src/serialized-test-tree.tstypescript2/pkg-playground/src/worker-protocol.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- baml_language/crates/bex_events/src/prof/read.rs
- baml_language/crates/bridge_wasm/src/lib.rs
The pkg-playground RunStore migration (#3786) replaced the old callFunction/callTestFunction worker messages — and the matching WASM methods, now removed — with startRun/startTestRun and runStarted/runPatch streaming. The app-website worker still spoke the old protocol, so both run paths silently no-op'd: the LivePlayground "Run" button (panel sends startRun, no handler) and the learn2 BamlEditor "Run" codelens (called WASM methods that no longer exist). Bring app-website/playground/baml-worker.ts onto the new protocol (mirroring app-promptfiddle's worker) and have app/learn2/_editor/runtime.ts reuse the shared client instead of bespoke messages: createRunStoreClient + WorkerRuntimePort + applyRunPatch + decodeRunResultValue. Export decodeRunResultValue from pkg-playground. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Move playground execution state behind Rust-owned RunStore snapshots and patches, delete browser runtime-event reconstruction, and add native/WASM run protocol support.
Summary by CodeRabbit
New Features
baml playgroundCLI command to open the playground in your browser.Improvements
.bamlprofreconstruction across native, browser, and WASM.Documentation