fix: bind recipe boolean params as SQLite 0/1 - #222
Conversation
better-sqlite3 rejects JS booleans; coerce type:boolean params to integers at resolve time so defaulted recipes (e.g. churn-complexity-hotspots) run on Node. Narrow QueryBindValue; add CI Node smoke.
🦋 Changeset detectedLatest commit: bb4735d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Next review available in: 56 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBoolean recipe parameters now resolve to SQLite-compatible ChangesBoolean Bind Resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
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 `@src/application/recipe-params.ts`:
- Around line 18-25: Remove null from the RecipeParamValue union and update
resolveRecipeParams to reject runtime null inputs before any type-specific
coercion, while preserving resolver-generated null values for omitted optional
parameters in ResolvedRecipeParamValue.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e5405ee8-9151-4f98-b1b5-ccf4eea69455
📒 Files selected for processing (12)
.changeset/boolean-sqlite-bind.md.github/workflows/ci.ymlscripts/agent-eval/probe-tokens.tsscripts/agent-eval/run-probes.tsscripts/query-golden/resolve-golden-query.tssrc/application/apply-command-template.test.tssrc/application/query-engine.tssrc/application/recipe-params.test.tssrc/application/recipe-params.tssrc/application/tool-handlers.tssrc/cli/cmd-query.test.tssrc/cli/cmd-query.ts
Callers must omit optional keys; Number(null)/String(null) were silently becoming 0/"null". Keep resolver-assigned null on the bind list.
Summary
type: booleanparams were coerced to JStrue/false, which fails at bind time on Node — defaults alone broke recipes likechurn-complexity-hotspotsandstale-imports.0/1; narrowQueryBindValue; introduceResolvedRecipeParamValuefor bind-ready lists.churn-complexity-hotspotsafter the minimal fixture index so Bun-only tests cannot mask a regression.Test plan
bun test src/application/recipe-params.test.ts(+ action-template / cmd-query pins)bun run typechecknode dist/index.mjs query --json --recipe churn-complexity-hotspots(andstale-imports) againstfixtures/minimalSummary by CodeRabbit
Bug Fixes
0or1values.churn-complexity-hotspotsandstale-importsnow execute successfully with their default settings.Tests