Skip to content

feat(playground): sort functions by workflow size with numeric badges - #4302

Merged
sxlijin merged 9 commits into
canaryfrom
agent/sort-functions-with-numeric-node-badges
Jul 31, 2026
Merged

sxlijin merged 9 commits into
canaryfrom
agent/sort-functions-with-numeric-node-badges

Conversation

@sxlijin

@sxlijin sxlijin commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep numeric node-count badges and default function ordering by rendered call-graph node count, largest first; omit the inline badge for the common one-node case while retaining that count in sorting and the detail tooltip.
  • Add a compact sort control with Call graph node count and natural Alphanumeric ordering, so numeric segments compare numerically (Function2 before Function10) and case-equivalent ties retain source order. The selection persists while the sidebar remains mounted.
  • Show a function-row tooltip on mouse hover and keyboard focus with the full compiler-rendered signature, file at line:column, and call-graph node count.
  • Preserve compatibility with older playground runtimes by treating the new signature and source-position fields as optional in the TypeScript protocol.
  • Remove folder icons from namespace disclosure rows while preserving their chevrons, indentation, click targets, accessibility, and expanded/collapsed behavior.
  • Preserve source order as the deterministic tie-breaker for equal node counts.

Linear: B-1109 — how to navigate the function list?

Testing

  • pnpm format:ci --since=origin/canary --reporter=github — passed (warnings only).
  • pnpm --filter @b/pkg-playground test — 155 tests passed.
  • pnpm --filter @b/pkg-playground typecheck — passed.
  • pnpm --filter app-vscode-webview test:unit:run — 30 tests passed.
  • pnpm --filter app-vscode-webview test:browser:run — 2 tests passed.
  • pnpm --filter app-vscode-webview typecheck — passed.
  • pnpm --filter app-vscode-webview build — passed.
  • Real local baml playground verification confirmed Alphanumeric, omission of the one-node inline badge, and retention of Call graph nodes: 1 in the tooltip.

Screenshots

The original PR description contained broad before/after coverage for nine projects and two sidebar widths. These focused captures cover the requested follow-up behavior using the production playground component.

Real baml-demos/aie project

Captured from the real ~/work-repos/baml-demos/aie project using this PR's Rust playground server and built webview. It shows all 94 functions, the agent namespace expanded in the default node-count order, numeric badges only for functions with more than one node, one-node rows without badges, namespace chevrons without folder icons, and the open sort menu.

Real baml-demos/aie project in the updated playground

Function row hover details

The one-node function has no inline count badge, while hover still exposes the full compiler signature, source location, and Call graph nodes: 1.

Function signature, source position, and call-graph node count

Sort order control

Node-count and natural alphanumeric sort choices

Namespace rows without folder icons

The updated rows retain only their disclosure chevrons:

Nested namespace rows with chevrons and no folder icons

Summary by CodeRabbit

  • New Features

    • Function details now include signatures, source locations, origins, and workflow information through tooltips.
    • View workflow node counts and sort functions alphanumerically or by workflow size.
  • UI Improvements

    • Refined sidebar loading, status, folder, and empty-state presentation.
    • Improved accessibility and duplicate preview-name formatting.
  • Bug Fixes

    • Prevented outdated control-flow results from replacing current project data.
    • Improved control-flow request tracking across playground connections.

@vercel

vercel Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview Jul 31, 2026 10:38pm
promptfiddle2 Ready Ready Preview Jul 31, 2026 10:38pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Function metadata now includes rendered signatures and source positions across Rust and TypeScript interfaces. The playground correlates CFG responses with request IDs, computes workflow-node counts, and supports stable function sorting with metadata tooltips.

Changes

Function metadata and sidebar enhancements

Layer / File(s) Summary
Function signature and source extraction
baml_language/crates/baml_project/src/symbols.rs, baml_language/crates/baml_project/src/lib.rs
FunctionSymbol renders signatures and project-relative source positions. Tests verify generic signatures and source locations.
Function metadata and CFG protocol transport
baml_language/crates/bex_project/..., baml_language/crates/bridge_wasm/..., baml_language/crates/baml_lsp_server/..., typescript2/pkg-playground/src/worker-protocol.ts, typescript2/pkg-playground/src/ports/*, typescript2/app-*/**/baml-worker.ts
LSP, WASM, WebSocket, worker, and runtime paths carry function metadata and optional CFG request IDs.
CFG synchronization and workflow-count model
typescript2/pkg-playground/src/ExecutionPanel.tsx, typescript2/pkg-playground/src/function-sidebar-tree.ts, typescript2/pkg-playground/src/function-sidebar-workflow-size.test.ts, typescript2/app-vscode-webview/src/ExecutionPanel.strict-mode.test.tsx
CFG requests receive per-function IDs. Stale responses are ignored. Current-build node counts drive stable alphabetical or workflow-count sorting.
Sidebar metadata and interactions
typescript2/pkg-playground/src/FunctionSidebar.tsx, typescript2/app-vscode-webview/src/FunctionSidebar.interaction.test.tsx
The sidebar displays function metadata and workflow counts through tooltips. A sort menu selects the ordering. Tests cover metadata, sorting, and project updates.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExecutionPanel
  participant WorkerProtocol
  participant BamlWasmRuntime
  participant PlaygroundServer
  participant FunctionSidebar
  ExecutionPanel->>WorkerProtocol: send CFG request with requestId
  WorkerProtocol->>BamlWasmRuntime: forward function and requestId
  BamlWasmRuntime->>PlaygroundServer: request CFG with requestId
  PlaygroundServer-->>WorkerProtocol: return CFG result with requestId
  WorkerProtocol-->>ExecutionPanel: deliver correlated CFG result
  ExecutionPanel->>FunctionSidebar: pass current workflowNodeCounts
  FunctionSidebar->>FunctionSidebar: sort and display function metadata
Loading

Possibly related PRs

Poem

A rabbit sends each graph its ID,
And sorts the sidebar side by side.
Signatures and source positions appear,
Stale responses disappear.
Workflow counts guide every hop.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: sorting playground functions by workflow size and displaying numeric badges.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/sort-functions-with-numeric-node-badges

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.

❤️ Share

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

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 00:24 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 31, 2026 00:32 Inactive
@sxlijin
sxlijin force-pushed the agent/sort-functions-with-numeric-node-badges branch from 3912667 to d12af66 Compare July 31, 2026 19:57
@linear

linear Bot commented Jul 31, 2026

Copy link
Copy Markdown

B-1109

@sxlijin sxlijin changed the title Sort playground functions by workflow size with numeric node-count badges feat(playground): sort functions by workflow size with numeric badges Jul 31, 2026
@sxlijin
sxlijin marked this pull request as ready for review July 31, 2026 19:58

sxlijin commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 19:59 Inactive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d12af66f7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 31, 2026 20:06 Inactive
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 27.6 MB 11.7 MB file 27.4 MB +185.0 KB (+0.7%) OK
✅ packed-program Linux 🔒 17.9 MB 7.4 MB file 17.7 MB +219.7 KB (+1.2%) OK
✅ baml-cli macOS 🔒 21.4 MB 10.3 MB file 21.3 MB +130.5 KB (+0.6%) OK
✅ packed-program macOS 🔒 14.0 MB 6.5 MB file 13.8 MB +160.9 KB (+1.2%) OK
✅ baml-cli Windows 🔒 23.1 MB 10.5 MB file 23.0 MB +109.0 KB (+0.5%) OK
✅ packed-program Windows 🔒 14.9 MB 6.6 MB file 14.8 MB +153.7 KB (+1.0%) OK
✅ bridge_wasm WASM 17.0 MB 🔒 4.6 MB gzip 4.6 MB +28.7 KB (+0.6%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 20:15 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
typescript2/pkg-playground/src/FunctionSidebar.tsx (1)

367-425: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider hoisting TooltipProvider above the per-row and per-button instances.

Each function leaf row (Line 372) and the sort button (Line 541) wraps itself in its own TooltipProvider. Radix UI's docs describe TooltipProvider as intended to wrap the app, or at least a section, once — not per individual tooltip. Wrapping every row individually works, but it forfeits the shared cross-tooltip delay/skip-delay behavior and creates one extra context provider per rendered function, which is measurable for projects with many functions.

Move a single TooltipProvider up to wrap the whole functions list (and the sort control) once, and remove the per-instance providers.

Also applies to: 523-613

🤖 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 `@typescript2/pkg-playground/src/FunctionSidebar.tsx` around lines 367 - 425,
Hoist a single TooltipProvider to wrap the entire functions list and sort
control, then remove the per-row provider around the function leaf rendering and
the per-button provider around the sort control. Keep each Tooltip and
TooltipTrigger/TooltipContent structure unchanged while ensuring both
FunctionSidebar leaf rows and the sort button share the provider context.
baml_language/crates/baml_project/src/symbols.rs (1)

233-257: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider caching the per-file LineIndex instead of rebuilding it per function.

function_source_position builds a fresh LineIndex::new(source_file.text(db)) on every call. When a file contains many functions, list_functions_with_metadata recomputes the same line index once per function in that file. Building a per-file cache (or making this a salsa-tracked query keyed on the file) avoids the repeated linear scan.

🤖 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_project/src/symbols.rs` around lines 233 - 257,
Update function_source_position to reuse a cached or Salsa-tracked LineIndex
keyed by source_file instead of constructing
LineIndex::new(source_file.text(db)) for every function. Preserve the existing
offset-to-position and fallback behavior while ensuring functions from the same
file share one index.
🤖 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.

Inline comments:
In `@typescript2/pkg-playground/src/FunctionSidebar.tsx`:
- Line 338: Add aria-hidden="true" to the isInternal origin badge span in the
FunctionSidebar button rendering, matching the existing workflowNodeCount badge
treatment so the visible function label remains the button’s sole accessible
name.

---

Nitpick comments:
In `@baml_language/crates/baml_project/src/symbols.rs`:
- Around line 233-257: Update function_source_position to reuse a cached or
Salsa-tracked LineIndex keyed by source_file instead of constructing
LineIndex::new(source_file.text(db)) for every function. Preserve the existing
offset-to-position and fallback behavior while ensuring functions from the same
file share one index.

In `@typescript2/pkg-playground/src/FunctionSidebar.tsx`:
- Around line 367-425: Hoist a single TooltipProvider to wrap the entire
functions list and sort control, then remove the per-row provider around the
function leaf rendering and the per-button provider around the sort control.
Keep each Tooltip and TooltipTrigger/TooltipContent structure unchanged while
ensuring both FunctionSidebar leaf rows and the sort button share the provider
context.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9300f077-71e3-4486-a992-655f471b6033

📥 Commits

Reviewing files that changed from the base of the PR and between 098a8ce and d12af66.

⛔ Files ignored due to path filters (39)
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/aie-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/aie-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/aie-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/aie-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-c-compiler-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-c-compiler-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-c-compiler-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-c-compiler-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-deep-research-demo-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-deep-research-demo-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-deep-research-demo-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-deep-research-demo-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-email-agent-demo-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-email-agent-demo-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-email-agent-demo-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-email-agent-demo-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-text-to-sql-demo-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-text-to-sql-demo-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-text-to-sql-demo-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/baml-text-to-sql-demo-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/bamlcode-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/bamlcode-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/bamlcode-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/bamlcode-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/claude-session-quality-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/claude-session-quality-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/claude-session-quality-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/claude-session-quality-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/function-hover-details-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/function-sort-menu-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/google-adk-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/google-adk-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/google-adk-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/google-adk-wide-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/namespace-rows-no-folder-icons-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/python-discord-bot-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/python-discord-bot-before.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/python-discord-bot-wide-after.png is excluded by !**/*.png
  • typescript2/pkg-playground/docs/workflow-node-count-number-badges/python-discord-bot-wide-before.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • baml_language/crates/baml_project/src/lib.rs
  • baml_language/crates/baml_project/src/symbols.rs
  • baml_language/crates/bex_project/src/bex_lsp/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rs
  • baml_language/crates/bridge_wasm/src/wasm_playground.rs
  • typescript2/app-vscode-webview/src/FunctionSidebar.interaction.test.tsx
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/FunctionSidebar.tsx
  • typescript2/pkg-playground/src/function-sidebar-tree.ts
  • typescript2/pkg-playground/src/function-sidebar-workflow-size.test.ts
  • typescript2/pkg-playground/src/worker-protocol.ts

@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 20:20 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 20:27 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
baml_language/crates/bridge_wasm/src/wasm_playground.rs (1)

359-366: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Make optional playground fields compatible with older wire shapes.

wasm_playground::FunctionInfo declares signature: String and source_position: FunctionSourcePosition, while the mapping reads f.signature and f.source_position.* directly. Mark these fields as Option<T> with serialization defaults/defaults so payloads from older toolchains or runtimes that omit metadata still deserialize; treat None in the UI as “schema not available”.

🤖 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/bridge_wasm/src/wasm_playground.rs` around lines 359 -
366, Update wasm_playground::FunctionInfo and its mapping to make signature and
source_position optional, including serde defaults and Rust defaults so older
payloads missing metadata deserialize successfully. Adjust the source-position
field mapping and UI consumers to handle None as “schema not available,” while
preserving existing behavior when metadata is present.
🧹 Nitpick comments (1)
typescript2/pkg-playground/src/ports/WebSocketRuntimePort.test.ts (1)

238-287: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add coverage for the omitted-requestId compatibility path.

The new test only covers the case where requestId is present. Add a case that posts requestControlFlowGraph without requestId and confirms the serialized frame omits the field, and a case where the server sends controlFlowGraphResult without requestId and confirms it's still delivered to the consumer. This is the actual backward-compatibility scenario the optional field exists to support.

🤖 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 `@typescript2/pkg-playground/src/ports/WebSocketRuntimePort.test.ts` around
lines 238 - 287, Extend the WebSocketRuntimePort control-flow graph tests around
the existing optional request ID case to cover omitted requestId compatibility:
verify a requestControlFlowGraph posted without requestId serializes without
that field, and verify a controlFlowGraphResult received without requestId is
delivered unchanged to the consumer. Reuse the existing FakeWebSocket setup and
assertions in the test block.
🤖 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.

Outside diff comments:
In `@baml_language/crates/bridge_wasm/src/wasm_playground.rs`:
- Around line 359-366: Update wasm_playground::FunctionInfo and its mapping to
make signature and source_position optional, including serde defaults and Rust
defaults so older payloads missing metadata deserialize successfully. Adjust the
source-position field mapping and UI consumers to handle None as “schema not
available,” while preserving existing behavior when metadata is present.

---

Nitpick comments:
In `@typescript2/pkg-playground/src/ports/WebSocketRuntimePort.test.ts`:
- Around line 238-287: Extend the WebSocketRuntimePort control-flow graph tests
around the existing optional request ID case to cover omitted requestId
compatibility: verify a requestControlFlowGraph posted without requestId
serializes without that field, and verify a controlFlowGraphResult received
without requestId is delivered unchanged to the consumer. Reuse the existing
FakeWebSocket setup and assertions in the test block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d3a8c50b-fd64-4e11-a26a-624161ba58d5

📥 Commits

Reviewing files that changed from the base of the PR and between d12af66 and 4201c1a.

📒 Files selected for processing (13)
  • baml_language/crates/baml_lsp_server/src/playground_server.rs
  • baml_language/crates/baml_lsp_server/src/playground_ws.rs
  • baml_language/crates/bex_project/src/bex_lsp/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rs
  • baml_language/crates/bridge_wasm/src/lib.rs
  • baml_language/crates/bridge_wasm/src/wasm_playground.rs
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • typescript2/app-vscode-webview/src/ExecutionPanel.strict-mode.test.tsx
  • typescript2/app-website/playground/baml-worker.ts
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/ports/WebSocketRuntimePort.test.ts
  • typescript2/pkg-playground/src/ports/WebSocketRuntimePort.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/mod.rs
  • typescript2/pkg-playground/src/worker-protocol.ts

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 31, 2026 20:34 Inactive
@sxlijin
sxlijin added this pull request to the merge queue Jul 31, 2026
@sxlijin
sxlijin removed this pull request from the merge queue due to a manual request Jul 31, 2026
@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 22:22 Inactive

sxlijin commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the two top-level CodeRabbit notes from the previous review:

  • Added the omitted-requestId WebSocket compatibility regression in d28b346651: requests without the field serialize without it, and untagged CFG results are delivered unchanged. The focused suite is 12/12 and the full playground package is 155/155.
  • No Rust change for the wasm_playground::FunctionInfo suggestion: that bridge type derives Serialize only and is constructed from the current in-process bex_project::FunctionInfo; it does not deserialize payloads from older runtimes. Older WASM/runtime compatibility is handled at the receiving TypeScript protocol, where signature and sourcePosition are optional and the UI already falls back when they are absent. Making the current outbound Rust metadata optional would weaken the current-runtime contract without enabling old-payload deserialization.

@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 22:23 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 31, 2026 22:31 Inactive
@sxlijin
sxlijin enabled auto-merge July 31, 2026 22:32
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 31, 2026 22:38 Inactive
@sxlijin
sxlijin added this pull request to the merge queue Jul 31, 2026
Merged via the queue into canary with commit 7d83d5f Jul 31, 2026
85 checks passed
@sxlijin
sxlijin deleted the agent/sort-functions-with-numeric-node-badges branch July 31, 2026 22:55

This branch was previously deployed

2 inactive deployments
Preview – promptfiddle2 — 3edf3f7f Deployed Jul 31, 2026 by vercel[bot]
Preview – beps — 3edf3f7f Deployed Jul 31, 2026 by vercel[bot]
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