Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughSDK generation now removes unreachable built-in types while retaining types reached through declarations. Python runtime and stub output share bridge re-exports for the ChangesSDK built-in filtering and output
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified issue blocks merging after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
A rabbit checks the types in rows, Comment |
⏭️ 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):
|
This comment has been minimized.
This comment has been minimized.
Binary size checks failed❌ 2 violations · ✅ 1 passed
Details & how to fixViolations:
Add/update baselines:
[artifacts.bridge_wasm]
file_bytes = 28221460
gzip_bytes = 7834305
[artifacts.packed-program]
file_bytes = 40142856
gzip_bytes = 15871097Generated by |
9302453 to
c7d3618
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7d3618b96
ℹ️ 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".
| let referenced = match ty { | ||
| Ty::Type => Some(&reflect_type), | ||
| _ => named_reference(ty), | ||
| }; |
There was a problem hiding this comment.
Preserve types that can escape through unknown
When a generated function exposes unknown, a value of any built-in class can cross the SDK boundary even though its static signature contains no named reference—for example, function f() -> unknown { baml.time.Duration.from_seconds(1) }. This traversal treats Ty::Unknown as having no reachability edges, so baml.time.Duration is removed from the generated typemap; Python then fails in _decode_class with Unknown class FQN, while TypeScript silently returns a plain object instead of the generated instance. Detecting an exposed unknown needs to conservatively retain possible built-in runtime values (or otherwise provide a decoder fallback that preserves them).
Useful? React with 👍 / 👎.
c7d3618 to
50941a2
Compare
50941a2 to
19994d2
Compare
08bf58a to
3b1a88a
Compare
3b1a88a to
cc2263d
Compare
cc2263d to
88fa664
Compare
88fa664 to
e7977aa
Compare
e7977aa to
195ec57
Compare
195ec57 to
7386141
Compare
7386141 to
756572c
Compare
756572c to
571721f
Compare
571721f to
9358ca3
Compare
Generated SDKs now emit a built-in type only when it is reachable from a generated declaration. The roots are every kept function, every user type, and the baml.media types (always exposed as bridge-owned classes); reachability follows class properties and methods, function signatures (arguments, return, throws, watchers), and alias targets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pruning can leave a namespace with no declarations:
- Python: the `baml` package re-exports BamlError, BamlPanic, and UNSET
even when no built-in type is generated there.
- TypeScript: an otherwise empty `index.ts` gets `export {};`, since tsc
refuses to import from an empty script.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signature reachability misses stdlib values the runtime hands the host on its own. Always generate the types in baml.errors, baml.panics, ai.errors, and ai.stream (errors, panics, and stream events) alongside baml.media, and treat a type token (Ty::Type) as a reference to the bridge-owned reflect.Type class. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace the catch-all in the reachability walk with an exhaustive match over type variants, so a new variant needs an explicit decision. Media now reaches the `baml.media` classes SDKs render for it (all four for generic media), alongside type tokens reaching `reflect.Type`. Add a test for function argument and return types reached through reified generic arguments (user and stdlib generics), map values, unions, callables, futures, interface arguments, and throws. Co-Authored-By: Claude Opus 5.5 <[email protected]>
59b887d to
b2bd13d
Compare
|
Found 1 test failure on Blacksmith runners: Failure
|
Final shrinking pass for
baml_sdkLoC by only generating stdlib types if they are reachable from the user's codebaml.media(Image,Audio,Video,Pdf), which are bridge-owned classes;baml.errors,baml.panics,ai.errorsandai.stream. The runtime hands the host error, panic and stream-event values (for exampleai.stream.Done) that no signature names, and decoding them needs these typemap entries.throwsand watchers; alias targets, including through generics, unions, maps, callables and futures. A type token (Ty::Type) reaches the bridge-ownedreflect.Type.The PR also keeps pruned namespaces importable:
bamlpackage always re-exportsBamlError,BamlPanicandUNSET.index.tsgetsexport {};, becausetscrejects imports from an empty script.