fix: explicitly send spawnSource from web session route#534
Conversation
The web session creation route relied on the control plane defaulting missing spawnSource to "user". Make it explicit to match the pattern used by all bot integrations and avoid fragility if the default ever changes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single field Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
Terraform Validation Results
Pushed by: @ColeMurray, Action: |
There was a problem hiding this comment.
Summary
PR Title and number: fix: explicitly send spawnSource from web session route (#534)
Author: @ColeMurray
Files changed count: 1
Additions/deletions: +1/-0
This change makes the web session creation route explicit about its spawn source instead of relying on the control-plane default. I reviewed the diff against the route and the control-plane session init handler, and the change is correct, low risk, and consistent with the other session creators.
Critical Issues
None.
Suggestions
None.
Nitpicks
None.
Positive Feedback
- This keeps the web caller aligned with the bot callers that already send
spawnSourceexplicitly. - The change preserves backward compatibility because the control plane still defaults missing values to
"user". - The diff is intentionally minimal and improves clarity ahead of the larger unified user model migration.
Questions
None.
Verdict
Approve
Summary
spawnSource: "user"to the session creation body inpackages/web/src/app/api/sessions/route.tsspawnSourceto"user"(viasession.spawnSource ?? "user"inSessionIndexStore.create()) — every bot already sends its source explicitly, but the web route did notPre-step 4 of the unified user model migration (pre-steps doc). Makes the main migration's diff for this file purely additive (new
actor*fields) rather than a mix of fixing omissions and adding new fields.Test plan
npm run typecheck -w @open-inspect/webpassesnpm test -w @open-inspect/web— all 185 tests passSummary by CodeRabbit