fix(gateway): abort active runs during sessions.reset#16571
Closed
Grynn wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(gateway): abort active runs during sessions.reset#16571Grynn wants to merge 1 commit intoopenclaw:mainfrom
Grynn wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Contributor
Author
|
Closing in favor of #16576 (same fix, re-authored commit metadata). |
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.
Summary
sessions.resetruntime cleanup withsessions.deleteby clearing queues and stopping subagents for the target session key before resettingUNAVAILABLEwhen the session is still active after timeout, instead of returning a misleading reset successsessions.resetwith an active runWhy
Live debugging showed
agent:main:maincan remain stuck after embedded run timeouts.sessions.resetpreviously rotated IDs/transcripts but did not clear runtime lane/queue state.Closes #16568.
Testing
pnpm exec vitest run --config vitest.e2e.config.ts src/gateway/server.sessions.gateway-server-sessions-a.e2e.test.tsGreptile Overview
Greptile Summary
This PR aligns the
sessions.resethandler with the existingsessions.deletehandler by adding runtime cleanup before session ID rotation. Specifically, it clears session queues, stops subagents, aborts any active embedded Pi run, and waits for shutdown before proceeding with the reset. If the session is still active after a 15-second timeout, it returnsUNAVAILABLEinstead of a misleading success response.sessions.reset, matching the existingsessions.deletecleanup patternUNAVAILABLEerror when an active session cannot be stopped within the timeout windowsessions.resetwith an active runConfidence Score: 5/5
Last reviewed commit: c45f57e
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!