Skip to content

fix(server): prevent blank active turn IDs from blocking startup - #6149

Open
DavidIlie wants to merge 1 commit into
pingdotgg:mainfrom
DavidIlie:fix/server-normalize-empty-active-turn
Open

fix(server): prevent blank active turn IDs from blocking startup#6149
DavidIlie wants to merge 1 commit into
pingdotgg:mainfrom
DavidIlie:fix/server-normalize-empty-active-turn

Conversation

@DavidIlie

@DavidIlie DavidIlie commented Aug 11, 2026

Copy link
Copy Markdown

What changed

A blank projection_thread_sessions.active_turn_id failed strict TurnId decoding 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 NULL before decoding. Valid IDs and the strict Schema.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 passed
  • pnpm exec vp run --filter t3 typecheck
  • Targeted lint, formatting, and git diff --check

Model: GPT-5.6 Sol · Harness: Codex in T3 Code

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f603d28b-6adb-4762-9235-e43b7da65e33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 11, 2026
@DavidIlie DavidIlie changed the title fix(server): treat empty active turn ids as no active turn fix(server): prevent blank active turn IDs from blocking startup Aug 11, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant