Skip to content

server: a request that continues her last response is served from the tokens her slot holds (4.14 slice b) - #149

Closed
joelteply wants to merge 5 commits into
codex/s4-per-mind-integrationfrom
fable/continue-her-response
Closed

joelteply wants to merge 5 commits into
codex/s4-per-mind-integrationfrom
fable/continue-her-response

Conversation

@joelteply

Copy link
Copy Markdown

Why

Never process twice: a persona's generated tokens, reasoning included, are never discarded and recomputed. Continuum CONTINUUM-ENGINE 4.14, 'her token history is the engine's' (ggml-org#6092 at 2491e3435).

Measured (the defect)

The M5, 2026-11-17, Aris (capture 8044b75b). Each generation carries reasoning (95-726 chars in her last three acts) that the next request's re-rendered assistant message omits. Her KV [prompt N][G_N] stops matching at her own response, and the hybrid's recurrent state rewinds to a checkpoint. reuse_split gap=2048 on every act; prefill 7-10k tokens per act at ~100 tok/s.

Change

  • server-continuation.h: continue_from, pure. Inputs: her slot's tokens, the prompt length she was served, her last completion id, the request's tokens and message spans. Output: held ++ request[end_of_turn_of_her_response..], or a typed miss (other_response, not_hers, not_generated, no_response, no_end_of_turn, has_media). Her response is the newest assistant span that something follows (the last span is the generation prompt).
  • server-context.cpp: the slot records served_response/n_served at its final response. launch_slot_with_task continues after the adapter check (an adapter change clears the slot, so it never splices across adapters) and shifts message_spans and view_end_pos. Hits and misses are logged with their numbers and reason.
  • Request field continues (optional). Absent means unchanged behaviour.

Test

test-server-continuation (7 cases, each with what it catches), built and run locally: ok. Server TU -fsyntax-only on this base: ok. Not built whole locally (the M5 is serving).

Measured after deploy

Owner: Fable. The core sends continues (slice c), then on the M5: continuing ... log lines, prefill tokens per act == new tokens, reuse_split gap 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 2 commits November 17, 2026 14:10
… tokens her slot holds

Her slot holds [the prompt she was served][the tokens she generated]: her reasoning, words
and call as sampled. Her next request re-renders that response from its parsed message,
without her reasoning, so its tokens differ from hers at her own response; the hybrid's
recurrent state cannot truncate there and rewinds to a checkpoint (the M5, 2026-11-17:
reuse_split gap 2,048 on every act). A request naming the response it continues
(`continues`: the completion id her last response carried) is served as her held tokens
plus the request's tokens from the end-of-turn that closes that response. Every condition
(same response, her history held, she generated, an end of turn) is checked; a miss is
said with its reason and the request is served as sent. Pure logic in
server-continuation.h, proven by test-server-continuation (7 cases). CONTINUUM-ENGINE 4.14
slice (b).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ass during her tool and her next request both continue her response

A continuation keeps every earlier response as its prefix; any other task clears the lineage
at launch, so it never outlives the tokens it describes. A splice keeps her tokens only up to
the continued response's end (the prompt cache finds what follows). The warm pass that today
re-sends the prompt she was served truncates her generated tokens out of her KV; continuing
her response instead keeps them. test-server-continuation: 12 checks incl. the warm pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Author

Review of f79e6e4: changes required before integration.

  1. continue_her_response clears lineage and continues ordinary processing on a requested continuation miss, including media. Logging served as sent still silently permits re-prefill and replacement of held state. Return a typed refusal through the existing response owner and preserve held state. Starting a cold epoch must be explicit.
  2. continue_from compares the submitted prefix before the newest assistant response with the raw held prefix. After the first successful splice preserves reasoning omitted from the client's rendering, the next continuation compares different prefixes at that earlier response. Add a three-consecutive-act regression with omitted reasoning; the current single-splice and warm-lineage cases do not exercise this.
  3. Success still consumes a fully rendered/tokenized history, scans its old prefix and copies the entire held prefix into a fresh vector. This is not the native owner/descriptor plus new-delta contract. Bind the retained lineage and consume only new input; measure existing-history bytes tokenized, scanned and copied, alongside switch latency.

No merge or deployment approval. Shared these findings with Fable through AIRC.

@joelteply
joelteply marked this pull request as draft November 17, 2026 20:20
@joelteply

Copy link
Copy Markdown
Author

Blocked, by design (Codex's review, confirmed): from act 3 the request's history re-renders act 1's response WITHOUT its reasoning, while the slot holds it WITH, so the full-prefix comparison misses every act after the first splice. And the success path still compares and copies the whole history. The right shape: her slot owns the lineage (her native tokens, and an epoch descriptor), and the request carries only the messages new since her continued response. The server renders only that delta and appends; no full-history compare or copy. A miss is a typed refusal (landed here in 2c: continuation_refused, 409, lineage kept). Reworking to delta-only; the next push adds the three-act regression with omitted reasoning.

…behind a stub of her response; never her history re-rendered, compared or copied

The request names the response it continues and carries only the messages after it. The
server renders them behind a short stub (a user line, an assistant turn whose tool calls the
new tool results answer), never her response, and cuts at the stub's end of turn: the
template's own glue that closes her turn, then the new messages. Her request is her lineage's
held tokens up to that response's end plus the delta. No history comparison: the lineage
names the response, and any non-continuation clears it. Misses (no stub delimiter, no end of
turn, other response, not generated, media) are refused, typed (continuation_refused).
test-server-continuation: three consecutive acts with reasoning the caller never sends
(Codex's act-3 case), the warm-pass lineage, and every miss.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit to CambrianTech/continuum that referenced this pull request Nov 17, 2026
…V during every tool call (#6111)

* Her request continues her last served response, and the warm pass that truncated her generated tokens is deleted

Her request names itself (request_id) and the request whose response her engine holds as her
newest (continues). Our fork (CambrianTech/llama.cpp#149) then serves it from her slot's tokens
for that response (her reasoning and her call as she generated them) plus only what is new,
instead of re-rendering her response without its reasoning and rewinding to a checkpoint to
recompute it (the M5, 2026-11-17: a 2,048-token gap on every act). Inert until the pin
includes #149: an engine that does not read the fields ignores them.

The warm pass during her tool (prefill_during_tool) re-sent the prompt she was served, which
truncated her generated tokens out of her KV; it is deleted. Her slot keeps her tokens; a slot
another mind took is paged in by her real request, and becomes the 4.14 persona bind.
CONTINUUM-ENGINE 4.14 slice (c). -271 +74 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Narrow to the warm-pass deletion: the continues wire field waits for the token-id append (4.14), and 21 touched literals tripped touched-file ratchets

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* A regression for the deleted warm pass: her act and her next generation are the only requests on her slot

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* act_verdicts: coerce the scripted adapter at the constructor (E0308)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* act_verdicts: share the scripted adapter by Arc::clone with its trait object type (contract_shape: no .clone() in a call argument)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@joelteply

Copy link
Copy Markdown
Author

Closed, superseded: the stub-rendered text delta still re-renders and re-tokenizes new messages every act (encoding on the hot path). Replaced by the token-id append on the persona seam (fork #147: llama-persona-tokens, one validated transaction appending raw ids), per CONTINUUM-ENGINE 4.14.

@joelteply joelteply closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant