fix(server): prevent blank active turn IDs from blocking startup - #6149
fix(server): prevent blank active turn IDs from blocking startup#6149DavidIlie wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Approved 3329286 Straightforward defensive bug fix that normalizes blank/whitespace active turn IDs to NULL in SQL read queries. The actual code changes are minimal (4 SQL CASE statements), with comprehensive test coverage. Limited scope, clear intent, no new functionality. You can customize Macroscope's approvability policy. Learn more. |
What changed
A blank
projection_thread_sessions.active_turn_idfailed strictTurnIddecoding while the command read model loaded every session row. One malformed projection row could therefore prevent the backend from becoming ready.All five session read boundaries now normalize empty and whitespace-only values to SQL
NULLbefore decoding. Valid IDs and the strictSchema.NullOr(TurnId)contract are unchanged. This is read-side resilience for legacy, foreign, or manually altered projection rows; the typed writer cannot produce the invalid value.Validation
pnpm exec vp test run apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts apps/server/src/persistence/Layers/ProjectionRepositories.test.ts— 25 tests passedpnpm exec vp run --filter t3 typecheckgit diff --checkModel: GPT-5.6 Sol · Harness: Codex in T3 Code