Skip to content

fix: correct generated runtime install guidance - #4299

Merged
sxlijin merged 1 commit into
canaryfrom
agent/b-1121-fix-generate-install-guidance
Jul 31, 2026
Merged

sxlijin merged 1 commit into
canaryfrom
agent/b-1121-fix-generate-install-guidance

Conversation

@sxlijin

@sxlijin sxlijin commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • update generated Python banners to recommend uv add baml-bridge, pip install baml-bridge, and a Conda-environment install of the published PyPI package
  • update generated TypeScript banners to recommend pnpm, npm, and yarn commands for the selected runtime package
  • cover both @boundaryml/baml-bridge and @boundaryml/baml-bridge-web
  • remove the stale claim that baml-cli is available from the runtime package

Root cause

The v1 Python SDK emitter hardcoded pip install baml even though generated code imports the separately published baml-bridge runtime. The shared TypeScript emitter selected the correct runtime package but only showed one package-manager command. baml-bridge is published to PyPI rather than Conda channels, so the Conda-oriented option installs the PyPI wheel inside the active Conda environment.

The commands are intentionally unpinned: the project does not have a reliable mapping between the baml.toml toolchain version and published Python/runtime package versions.

Validation

  • reproduced the Python bug with a focused failing regression test before the fix
  • reproduced missing TypeScript alternatives in both Node and Web generator tests before the fix
  • cargo fmt --manifest-path baml_language/Cargo.toml --package sdkgen_python_pydantic2 --package sdkgen_typescript_shared -- --check
  • cargo test --manifest-path baml_language/Cargo.toml -p sdkgen_python_pydantic2 -p sdkgen_typescript_shared (118 Python tests and 45 TypeScript tests)
  • cargo clippy --manifest-path baml_language/Cargo.toml -p sdkgen_python_pydantic2 -p sdkgen_typescript_shared --all-targets -- -D warnings

Linear: https://linear.app/boundaryml2/issue/B-1121/baml-generate-points-to-the-wrong-package

Summary by CodeRabbit

  • Documentation
    • Updated generated Python SDK instructions with baml-bridge installation commands for uv, pip, and conda.
    • Updated the recommended Python generation command.
    • Expanded generated TypeScript SDK instructions to include pnpm, npm, and Yarn installation options.
    • Removed outdated installation guidance and legacy package references from generated output.

@linear

linear Bot commented Jul 30, 2026

Copy link
Copy Markdown

B-1121

@vercel

vercel Bot commented Jul 30, 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 12:02am
promptfiddle2 Ready Ready Preview Jul 31, 2026 12:02am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dddd5685-661e-4b63-a099-5148a2c8a4ff

📥 Commits

Reviewing files that changed from the base of the PR and between 1303a8f and 2b5a4d1.

📒 Files selected for processing (4)
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs

📝 Walkthrough

Walkthrough

Generated Python banners now recommend baml-bridge installation through uv, pip, and conda, while TypeScript banners add npm and Yarn commands. Regression tests verify updated command text and reject legacy package guidance.

Changes

SDK banner updates

Layer / File(s) Summary
Python bridge installation guidance
baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
Python banners use ordered uv, pip, and conda commands for baml-bridge, with tests covering generated initialization files and legacy-text removal.
TypeScript package installation guidance
baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs, baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs, baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs
TypeScript banners include pnpm, npm, and Yarn commands, while runtime package tests reject obsolete baml package text.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • BoundaryML/baml#4265: Updates generation guidance and SDK setup instructions for the newer workflow.

Poem

A bunny hops where banners gleam,
With uv and npm in a tidy stream.
Pip, conda, Yarn join the cheer,
Old package words disappear.
baml generate leads the way—
Fresh SDK guidance blooms today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change to generated runtime installation guidance.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 agent/b-1121-fix-generate-install-guidance

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.

@sxlijin
sxlijin marked this pull request as ready for review July 30, 2026 23:27
@vercel
vercel Bot temporarily deployed to Preview – beps July 30, 2026 23:28 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: 9664033258

ℹ️ 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".

@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.

🧹 Nitpick comments (1)
baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs (1)

761-771: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the leaf banner in the regression test.

PYTHON_BANNER and HEADER are separate constants, but this test only inspects the root __init__.py. Add assertions for a generated leaf such as baml/__init__.py; otherwise, a regression in HEADER could reintroduce stale installation guidance without failing the test.

🤖 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/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs` around
lines 761 - 771, Extend
generated_sdk_lists_python_runtime_install_commands_in_preferred_order to
inspect the generated leaf baml/__init__.py in addition to the root __init__.py,
asserting it contains the preferred baml-bridge commands and excludes the stale
installation guidance.
🤖 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/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs`:
- Around line 761-771: Extend
generated_sdk_lists_python_runtime_install_commands_in_preferred_order to
inspect the generated leaf baml/__init__.py in addition to the root __init__.py,
asserting it contains the preferred baml-bridge commands and excludes the stale
installation guidance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1736a25c-7089-4b6e-9dbb-bcc9999a3ba7

📥 Commits

Reviewing files that changed from the base of the PR and between b98f9b1 and 9664033.

📒 Files selected for processing (4)
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 30, 2026 23:35 Inactive
@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 27.4 MB 11.6 MB file 27.4 MB -8.8 KB (-0.0%) OK
✅ packed-program Linux 🔒 17.7 MB 7.3 MB file 17.7 MB +26.1 KB (+0.1%) OK
✅ baml-cli macOS 🔒 21.3 MB 10.2 MB file 21.3 MB -35.0 KB (-0.2%) OK
✅ packed-program macOS 🔒 13.8 MB 6.4 MB file 13.8 MB -4.6 KB (-0.0%) OK
✅ baml-cli Windows 🔒 22.9 MB 10.4 MB file 23.0 MB -51.3 KB (-0.2%) OK
✅ packed-program Windows 🔒 14.8 MB 6.5 MB file 14.8 MB -7.7 KB (-0.1%) OK
✅ bridge_wasm WASM 16.8 MB 🔒 4.6 MB gzip 4.6 MB -44.1 KB (-1.0%) 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 agent/b-1121-fix-generate-install-guidance branch from 9664033 to 1303a8f Compare July 30, 2026 23:43

sxlijin commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the CodeRabbit nitpick in 2b5a4d15: the Python regression now inspects both the root __init__.py and baml/__init__.py, asserting the install sequence and rejecting stale package/CLI guidance in both banner paths. The updated Python and TypeScript generator suites, formatting, and clippy pass locally.

@vercel
vercel Bot temporarily deployed to Preview – beps July 30, 2026 23:44 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 `@baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs`:
- Around line 53-55: Update the Python Conda installation flow to emit “conda
install baml-bridge=={runtime_version}” instead of invoking pip under conda.
Apply this in the generator output and HEADER in
baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs (lines 53-55
and 86-88), then update the regression expectation there (lines 805-815) and the
E2E expectation in baml_language/crates/baml_cli/tests/exit_code_e2e.rs (lines
323-327) to match.
🪄 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: b9781622-d4f4-4d12-a5ff-61ef105908dd

📥 Commits

Reviewing files that changed from the base of the PR and between 9664033 and 1303a8f.

📒 Files selected for processing (9)
  • baml_language/crates/baml_cli/src/generate.rs
  • baml_language/crates/baml_cli/tests/exit_code_e2e.rs
  • baml_language/sdk_tests/harness_setup/src/python_pydantic2.rs
  • baml_language/sdk_tests/harness_setup/src/typescript.rs
  • baml_language/sdk_tests/harness_setup/src/typescript_web.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 30, 2026 23:52 Inactive
@sxlijin
sxlijin force-pushed the agent/b-1121-fix-generate-install-guidance branch from 1303a8f to e390d71 Compare July 30, 2026 23:52
@sxlijin
sxlijin force-pushed the agent/b-1121-fix-generate-install-guidance branch from e390d71 to 2b5a4d1 Compare July 30, 2026 23:53
@vercel
vercel Bot temporarily deployed to Preview – beps July 30, 2026 23:54 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 31, 2026 00:02 Inactive
@sxlijin
sxlijin enabled auto-merge July 31, 2026 00:27
@sxlijin
sxlijin added this pull request to the merge queue Jul 31, 2026
Merged via the queue into canary with commit e26ee02 Jul 31, 2026
75 checks passed
@sxlijin
sxlijin deleted the agent/b-1121-fix-generate-install-guidance branch July 31, 2026 00:34

This branch was previously deployed

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