Skip to content

fix(server): mark superseded running turns interrupted - #12221

Open
proxynico wants to merge 2 commits into
pingdotgg:mainfrom
proxynico:fix/interrupted-turn-status
Open

proxynico wants to merge 2 commits into
pingdotgg:mainfrom
proxynico:fix/interrupted-turn-status

Conversation

@proxynico

@proxynico proxynico commented Sep 17, 2026

Copy link
Copy Markdown

What Changed

When a new active turn replaces a still-running turn, the projection now marks the earlier turn interrupted instead of completed. The existing regression asserts that state while preserving the settlement timestamp and the new turn's running state.

Why

A new turn is not evidence that the previous turn completed successfully. After a provider interruption without a terminal event, the previous behavior hid unfinished work as completed. The change only affects superseded running turns; existing terminal turns keep their state.

Verification

  • The focused regression failed before the production change with actual completed instead of expected interrupted.
  • node_modules/.bin/vitest run apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts: 34 tests passed.
  • Server typecheck and focused formatting/lint passed. Independent Claude Sonnet 5 source review found no issues.
  • Setup caveat: the repository's existing dependency-age policy rejected pinned expo-image-manipulator@57.0.17. The isolated checkout was provisioned with pnpm install --frozen-lockfile --filter t3... --config.minimumReleaseAge=0; Vite+ checks used the same temporary environment override. No manifest or lockfile changed. The direct Vitest confirmation above used the already-installed dependencies.
  • This verifies the disposable in-memory event/SQLite projection. No installed-app end-to-end test or live database mutation was performed. The original provider termination cause remains unknown.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI components or animations changed.

Generated by gpt-6-astra using the Codex harness.

Summary by CodeRabbit

  • Bug Fixes
    • Updated turn status handling so that a previously running turn is marked as interrupted when a new active turn replaces it.
    • Preserved the completion timestamp using the time the new turn became active.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 17, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a9a8666

Macroscope's review found this PR approvable — This is a focused bug fix that correctly records superseded running turns as interrupted instead of completed, with a matching regression test. It introduces no schema, configuration, deployment, security, billing, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 73c77f30-99c6-44de-ae66-51c69dd9c96d

📥 Commits

Reviewing files that changed from the base of the PR and between 0150c6a and a9a8666.

📒 Files selected for processing (2)
  • apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts
  • apps/server/src/orchestration/Layers/ProjectionPipeline.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

When a new active turn replaces a running turn on the same thread, the projection now marks the prior turn as interrupted instead of completed. The test now verifies this state and preserves the existing completion timestamp behavior.

Changes

Turn projection state

Layer / File(s) Summary
Superseded turn state update
apps/server/src/orchestration/Layers/ProjectionPipeline.ts, apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts
The projection marks superseded running turns as interrupted. The test updates its description and expected state. The completion timestamp remains the session update timestamp.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to a9a86

The narrow projection correction and regression test present no identified merge-blocking behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: marking superseded running turns as interrupted.
Description check ✅ Passed The description includes clear What Changed and Why sections, explains verification, confirms the PR is focused, and states that no UI changes were made. The UI Changes heading is omitted, but this is…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

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

Labels

size:XS 0-9 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