Skip to content

feat: make new promptfiddle user-friendly - #3864

Merged
sxlijin merged 1 commit into
canaryfrom
push-mmuzomoksnnx
Jun 27, 2026
Merged

sxlijin merged 1 commit into
canaryfrom
push-mmuzomoksnnx

Conversation

@sxlijin

@sxlijin sxlijin commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added a gateway/proxy toggle in the playground, with automatic initialization of default proxy settings.
    • Improved fetch log UI to display original request URLs when available, and to show raw (non-redacted) header values alongside redaction indicators when permitted.
    • Enhanced WASM playground request support for browser-origin scenarios.
  • Bug Fixes
    • Improved HTTP header observation/redaction so displayed values match the intended safety rules.
    • Improved proxy routing to preserve original destination details while filtering sensitive headers.
  • Tests
    • Added/updated coverage for proxy token gating and allowlisted API-key injection behavior.

@vercel

vercel Bot commented Jun 26, 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, Comment Jun 27, 2026 5:54am
promptfiddle Ready Ready Preview, Comment Jun 27, 2026 5:54am
promptfiddle2 Ready Ready Preview, Comment Jun 27, 2026 5:54am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Header values now flow through Rust and WebAssembly payloads, proxy requests can be rewritten through a Boundary proxy using baml-original-url, and the playground adds proxy configuration, URL display, and gateway toggles.

Changes

Boundary proxy and playground wiring

Layer / File(s) Summary
Header value contract
baml_language/crates/bex_events/src/run.rs, baml_language/crates/bex_events/src/run_wire.rs, typescript2/pkg-playground/src/run-store-projections.ts, typescript2/pkg-playground/src/worker-protocol.ts, baml_language/crates/baml_lsp_server/src/playground_runs.rs
HeaderObservation now carries optional values, wire payloads and worker types include them, and redacted header fixtures and projections use null values.
Header observation sources
baml_language/crates/baml_lsp_server/src/playground_http.rs, baml_language/crates/bridge_wasm/src/wasm_http.rs
Header collection now builds observations from (name, value) pairs through HeaderObservation::observe.
WASM proxy rewrite
baml_language/crates/sys_llm/src/build_request/mod.rs, baml_language/crates/sys_llm/src/build_request/anthropic.rs
WASM request building now routes through BOUNDARY_PROXY_URL, records baml-original-url, and adds the Anthropic browser-access header on wasm32.
Proxy server runtime
typescript/packages/fiddle-proxy/Dockerfile, typescript/packages/fiddle-proxy/server.js, typescript/README.md
The proxy image targets Node 24, server.js uses an ESM app factory with token gating and origin-based API-key injection, and the README tree removes the fiddle-proxy entry.
New proxy app and tests
typescript2/app-fiddleproxy/.dockerignore, typescript2/app-fiddleproxy/Dockerfile, typescript2/app-fiddleproxy/package.json, typescript2/app-fiddleproxy/server.js, typescript2/app-fiddleproxy/server.test.js
The new app-fiddleproxy package adds its Node 24 Docker image, proxy server implementation, and Vitest coverage for token and API-key behavior.
Proxy env config and seeding
typescript2/pkg-playground/src/proxy-config.ts, typescript2/pkg-playground/src/gateway.ts, typescript2/pkg-playground/src/index.ts, typescript2/app-promptfiddle/src/playground/SplitPreview.tsx, typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
Proxy env configuration is centralized, playground defaults are seeded once, the helpers are re-exported, and BOUNDARY_PROXY_URL is treated as optional in the worker.
Request URL and proxy toggle UI
typescript2/pkg-playground/src/ExecutionPanel.tsx, typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
Fetch logs render the original request URL from baml-original-url, and the API keys dialog adds the Boundary gateway toggle while hiding BOUNDARY_PROXY_URL from env-var lists.
Default playground template
typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
The default BAML template switches to Gpt5 and adjusts related template formatting.

Sequence Diagram(s)

sequenceDiagram
  participant SplitPreview.tsx
  participant proxy-config.ts
  participant gateway.ts
  participant ApiKeysDialog.tsx
  participant SessionStore
  SplitPreview.tsx->>proxy-config.ts: configureProxyEnvVar({ visible: true, url: BOUNDARY_PROXY_URL })
  SplitPreview.tsx->>gateway.ts: initPlaygroundEnv()
  gateway.ts->>SessionStore: seed defaults and BOUNDARY_PROXY_URL once
  ApiKeysDialog.tsx->>gateway.ts: onToggleProxy(!proxyEnabled)
  gateway.ts->>SessionStore: set or remove BOUNDARY_PROXY_URL
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Poem

Hoppity hop, I sniff the flow,
Through proxy tunnels, values glow.
A baml-original-url trail I see,
And gateway toggles dance with glee.
🐰✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 79.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and doesn't describe the specific Promptfiddle changes in this PR. Use a concise title that names the main change, such as adding the Boundary proxy flow and safer header handling for Promptfiddle.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 push-mmuzomoksnnx

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Trivy (0.69.3)

Trivy execution failed: 2026-06-27T05:36:53Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: cloudformation scan error: fs filter error: fs filter error: walk error range error: stat typescript2/app-fiddleproxy/doctor.config.json: no such file or directory: range error: stat typescript2/app-fiddleproxy/doctor.config.json: no such file or directory


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 June 26, 2026 23:52 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: 38ad18ead2

ℹ️ 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 June 26, 2026 23:58 Inactive
@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 21.5 MB 9.2 MB file 21.5 MB +20.0 KB (+0.1%) OK
✅ packed-program Linux 🔒 15.6 MB 6.6 MB file 15.6 MB +6.3 KB (+0.0%) OK
✅ baml-cli macOS 🔒 16.5 MB 8.0 MB file 16.1 MB +447.2 KB (+2.8%) OK
✅ packed-program macOS 🔒 12.1 MB 5.7 MB file 12.0 MB +132.8 KB (+1.1%) OK
✅ baml-cli Windows 🔒 18.1 MB 8.2 MB file 18.1 MB +3.6 KB (+0.0%) OK
✅ packed-program Windows 🔒 13.0 MB 5.8 MB file 13.0 MB +5.2 KB (+0.0%) OK
✅ bridge_wasm WASM 14.3 MB 🔒 4.1 MB gzip 4.1 MB +4.0 KB (+0.1%) 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

@sxlijin
sxlijin force-pushed the push-mmuzomoksnnx branch from 38ad18e to 0a98b8b Compare June 27, 2026 00:05
@vercel
vercel Bot temporarily deployed to Preview – beps June 27, 2026 00:06 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: 8

Caution

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

⚠️ Outside diff range comments (1)
typescript2/pkg-playground/src/components/ApiKeysDialog.tsx (1)

104-122: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Don’t hide a live BOUNDARY_PROXY_URL when the proxy UI is disabled.

These filters remove BOUNDARY_PROXY_URL from every list even when showProxyEnvVar is false. In those hosts, the generic add/import flows can still set the key, and the WASM runtime will still honor it for request rewriting, so users can end up with a hidden proxy target carrying their provider-authenticated traffic. Either reject this key when the dedicated toggle is hidden, or show it as a normal editable row instead of filtering it out.

🤖 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/components/ApiKeysDialog.tsx` around lines 104
- 122, The key filtering in ApiKeysDialog is hiding BOUNDARY_PROXY_URL even when
the proxy toggle is disabled, which leaves a live proxy target uneditable and
invisible. Update the primaryKeys and shellOnlyKeys logic so BOUNDARY_PROXY_URL
is only excluded when showProxyEnvVar is enabled and the dedicated proxy UI is
handling it; otherwise surface it as a normal editable row or reject it in the
add/import path. Use the ApiKeysDialog memoized key lists and the
BOUNDARY_PROXY_URL_KEY handling as the main places to fix.
🤖 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 `@baml_language/crates/baml_lsp_server/src/playground_runs.rs`:
- Around line 215-218: The redaction test for HeaderObservation in
playground_runs.rs only checks the fixture shape, so it can miss regressions
where redacted headers still serialize a value. Update the assertions around the
HeaderObservation snapshot/patch path to explicitly verify that value is null
whenever value_redacted is true, using the existing HeaderObservation and
requestHeaders serialization logic as the target for the check.

In `@baml_language/crates/bex_events/src/run.rs`:
- Around line 441-458: HeaderObservation::observe is currently trusting the
header name alone, which lets response headers with
DISPLAY_SAFE_HEADER_ORIGINAL_URL bypass redaction. Update the header handling
around HeaderObservation so the display-safe exemption is only applied on the
request path used by the proxy rewrite in build_request/mod.rs, and keep the
response-header collection path in playground_http.rs fully redacted. Use
separate request vs response observation logic, and keep the trusted
original-url value only for the proxy-injected request header.

In `@typescript/packages/fiddle-proxy/server.js`:
- Around line 103-127: The proxy routing in router() currently accepts any
caller-supplied baml-original-url and only checks apiKeyInjectionAllowed later
in proxyReq, which leaves this as an open proxy/SSRF path. Update router() so it
validates the parsed destination origin against the allowlist before returning
it, and reject any non-allowlisted origin immediately; keep the existing
proxyReq header injection logic in sync with the same allowlist source so both
routing and header injection use the same origin check.
- Around line 77-89: The auth gate in the Express middleware in server.js can be
bypassed when PROXY_PROMPTFIDDLE_COM_TOKEN is unset because only the
empty-string case is rejected and the header check is skipped for falsy values.
Update the middleware around the app.use token check to fail closed by treating
both missing and empty expectedToken as a configuration error, logging via
logger.error and returning 403 before any proxying occurs, while keeping the
existing PROXY_TOKEN_HEADER comparison and deletion logic for the valid-token
path.

In `@typescript/packages/fiddle-proxy/server.test.js`:
- Around line 8-16: The ALL_KEYS fixture is missing AI_GATEWAY_API_KEY, so the
buildApiKeyInjectionAllowed() setup fails before the API-key assertions run.
Update the ALL_KEYS object in server.test.js to include every provider key
expected by buildApiKeyInjectionAllowed() in server.js, including
AI_GATEWAY_API_KEY, so the test allowlist matches the real production list.

In `@typescript/packages/fiddle-proxy/set-origin-token-header.ts`:
- Around line 127-158: The entrypoint fetch handling in
set-origin-token-header.ts incorrectly treats any failed Cloudflare response as
an empty ruleset, which can overwrite unrelated rules on the subsequent PUT.
Update the logic around existingResp/existingJson so only a confirmed “no
entrypoint exists” case falls back to an empty array, and any other unsuccessful
response is surfaced or preserved instead of using []. Keep the existing
rule-merging flow around existingRules, newRule, and updatedRules, but guard it
so late-transform rules are not deleted when the fetch fails.

In `@typescript2/pkg-playground/src/ExecutionPanel.tsx`:
- Around line 327-343: The RequestUrlLabel reconstruction logic is incorrectly
appending parsed.pathname from the proxy URL, which breaks when the proxy itself
is configured with a path prefix. Update the de-proxying branch in
RequestUrlLabel to strip any configured proxy pathname before combining the
original upstream URL with the request path, or validate that the proxy URL is
origin-only before using it. Keep the fix localized to the URL rebuild logic
that uses findHeaderValue, ORIGINAL_URL_HEADER, and new URL(url).

In `@typescript2/pkg-playground/src/gateway.ts`:
- Around line 61-100: installGateway() currently stores gateway state in
module-global installedStore and gatewayUrl, so a second call overwrites the
first and the first cleanup can null out reconciliation for the remaining store.
Update the gateway management in reconcile() and installGateway() to either keep
per-store state keyed by the SessionStore instance or reject a second active
install with a clear error; make sure cleanup only affects the matching store
and does not disable another mounted installation.

---

Outside diff comments:
In `@typescript2/pkg-playground/src/components/ApiKeysDialog.tsx`:
- Around line 104-122: The key filtering in ApiKeysDialog is hiding
BOUNDARY_PROXY_URL even when the proxy toggle is disabled, which leaves a live
proxy target uneditable and invisible. Update the primaryKeys and shellOnlyKeys
logic so BOUNDARY_PROXY_URL is only excluded when showProxyEnvVar is enabled and
the dedicated proxy UI is handling it; otherwise surface it as a normal editable
row or reject it in the add/import path. Use the ApiKeysDialog memoized key
lists and the BOUNDARY_PROXY_URL_KEY handling as the main places to fix.
🪄 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

Run ID: 50089646-2bf2-4f63-a956-5a0a14758656

📥 Commits

Reviewing files that changed from the base of the PR and between 1af755f and 38ad18e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript/packages/fiddle-proxy/.dockerignore
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/server.js
  • typescript/packages/fiddle-proxy/server.test.js
  • typescript/packages/fiddle-proxy/set-origin-token-header.ts
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/worker-protocol.ts

Comment thread typescript2/app-fiddleproxy/server.js Resolved
Comment thread typescript2/app-fiddleproxy/server.js Resolved

@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

🤖 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 `@typescript/packages/fiddle-proxy/Dockerfile`:
- Around line 6-8: The Dockerfile is installing dependencies with npm even
though fiddle-proxy declares pnpm, which can make builds drift. Update the image
build to use pnpm in the Dockerfile for fiddle-proxy, and make sure the matching
lockfile is copied into the build context before installation. Use the package’s
declared manager with a frozen lockfile install so dependency resolution stays
deterministic.
🪄 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

Run ID: 95e28f3c-2c66-4efb-84f1-41827c823222

📥 Commits

Reviewing files that changed from the base of the PR and between 38ad18e and 0a98b8b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript/packages/fiddle-proxy/.dockerignore
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/server.js
  • typescript/packages/fiddle-proxy/server.test.js
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
✅ Files skipped from review due to trivial changes (4)
  • typescript/packages/fiddle-proxy/.dockerignore
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
🚧 Files skipped from review as they are similar to previous changes (14)
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript/packages/fiddle-proxy/package.json
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript/packages/fiddle-proxy/server.js

Comment thread typescript2/app-fiddleproxy/Dockerfile Resolved
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 June 27, 2026 00:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle June 27, 2026 00:24 Inactive
@rossirpaulo

Copy link
Copy Markdown
Contributor

wait for #3844

@sxlijin
sxlijin force-pushed the push-mmuzomoksnnx branch from 0a98b8b to 2f29c66 Compare June 27, 2026 00:49
@vercel
vercel Bot temporarily deployed to Preview – beps June 27, 2026 00:50 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 June 27, 2026 00:57 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

🤖 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/app-promptfiddle/src/playground/PlaygroundProvider.tsx`:
- Around line 41-45: The Sonnet client configuration is using the wrong
environment variable for Anthropic credentials. Update the `client<llm> Sonnet`
setup in `PlaygroundProvider` so the Anthropic provider reads the
Anthropic-specific env var instead of `env.OPENAI_API_KEY`; keep the fix
localized to the `options` block for `provider anthropic` so the default
template routes correctly when the gateway toggle is off.
🪄 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

Run ID: 77178cdd-9713-4c7d-8f93-22916f1fd5ee

📥 Commits

Reviewing files that changed from the base of the PR and between 0a98b8b and 2f29c66.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • typescript2/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (28)
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript/README.md
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/server.js
  • typescript2/app-fiddleproxy/.dockerignore
  • typescript2/app-fiddleproxy/.gitignore
  • typescript2/app-fiddleproxy/Dockerfile
  • typescript2/app-fiddleproxy/fly.toml
  • typescript2/app-fiddleproxy/package.json
  • typescript2/app-fiddleproxy/server.js
  • typescript2/app-fiddleproxy/server.test.js
  • typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
💤 Files with no reviewable changes (4)
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/README.md
  • typescript/packages/fiddle-proxy/server.js
  • typescript/packages/fiddle-proxy/package.json
✅ Files skipped from review due to trivial changes (4)
  • typescript2/app-fiddleproxy/.dockerignore
  • typescript2/app-fiddleproxy/Dockerfile
  • typescript2/app-fiddleproxy/package.json
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
🚧 Files skipped from review as they are similar to previous changes (11)
  • typescript2/pkg-playground/src/index.ts
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • typescript2/pkg-playground/src/worker-protocol.ts
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • typescript2/pkg-playground/src/run-store-projections.ts
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • typescript2/pkg-playground/src/proxy-config.ts
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript2/pkg-playground/src/ExecutionPanel.tsx

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle June 27, 2026 01:09 Inactive
@sxlijin
sxlijin force-pushed the push-mmuzomoksnnx branch from 2f29c66 to 251dd2b Compare June 27, 2026 03:50
@vercel
vercel Bot temporarily deployed to Preview – beps June 27, 2026 03:51 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

🤖 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/app-fiddleproxy/Dockerfile`:
- Around line 1-14: The Dockerfile for the proxy still runs the container as
root, so update the build steps to switch to an unprivileged user before the
final CMD. Keep the existing install and copy flow in place, then add a non-root
USER after the app files are copied so `server.js` starts without root
privileges. Use the Dockerfile’s existing WORKDIR and startup CMD as the anchor
points when inserting the user switch.
🪄 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

Run ID: 93aa31df-f2d0-43ee-b76c-6296e4b4eb38

📥 Commits

Reviewing files that changed from the base of the PR and between 2f29c66 and 251dd2b.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • typescript2/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript/README.md
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/server.js
  • typescript2/app-fiddleproxy/.dockerignore
  • typescript2/app-fiddleproxy/.gitignore
  • typescript2/app-fiddleproxy/Dockerfile
  • typescript2/app-fiddleproxy/fly.toml
  • typescript2/app-fiddleproxy/package.json
  • typescript2/app-fiddleproxy/server.js
  • typescript2/app-fiddleproxy/server.test.js
  • typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • typescript2/pkg-grammar/package.json
  • typescript2/pkg-playground/package.json
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
  • typescript2/pkg-proto/package.json
💤 Files with no reviewable changes (4)
  • typescript/README.md
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/server.js
✅ Files skipped from review due to trivial changes (3)
  • typescript2/app-fiddleproxy/package.json
  • typescript2/app-fiddleproxy/.dockerignore
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
🚧 Files skipped from review as they are similar to previous changes (17)
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • typescript2/pkg-playground/src/proxy-config.ts
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • typescript2/pkg-playground/src/worker-protocol.ts
  • typescript2/pkg-playground/src/gateway.ts
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
  • typescript2/app-fiddleproxy/server.js
  • typescript2/pkg-playground/src/ExecutionPanel.tsx

Comment thread typescript2/app-fiddleproxy/Dockerfile Resolved
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 June 27, 2026 03:57 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle June 27, 2026 04:08 Inactive
@sxlijin
sxlijin force-pushed the push-mmuzomoksnnx branch from 251dd2b to 28a6cf5 Compare June 27, 2026 05:36
@vercel
vercel Bot temporarily deployed to Preview – beps June 27, 2026 05:37 Inactive
@sxlijin
sxlijin enabled auto-merge June 27, 2026 05:38

@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/app-fiddleproxy/server.test.js (2)

128-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover all configured provider mappings here.

This only spot-checks two entries even though ALL_KEYS now exercises multiple providers, including the new gateway path. A broken mapping for any of the other origins would still pass this test, so please either assert every expected origin/header pair or tighten the test name to match the narrower coverage.

🤖 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/app-fiddleproxy/server.test.js` around lines 128 - 132, The test
in buildApiKeyInjectionAllowed only verifies two provider origins, so it misses
regressions in the other configured mappings. Update the server.test.js coverage
around buildApiKeyInjectionAllowed and ALL_KEYS to assert every expected
origin-to-header pair, including the new gateway path, or rename the test to
clearly indicate it only spot-checks a subset.

114-123: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Also assert that baml-original-url is stripped before forwarding.

That header is now part of the proxy control plane, just like the token header. If it reaches the upstream provider, we leak internal routing metadata without this suite noticing. Add an assertion that the fake upstream never receives baml-original-url.

🤖 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/app-fiddleproxy/server.test.js` around lines 114 - 123, The proxy
forwarding test in server.test.js only verifies PROXY_TOKEN_HEADER is stripped,
but it also needs to ensure baml-original-url is removed before the request
reaches the upstream. Update the existing request-forwarding test around the
upstream.received assertion to explicitly check the fake upstream never receives
baml-original-url, using the same upstream.received[0].headers assertions
alongside the current token check.
🤖 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/gateway.ts`:
- Around line 65-68: The enable path in setGatewayEnabled currently always
writes getProxyEnvVarConfig().url into BOUNDARY_PROXY_URL_KEY even when no proxy
URL exists. Update setGatewayEnabled so that when enabled is true it first
checks the proxy config URL from getProxyEnvVarConfig(), and only sets the env
var if a valid URL is present; otherwise leave the env var unset and keep the
gateway disabled. Keep the existing disable branch behavior unchanged.

---

Nitpick comments:
In `@typescript2/app-fiddleproxy/server.test.js`:
- Around line 128-132: The test in buildApiKeyInjectionAllowed only verifies two
provider origins, so it misses regressions in the other configured mappings.
Update the server.test.js coverage around buildApiKeyInjectionAllowed and
ALL_KEYS to assert every expected origin-to-header pair, including the new
gateway path, or rename the test to clearly indicate it only spot-checks a
subset.
- Around line 114-123: The proxy forwarding test in server.test.js only verifies
PROXY_TOKEN_HEADER is stripped, but it also needs to ensure baml-original-url is
removed before the request reaches the upstream. Update the existing
request-forwarding test around the upstream.received assertion to explicitly
check the fake upstream never receives baml-original-url, using the same
upstream.received[0].headers assertions alongside the current token check.
🪄 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

Run ID: 17436495-314d-4ba2-b1fb-e951ad04e94f

📥 Commits

Reviewing files that changed from the base of the PR and between 251dd2b and 28a6cf5.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • typescript2/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript/README.md
  • typescript/packages/fiddle-proxy/Dockerfile
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/server.js
  • typescript2/app-fiddleproxy/.dockerignore
  • typescript2/app-fiddleproxy/.gitignore
  • typescript2/app-fiddleproxy/Dockerfile
  • typescript2/app-fiddleproxy/fly.toml
  • typescript2/app-fiddleproxy/package.json
  • typescript2/app-fiddleproxy/server.js
  • typescript2/app-fiddleproxy/server.test.js
  • typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • typescript2/pkg-grammar/package.json
  • typescript2/pkg-playground/package.json
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • typescript2/pkg-playground/src/gateway.ts
  • typescript2/pkg-playground/src/index.ts
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/pkg-playground/src/worker-protocol.ts
  • typescript2/pkg-proto/package.json
💤 Files with no reviewable changes (4)
  • typescript/README.md
  • typescript/packages/fiddle-proxy/server.js
  • typescript/packages/fiddle-proxy/package.json
  • typescript/packages/fiddle-proxy/Dockerfile
✅ Files skipped from review due to trivial changes (3)
  • typescript2/app-fiddleproxy/package.json
  • typescript2/app-fiddleproxy/.dockerignore
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
🚧 Files skipped from review as they are similar to previous changes (20)
  • typescript2/pkg-grammar/package.json
  • typescript2/app-fiddleproxy/Dockerfile
  • typescript2/pkg-proto/package.json
  • typescript2/pkg-playground/src/index.ts
  • typescript2/app-promptfiddle/src/playground/SplitPreview.tsx
  • baml_language/crates/bex_events/src/run_wire.rs
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • typescript2/pkg-playground/src/worker-protocol.ts
  • typescript2/app-promptfiddle/src/playground/baml-lsp-worker.ts
  • baml_language/crates/bridge_wasm/src/wasm_http.rs
  • baml_language/crates/bex_events/src/run.rs
  • typescript2/pkg-playground/src/components/ApiKeysDialog.tsx
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • typescript2/pkg-playground/package.json
  • typescript2/app-promptfiddle/src/playground/PlaygroundProvider.tsx
  • baml_language/crates/sys_llm/src/build_request/anthropic.rs
  • typescript2/pkg-playground/src/ExecutionPanel.tsx
  • typescript2/pkg-playground/src/proxy-config.ts
  • typescript2/pkg-playground/src/run-store-projections.ts
  • typescript2/app-fiddleproxy/server.js

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 June 27, 2026 05:44 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle June 27, 2026 05:54 Inactive
@sxlijin
sxlijin added this pull request to the merge queue Jun 27, 2026
Merged via the queue into canary with commit fd32fa4 Jun 27, 2026
60 checks passed
@sxlijin
sxlijin deleted the push-mmuzomoksnnx branch June 27, 2026 16:59
aaronvg added a commit that referenced this pull request Jun 30, 2026
The bridge_wasm runtime + pkg-playground protocol renamed runId -> boundaryId
(#3844/#3864), but the website worker still read msg.runId and forwarded
notification.runId — both undefined at runtime, so run snapshots/subscriptions
never matched and the run UI never updated.

- rename runId -> boundaryId across run handlers (cancelRun, respondToInput,
  respondToEnv, snapshot, subscribe) and the runSnapshot/runCursorExpired
  notification forwarders
- add the missing listHistory/openHistory/readValue handlers and the
  historyList/valueBody notification forwarders (matches app-promptfiddle)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 28a6cf52 Deployed Jun 27, 2026 by vercel[bot]
Preview – promptfiddle2 — 28a6cf52 Deployed Jun 27, 2026 by vercel[bot]
Preview – beps — 28a6cf52 Deployed Jun 27, 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.

2 participants