fix(server): bound session listing and keep a full idle window after turns - #236
Merged
Merged
Conversation
…turns listSessions resolved every historical thread binding, so each call scaled with the whole conversation history. The session reaper also treated binding lastSeenAt as the only idle clock, which reaped long turns as soon as they finished. Look up bindings only for live adapter sessions, and idle from the later of binding lastSeenAt and the projected session updatedAt so a completed turn gets the full inactivity window. Adapted from pingdotgg/t3code pingdotgg#8909 pingdotgg#10689.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Greptile SummarySummary
Confidence Score: 5/5Safe to merge; there are no outstanding blocking issues. No new findings or outstanding previous findings. Reviews (2): Last reviewed commit: "Merge branch 'main' into leoisadev1/t3-p..." | Re-trigger Greptile |
This was referenced Sep 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Session listing and idle reaping both scaled from the wrong clocks.
listSessionsloaded every persisted thread binding, then looked each one up, so the call grew with conversation history instead of the live adapter session set. The session reaper treated bindinglastSeenAtas the only idle timestamp. That stamp is updated when a turn is sent, so a long turn that later completed or aborted could be stopped as soon as it finished instead of getting a full inactivity window.Changes
Look up bindings only for the unique thread ids of currently active adapter sessions. Historical bindings stay out of this path.
Idle time is
max(binding.lastSeenAt, session.updatedAt)after the cheaplastSeenAtskip. Ingestion updatessession.updatedAtwhen a turn settles, so ready, interrupted, and error sessions get the full window after that transition. Active turns and livebackgroundLivenessstill skip reaping. Akeru still usesAgentControllerrather thanProviderServicefor stop.Upstream
Reviewed adaptations of pingdotgg/t3code:
Scope
This PR is session listing and idle timing only. Independent of #220 and #229.
Assigned checkpoint and attachment ports are in those PRs:
Restart continuation remains with the capabilities worker.
Verification
vp test runof ProviderService and ProviderSessionReaper: 50 tests passed. New cases use Clock overrides and a deferred sweep, not sleeps.dispatchparameter warning in ProviderService.test.ts is unchanged.No UI layout or client-visible chrome change. Proof is adapter-session listing and reaper sweep tests.
Limitations
backgroundLivenessskip is preserved. Capabilities-owned restart continuation is not in this PR.Implemented and verified by Grok 4.6 High in Grok Build via Orca.