GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): do not replace Claude session while live tasks run by macodev00 · Pull Request #13080 · pingdotgg/t3code

Conversation

@macodev00

@macodev00 macodev00 commented Sep 22, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What

  • Defer Claude session replacement while live subagent/background tasks are running; keep the current process instead of calling startSession over it.
  • Treat a missing cached Claude model selection as not requiring a restart (avoids replace-while-live on the common first-follow-up path).
  • If a restart predicate is true but thread.backgroundLiveness is set, reuse the live session.

Why

Fixes #12694

ensureSessionForThread restart + startSession while tasks were live suppressed exit and silently stopped background work.

UI

N/A — server session lifecycle; may surface a runtime.warning when replacement is deferred.

Checklist

  • I read CONTRIBUTING.md and kept this small / bug-only
  • What + why explained above
  • Followed AGENTS.md documentation rules (no new docs)
  • No unrelated changes
  • CLA / AI-reviewed standing override for macodev00 auto-contrib

Summary by CodeRabbit

  • Bug Fixes
    • Prevented active provider sessions from being replaced while background tasks are still running.
    • Added runtime warnings and request errors when a session replacement is blocked.
    • Preserved the existing session and its access mode after blocked turn or compaction operations.
    • Improved session reuse when provider options change during background work.
    • Ensured deferred provider changes are applied after background activity finishes.
    • Corrected Claude session handling so model-selection changes reliably trigger a restart when appropriate.

Supersedes #12723 (GitHub PR tip was stuck behind the fork branch; reopened so CodeRabbit/Macroscope see the latest commits including compaction live-session fix + docstring coverage).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macodev00 and others added 9 commits September 20, 2026 09:11
@macodev00
fix(server): keep live Claude tasks when replacing a session
ce691bd
Claude startSession replaced a live thread session without emitting
session.exited, which silently stopped in-flight subagent tasks. Defer
replacement while liveTaskIds is non-empty, skip Claude restarts on a
model-selection cache miss, and reuse the session when projected
background work is still live.
@macodev00
fix(server): reject Claude runtime-mode replace while tasks are live
becf02a
Deferred session reuse left the next turn on the previous permission
callback. Fail the turn until background work ends, block startSession
when live tasks remain, and compare Claude options against the thread
selection on a cache miss.
@macodev00
fix(server): tighten live Claude session replacement tests
6b2b615
Keep formatter wrapping and assert the live session was retained
without comparing a stale start-time resume cursor.
@macodev00
fix(server): keep deferred Claude options pending until restart
64f067e
Do not cache a requested model selection when session replacement is
deferred for live background work. The next turn can still restart to
apply restart-only options such as fastMode.
@cursoragent
fix(server): gate runtime-mode replacement on the live provider session
0045120
A blocked Claude replacement stamped the requested runtime mode onto the
orchestration session before startSession applied it. The next turn then
treated that record as current and sent on the previous permission callback
while background work was still live. Compare the provider session mode,
keep that mode until replacement succeeds, and reject instead of reusing
the process.
@macodev00
docs(server): raise docstring coverage for Claude session replace guard
b0af75c
@macodev00
fix(server): keep the live session running when runtime mode is rejected
fe477e5
A runtime-mode change during live background work failed the turn by
marking the provider session as error. Record that failure and leave the
session status in place. Move the Effect callback docs onto the functions
CodeRabbit counts.

Co-authored-by: maco <[email protected]>
@macodev00
fix(server): keep the live session when compaction rejects runtime mode
e37acef
Compaction marked the provider session as error and cleared the active turn
when ensureSession rejected a runtime-mode change while background work was
still live. Record the compaction failure and leave that session in place.

Give the failure handlers named declarations with JSDoc so docstring coverage
can see them.

Co-authored-by: maco <[email protected]>
@macodev00
chore(server): refresh PR tip for Claude session replace follow-up
cfd14cb
@macodev00

macodev00 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@macodev00

macodev00 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@macroscope-app review

macroscopeapp[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 22, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR changes existing server session lifecycle behavior across orchestration and the Claude provider, including when restarts are deferred or rejected while background tasks run. Despite strong targeted tests, the cross-component runtime gating and permission/session implications warrant human review.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@macodev00 Cursor

macodev00 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

superseded — redoing from scratch for Macroscope (eligibility Not approved: cross-component session lifecycle / permission gating warrants human review; Correctness clean). Narrower bug-only redo from upstream main incoming.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@macodev00 macodev00 closed this Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 22, 2026
fix(server): block Claude session replacement while child tasks run #13086
Closed
fix(server): keep Claude sessions up while child tasks run macodev00/t3code#22
Closed
fix(server): keep Claude sessions up while child tasks run #13097
Closed
This was referenced Nov 2, 2026
feat(threads): hand off Claude CLI conversations to T3 DJProspero1/t3code#1
Draft
feat(threads): hand off Claude CLI conversations to T3 #30341
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude session replacement suppresses exit and silently stops live subagent tasks

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@macodev00 @cursoragent
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.