fix(cli): share session runtime with HTTP listeners - #11410
Merged
Conversation
chrarnoldus
approved these changes
Jun 18, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Verified the key correctness points:
Fix these issues in Kilo Cloud Reviewed by glm-5.2-20260616 · 762,286 tokens Review guidance: REVIEW.md from base branch |
NJ-2020
pushed a commit
to NJ-2020/kilocode
that referenced
this pull request
Jul 4, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
fix(cli): share session runtime with HTTP listeners
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.
Remote session prompts enter the CLI through
RemoteSender, which executesSessionPromptonAppRuntime. HTTP abort and session-control requests enter throughServer.listen(). Those two entry points currently build separate Effect service graphs, so they do not share the sameSessionRunState,BackgroundJob,SessionStatus,Bus, orEventV2Bridgeinstances. An abort can therefore reach the correct directory and return success while looking in a listener-local runner map that does not contain the activeAppRuntimesession or its subagents.This is complementary to #11404, not an alternative to it. #11404 fixes the directory dimension: Agent Manager can move a session mapping from directory A to directory B while the runner remains owned by A, so the extension must abort every possible owning directory. This change fixes the service-instance dimension: even when abort targets the correct directory, a runner created through
AppRuntimeis invisible to a listener built with a separate memo map. #11404 does not reconnect those service graphs, and this change does not discover moved directory owners. Both fixes are required for their respective paths.The split was introduced in
b7a7ecf449(refactor: kilo compat for v1.14.34), when the native Effect HTTP listener began constructing the complete route graph withLayer.makeMemoMapUnsafe().AppRuntimecontinued using the process-wide memo map, so stateful session services diverged between remote-session ingress and HTTP control routes. Later listener lifecycle refactors preserved that separation.The listener now keeps transport, routing, authentication, CORS, and shutdown state fresh per listener while obtaining application services from the shared
AppLayerthrough the process-wide memo map. V2 session handlers likewise consume the sharedEventV2Bridgeinstead of creating another bridge. Kilo-specific composition lives undersrc/kilocode/, leaving only narrow hooks in shared upstream files.