feat(session): session server v2 — opt-in trajectory-tree serving; v1 preserved byte-exact - #1771
Closed
guapisolo wants to merge 8 commits into
Closed
feat(session): session server v2 — opt-in trajectory-tree serving; v1 preserved byte-exact#1771guapisolo wants to merge 8 commits into
guapisolo wants to merge 8 commits into
Conversation
guapisolo
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
jybsuper,
maocheng23 and
yueming-yuan
as code owners
July 23, 2026 10:08
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
July 23, 2026 19:42
96f91e7 to
58bc6d5
Compare
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
July 25, 2026 01:30
58bc6d5 to
0a603cb
Compare
guapisolo
marked this pull request as draft
July 25, 2026 01:48
4 tasks
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
July 29, 2026 02:25
0a603cb to
726d141
Compare
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
July 30, 2026 01:06
726d141 to
44aa107
Compare
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
7 times, most recently
from
August 2, 2026 23:14
02f26d7 to
cca9e35
Compare
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
August 3, 2026 07:50
4e50fc2 to
c19f244
Compare
Select v2 explicitly for multi-role GPU verification and generic agentic and pretokenized CPU fixtures. Align test assertions with v2 trajectory lists and tree metadata while preserving intentional v1 characterization coverage.
guapisolo
force-pushed
the
feat/session-rollback-mode
branch
from
August 3, 2026 20:05
10548c5 to
f52b9f4
Compare
guapisolo
marked this pull request as ready for review
August 3, 2026 22:19
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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.
Motivation
The session server needs multi-lineage trajectory support (retries, compaction with carried assistants, subagent forests). Earlier revisions of this branch replaced the linear implementation in place; that made a brand-new system look like an evolution of the old one and put the default production path at risk. This revision restructures the work so that:
git diffagainst the pre-branch base is empty for every v1 module and test file.--use-session-server v2), fully contained inmiles/rollout/session/v2/.Commit series (atop the stacked picks)
test(session): nine byte-exact HTTP pins for the v1 retry/rollback surface, verified against the untouched tree — the default path can never move silently. Includes a characterization pin for v1's few-shot prompt-assistant anchoring quirk (out of v1's append-only + one-step-retry envelope; such flows belong to v2).fix(tito): preserve-think kwargs become family constants on every template surface ("never cut think"), plussupports_midpath_assistant_rerendermarking DeepSeek-V3.2's structural exception. Spike-verified byte-identical on pure tool loops.feat(session): v2 trajectory tree — node = end of one model generation, full root→node token snapshots, pure deepest-prefix attach search, append-only commits under the session lock (MAX_NODES=1024backstop).feat(session): session server v2 — always-branch serving (mismatches grow siblings/new roots; retry semantics moves to the samples-op picker),--session-strict-append-onlysingle-chain guard, compaction splice with zero-inheritance-root fallback, 409 on extending truncated generations, per-leaf assembly with default pick (temporal-supersession trim, roots never trimmed, non-retry-shaped trees 422) and default merge (exactly-once completion masking, rewards keyed by response id), both replaceable via--session-sample-picker-path/--session-merge-function-path. Version dispatch is a ~10-line seam insessions.py; the codec is parameterized so the v1 wire stays byte-identical while v2 addsreward/metadata.feat(rollout): driver-side seam — the agent's semantic layer (per-branch rewards) travels throughcollect_samplesunder v2 and comes back applied by the server-side merge; the v1 driver path (metadata overlays,{"max_seq_len": ...}collect body) is byte-equal to before, pinned.test(session): tree-merge legality invariants — an independent oracle over randomized forests (seeded fuzz banks for retry shapes, truncation, guardrail-422 shapes) plus targeted edges (chained retries, equal-length twins, fork-below-fork ownership, mid-path length turns).Testing
git diffagainst base; new v1 pins green against the pristine tree.Follow-ups
session_verify_runnerbranching-harness variant) on 4×H200 CI.🤖 Generated with Claude Code
https://claude.ai/code/session_01NmYsBAGK6NDt1LzjA7VSqH