Skip to content

Preserve connecting status while a turn starts#4101

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
D3OXY:d3oxy/fix-pending-turn-startup
Jul 22, 2026
Merged

Preserve connecting status while a turn starts#4101
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
D3OXY:d3oxy/fix-pending-turn-startup

Conversation

@D3OXY

@D3OXY D3OXY commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What Changed

Preserve the connecting thread status while provider readiness arrives with a turn start still pending. The thread transitions directly to working once the turn starts instead of briefly appearing inactive.

Why

Status-grouped thread lists currently jump between sections during provider startup because readiness temporarily exposes an idle state.

Fixes #4099

Verification

  • vp check
  • vp run typecheck
  • vp test: lifecycle coverage passed; the unrelated ACP timeout passed 14/14 on targeted retry.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI screenshots included
  • Video included

Note

Preserve 'starting' session status while a turn start is pending

  • When thread.turn.start is handled, the session is immediately projected as starting before the provider session is fully ready, and remains starting even if the provider reports ready until a turn actually begins.
  • ProviderRuntimeIngestion maps session.state.changed 'ready' and session.started events to starting (rather than ready) when a pending turn-start exists for the thread.
  • On thread.session-set with terminal statuses (error, stopped, interrupted), any pending turn-start records for the thread are deleted via projectionTurnRepository.deletePendingTurnStartByThreadId.
  • setThreadSessionErrorOnTurnStartFailure now constructs a minimal session from the thread when none exists, setting status to error (or keeping stopped) so turn failures are always surfaced.
  • Behavioral Change: sessions that previously became ready between turn-start and the first turn event will now show starting instead.

Macroscope summarized 919bd72.

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 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

Run ID: 603c59f7-ec6f-4949-8c59-a0e97b3b2a07

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 the size:M 30-99 changed lines (additions + deletions). label Jul 17, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 17, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR modifies session state machine behavior in the orchestration layer, changing how status transitions during turn startup. The changes affect core runtime state management across multiple files, warranting human review despite good test coverage.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge force-pushed the d3oxy/fix-pending-turn-startup branch from fb8870e to 1c1aa71 Compare July 22, 2026 13:07
juliusmarminge pushed a commit to D3OXY/t3code that referenced this pull request Jul 22, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 22, 2026 13:07

Dismissing prior approval to re-evaluate 1c1aa71

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the d3oxy/fix-pending-turn-startup branch from 1c1aa71 to 919bd72 Compare July 22, 2026 13:15
@juliusmarminge
juliusmarminge merged commit 783692a into pingdotgg:main Jul 22, 2026
14 checks passed
UNN-Devotek pushed a commit to unn-corp/t3code that referenced this pull request Jul 23, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
AnanduB13 pushed a commit to AnanduB13/t3code that referenced this pull request Jul 23, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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.

Thread briefly becomes inactive while a turn starts

2 participants