feat: add bounded transient response sessions to core - #257
Draft
LOGO127 wants to merge 1 commit into
Draft
Conversation
Signed-off-by: luozijian <luozijian0924@gmail.com>
This was referenced Sep 6, 2026
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
Related to #238; this is a draft, core-only prerequisite, not a complete WebSocket implementation or a claim that #238 is fixed.
A response may need to continue from an in-memory checkpoint without making its history durable. This adds an opt-in, transport-independent continuation boundary in the existing core executor:
ResponseSession,ResponseSessionGroup, andResponseContinuationprovide typed checkpoint lookup and one active execution per session. Group members can share a retained parent while keeping independent execution and failure lifetimes.Review and integration boundary
This is based directly on current main
74c6b2d, without importing the unmerged #240 branch. It intentionally does not activate sessions in the WebSocket handler, replace #240's multiplexer, introduce another ingestion/relay path, or choose transport admission, stream-limit, and connection-expiry policies. A follow-up adapter should use the agreed transport design and preserve #240's work.The budgets are caller-supplied retained-state limits, not a process-heap or temporary-allocation bound. Cancellation after a database COMMIT has begun cannot guarantee rollback. Those are explicit contract boundaries, not claims of complete transport compatibility.
API impact:
RequestContextgains an optionalcontinuationfield. Workspace struct literals are updated; downstream literal construction will also need the field (normallyNone).The proposed maintenance slice is continuation history, retention accounting, and disposal correctness. Scope/API feedback is welcome before transport integration. AI assistance was used for implementation and verification; I have personally reviewed the patch and signed the contribution.
Test Plan
Revalidated the exact signed commit
51c3613using a fresh, isolated build directory on WSL Ubuntu x86_64 / Rust 1.98.0:cargo test --locked --offline --workspace --all-features -- --test-threads=4 --quiet: 940 passed, 9 ignored across 42 test/doctest targets, excluding duplicate nested subprocess summaries. The ignored cases are eight PostgreSQL-specific tests and one existing doctest.cargo clippy --locked --offline --workspace --all-targets --all-features -- -D warnings: passed.git diff HEAD^ HEAD --check: passed.Storage for this fresh full run was SQLite/disabled storage, with local mock/cassette upstreams. PostgreSQL is not fully green: an earlier isolated run of the preceding 27-test session suite had 25 passes (17 disabled-storage controls) and two explicit-Conversation failures. Both also fail in no-session controls because main's
ConversationStore::get_or_createhas acreated_atSQL ambiguity (42702). #166 already contains the relevant qualification; I supplied the independent reproduction there and have not duplicated that fix here. The subsequently added partial-write rollback test passed on PostgreSQL separately, but the full 28-test PostgreSQL suite was not rerun.No live-model/GPU, MSRV, performance, or release/platform certification is claimed.