refactor(tito): allowed append roles become a pure harness gate - #1778
Closed
guapisolo wants to merge 9 commits into
Closed
refactor(tito): allowed append roles become a pure harness gate#1778guapisolo wants to merge 9 commits into
guapisolo wants to merge 9 commits into
Conversation
Add a manual TP8/EP8 session test and expose the fixed EAGLE serving recipe through ModelConfig. Keep SGLang TP/DP/PP/EP namespace fields on Miles' short-name contract, and forward the effective V3.2 thinking mode so SGLang separates reasoning before TITO comparison.
Remove the old-to-new mapping table and select tp_size, dp_size, pp_size, or ep_size directly from SGLang's registered aliases without changing the CLI surface.
Document that argparse derives its destination from the first alias, which is why Miles selects SGLang's short parallel-size field names.
…lates/ Copy sglang's encoding_dsv32/encoding_dsv4 (0.5.14.dev37+gf8cfad3) into miles/utils/chat_template_utils/templates/ verbatim (provenance header only) and route the deepseek bridge plus the test reference encoders through the vendored modules. Miles-side render modifications land separately; the sglang protocol.Tool seam stays on sglang so tool schemas keep serializing with the server's defaults. The vendored files are excluded from pre-commit formatters so they stay byte-diffable against upstream. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tool,user} surface
Upstream encoding_dsv32 gates every thinking block on last_user_idx, so a
new user turn strips historical think from the render and rewrites the
prefix — the reason V3.2 registered only the {tool} surface. Mirror
encoding_dsv4's gates in the vendored copy: drop_thinking=False now keeps
every assistant's thinking block and renders <think> openers position-
independently, while drop_thinking=True paths stay byte-identical to
upstream (corpus + raise parity tests). Pin drop_thinking=False on every
V3.2 surface and register {tool, user}; pure tool-loop histories render
byte-identically under either drop mode, so existing {tool} configs are
unaffected.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
guapisolo
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
jybsuper,
maocheng23 and
yueming-yuan
as code owners
July 23, 2026 23:23
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
guapisolo
added a commit
that referenced
this pull request
Jul 25, 2026
…server v2 The v5 multi-lineage design lands as an OPT-IN second implementation instead of replacing v1: --use-session-server grows an optional value (bare flag or "v1" = the untouched linear server, "v2" = tree serving), and the whole tree stack lives in miles/rollout/session/v2/. The v1 modules stay byte-identical to their pre-branch state. v2 package (carried from the v5 line, imports adjusted only): - session_state: always-branch serving over the forest — deepest attach point, suffix becomes the branch delta, non-extensions grow siblings or new roots; retry semantics moves entirely to the samples-op picker. Branch suffixes may carry client assistants (compaction); snapshot splice with zero-inheritance-root fallback on canonical-prefix divergence. Truncated-path extension is 409 (TruncatedGenerationError, defined here — v1 never raises it). --session-strict-append-only is the single-chain guard: branch shapes fail loud with attach diagnostics. - assembly: per-leaf fold (compute -> truncate -> fold), default pick (temporal-supersession retry trim; roots never trimmed; non-retry-shaped trees 422) and default merge (exactly-once completion masking over the surviving set, rewards keyed by response id, fold < agent < server metadata layering); both replaceable via --session-sample-picker-path / --session-merge-function-path (sync-only, loaded in-process). - core: v2 twin of SessionCore reusing v1's HTTP plumbing unchanged. Shared seams, each inert for v1 by construction: - sessions.py dispatches registry/core on the flag and forwards the collect body's "metadata" (agent semantic layer) only under v2. - codec: encode/decode parameterized by a fields tuple; v1 default keeps the wire byte-identical, v2 adds reward + per-sample metadata (COMPUTED_FIELDS_V2) with conditional overlay semantics on decode. - arguments: flag upgrade (nargs="?"), unknown values rejected, and the three v2 flags require --use-session-server v2. Tests: v2 HTTP matrix (tree pins incl. deep/root divergence branching, strict guard, truncation + compaction), session_state unit matrix, and the samples-op suite (golden, multi-leaf trim/masking/rewards, hook lanes) — all against a v2-flagged server; the restored v1 suites and the byte-exact A-list (git diff against the pre-branch base is empty) pin that the default path did not move. Rebased onto the tito/session PR stack (#1628/#1777/#1778 + #1759/#1760), with the stack's landed shape taken as authoritative: - supports_midpath_assistant_rerender (True on the base class) moves in here with its consumer, the v2 suffix gate. No family sets it False anymore: the vendored DeepSeek-V3.2 encoder renders position-independently under drop_thinking=False, so the gate text no longer names it; a stub family pins the fail-loud branch. - v2 serving fills SessionRecord.request_timestamp like v1, so folded samples keep their lifecycle req_ts across the wire. - codec: COMPUTED_FIELDS_V2 is re-expressed over the ValueSpec table (SAMPLES_VALUE_SPEC_V2 superset), same wire semantics. - v2 unit tests pin allowed_append_roles=["tool"] explicitly; the ctor default is tool+user since the append-roles PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keep the upstream and vendored encoder modules at test module scope so the parity helpers and exception checks share the reviewed dependencies without changing behavior.
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
from
July 25, 2026 08:13
eb9a023 to
0ec4229
Compare
guapisolo
force-pushed
the
feat/tito-append-roles-harness-only
branch
from
July 25, 2026 08:14
c171707 to
bdcd0af
Compare
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
from
July 25, 2026 08:39
0ec4229 to
20b701d
Compare
guapisolo
force-pushed
the
feat/tito-append-roles-harness-only
branch
from
July 25, 2026 08:39
bdcd0af to
f437d54
Compare
Keep the Miles-owned V3.2 encoder copy for drop_thinking while restoring V4 to SGLang encoding_dsv4. Narrow the pre-commit exclusion and parity-test import to the remaining V3.2 vendoring.
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
from
July 25, 2026 18:40
20b701d to
55a21c5
Compare
guapisolo
force-pushed
the
feat/tito-append-roles-harness-only
branch
from
July 25, 2026 18:40
f437d54 to
2ecc262
Compare
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
from
July 25, 2026 21:56
55a21c5 to
7075ef8
Compare
guapisolo
force-pushed
the
feat/tito-append-roles-harness-only
branch
from
July 25, 2026 21:56
2ecc262 to
6b5397d
Compare
guapisolo
force-pushed
the
feat/tito-append-roles-harness-only
branch
from
July 25, 2026 23:07
6b5397d to
a681181
Compare
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
2 times, most recently
from
July 25, 2026 23:36
673151c to
d1d4845
Compare
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
2 times, most recently
from
July 27, 2026 04:13
c7934eb to
5b9f935
Compare
guapisolo
force-pushed
the
feat/tito-default-append-tool-user
branch
7 times, most recently
from
July 27, 2026 06:15
a7da070 to
f2ae6e8
Compare
Collaborator
Author
|
Superseded by #1777: the flag-as-harness-gate design evolved into binding append roles to fixed templates (f230f07) and removing --tito-allowed-append-roles outright with FIXED_TEMPLATE-derived verify surfaces (19c3170). The still-valid test coverage from this branch (restricted-family schedule derivation, assistant-input rollback/regenerate, injected-assistants-are-not-generated-checkpoints) has been ported into those commits on #1777. |
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
Template resolution becomes role-independent; append roles only gate harness behavior.
Motivation
resolve_fixed_chat_templatekeyed template rows onallowed_append_roles, forcing every new append shape (mid-session system injection, assistant input for compaction or few-shot) through template-registration ceremony. With preserve-think kwargs pinned as family constants, one template per family serves every role set. Default-config renders stay unchanged: after #1777 they already rode the multi-role rows this PR folds down.Before / After
SUPPORTED_TEMPLATESrows per role set, resolved by smallest superset; after, each family registers oneFixedTemplate, resolved byresolve_fixed_chat_template(tito_model)with no roles argument.FIXED_TEMPLATE;tokenize_additional_non_assistantbecomestokenize_additional_messages;VALID_APPEND_ROLES(now includingassistant) becomes the single source for the CLI choices.qwen3.5_fixed.jinjarenders mid-session system messages instead of raising; the vendored dsv32 reasoning-required raise narrows to the upstreamdrop_thinking=Truepath; MiniMax tool-only configs swap from the HF-native template to the fixed jinja.Behavior Preservation
{tool, user}row already served every subset request.Verification
tests/fast/utils,tests/fast/router,tests/fast/rollout;test_fixed_templates.pyis rewritten as a full family matrix over the role-free resolver.Review Focus
FIXED_TEMPLATEkwargs against the previous multi-role rows.qwen3.5_fixed.jinjamid-session system block.