Repository navigation
test: cover serve session-lane order and non-string session ids - #185
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
A second submit and a later clear stay behind an in-flight prompt on that session, while another session and session-less frames proceed. Empty, numeric, and null session ids share the session-less lane. Co-authored-by: moikapy <[email protected]>
This branch has not been deployed
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.
Risky behavior now covered
Per-connection frame lanes from #183 serialize work by
params.session_id. The merge test showed that two sessions can run at once. These tests cover the ordering and parsing edges that were still open:prompt.submiton session A does not call the model until A's in-flight submit finishes, whilesession.clearon session B runs during that hang.session.clearon A sent during the still-held follow-up waits behind it. Dropping the lane when the first chain finishes would let that clear wipe the bag mid-run. A session-lesshealthframe still returns while A is busy.0,null, and arrayparamsshare the session-less lane withsession.create. A non-empty stringsession_iddoes not, so it is not blocked by that create.Test files added/updated
test/serve_prompts.test.tstest/serve_transport.test.tsWhy these tests materially reduce regression risk
Serve clients pipeline frames on one socket. If same-session ordering regresses, a clear or a second prompt can overlap an in-flight run and drop or fork that session's history. If non-string session ids grow their own lanes, session-less calls such as create, list, and health stop being ordered with each other. Both cases are concurrency bugs with a wide blast radius, and neither is implied by the existing cross-session test.
No production code changed. Focused vitest (
test/serve_prompts.test.ts,test/serve_transport.test.ts, 40 tests) andtsc --noEmitpassed. The full suite was not run; existingbunspawn anddist/cases fail in this environment.