Repository navigation
server: /train examples carry their tools, and a message can be context without being trained - #22
Merged
joelteply merged 1 commit intoSep 27, 2026
Conversation
…xt without being trained A lived turn is a served conversation: a system prompt, history that includes the model's own earlier replies, the tools it was offered, and one reply that is the lesson. /train could not express that. Every assistant turn in a messages example was trained, and no tools reached the template, so the rendered prompt lacked the tool block the model was served with. - "tools" on an example is passed to the chat template exactly as serving passes it (common_chat_tools_parse_oaicompat). - "train": false on a message keeps it as context: it renders, it is not located as a span, and it carries no loss. The key is read and removed before the template sees the message. A non-boolean value is refused. Smoke on the M5 (qwen2.5-0.5b, Metal, -ngl all): one example with history, an earlier reply and a tool call. 193 tokens both ways; 25 trainable with the earlier reply marked train:false, 33 with it trained; a string value refused as examples[0].messages[2].train must be a boolean. 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
Sep 27, 2026
…onversation, with only her reply trained
A lived call reaches /train as the conversation she was served: the system
prompt, every served message, and her reply with its reasoning_content and
tool calls. Her earlier replies in that history carry "train": false, so
they are context and not trained again. The tools she was offered ride on the
example, so the prompt renders with its tool block. Other examples still go
as {prompt, completion}.
The OpenAI tool mapping moves to request_body::openai_tools, one mapping for
serving and for the trainer.
Needs CambrianTech/llama.cpp#22 on the engine for the train flag and tools.
An older engine renders the history reply as trained and ignores the tools.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Author
|
APPROVED at a1cf473 (Cormac). I read the code and did not build it; your M5 smoke (25 vs 33 trainable, and the string refused) is the run it rests on.
Non-blocking: a 🤖 Generated with Claude Code |
joelteply
added a commit
to CambrianTech/continuum
that referenced
this pull request
Sep 27, 2026
…d example carries its call (card ad107e18) (#4445) * feat(training): a staged turn holds the calls she lived, and a settled example carries its call (card ad107e18) A card-linked turn staged only its stimulus and an acted chain, so what reached a bucket was a re-derivation of the turn, not the turn. Now: - Every generation receipt carries the prompt capture cursor it was recorded under: the link from an example back to its trace (Kimi's provenance rule). - When a turn stages, every served call is read back from the capture (the exact request the engine was served, her exact response with reasoning and tool calls) and held on the staged row, because the capture rotates within hours and a card can settle days later. Each four-act restage reads only the new calls. A turn with any call that cannot be read back holds no lived record and says why (training.credit.lived_unavailable), never a partial one. - A card that settles PASS submits one example per lived call, each carrying its call whole (TrainingExample.lived) with the flat prompt/completion kept as a projection for trainers that take text. - Once the destination accepts the transfer, the row drops its copy of the calls and keeps the receipts, so settled rows stay small. - One decoder of a schema-4 capture (prompt_capture::decode) now serves both the replay command and the lifter. Not in this slice, named on the card: the correction-aware lift, thread pointers across turns, and the selection weights Kimi asked for (loops, announcements, predictions about peers); the engine trainer rendering TrainingExample.lived through the served chat template (#4443). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(training): name the submit boundary on the lived examples' serialization Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(training): the engine trainer's test example carries lived: None (rebase onto #4443) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * feat(training): the engine trainer sends a lived call as its served conversation, with only her reply trained A lived call reaches /train as the conversation she was served: the system prompt, every served message, and her reply with its reasoning_content and tool calls. Her earlier replies in that history carry "train": false, so they are context and not trained again. The tools she was offered ride on the example, so the prompt renders with its tool block. Other examples still go as {prompt, completion}. The OpenAI tool mapping moves to request_body::openai_tools, one mapping for serving and for the trainer. Needs CambrianTech/llama.cpp#22 on the engine for the train flag and tools. An older engine renders the history reply as trained and ignores the tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(training): a lived call's history is framed by the same wire_messages serving uses (Cormac on #4445) engine_example mapped history as role plus content_text(). Serving keeps tool_calls on her assistant turns and splits ToolResult into role:tool messages bound by tool_call_id, so every call after her first act trained against a history she never saw. format_messages is split: wire_messages is the config-free mapping (system prompt, tool calls, tool results, image gating), and format_messages adds the gateway's /no_think switch on top. The trainer frames the history with wire_messages, marks each assistant turn train:false, and builds her reply's tool calls with the same wire_tool_call. The test history now carries an act and its result, and asserts both reach /train as serving sent them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(training): the trainer closes a history that ends in her own turn, as serving does (Cormac on #4445) Serving runs close_trailing_assistant after framing, so a self-tick history ending in her turn got a [continuation] user message before her reply. The trainer skipped it and rendered two assistant turns in a row. It now calls it after wire_messages; the test asserts no two assistant turns are adjacent. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(training): the receipt carries the COMPLETED capture entry's cursor, the one that holds her response The test caught a real defect: a finished call is a NEW capture entry, and the cursor the receipt took (lease.cursor(), the submission's) reads back as the request with no response. Every production read would have named the turn unavailable. PromptCaptureSink::terminal and CaptureLease::finish now return the completed entry's cursor, and the faculty finishes the lease before building the receipt, so with_capture records that cursor. The test asserts the submission cursor alone reads as a hole and the completed one reads whole. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * chore(protocol): ts-rs bindings for LivedCall and TrainingExample.lived TrainingExample.ts is CI's regenerated diff verbatim; LivedCall.ts follows the generator's form for the new type (imports sorted, field docs as emitted). 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
added a commit
that referenced
this pull request
Sep 27, 2026
…ormed-tools server: /train refuses a "tools" that is not an array (Cormac on #22)
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.
Card ad107e18 in continuum: a training example is the turn the model actually lived.
toolson an example. It is passed to the chat template exactly as serving passes it, so the trained prompt has the tool block the model was served with."train": falseon a message. It keeps an assistant turn as context: rendered, never located as a span, no loss. The key is removed before the template sees the message. A non-boolean value is refused.Smoke on the M5 (qwen2.5-0.5b, Metal,
-ngl all), one example with history, an earlier reply, a tool call and tools:train: falseA string value is refused with
examples[0].messages[2].train must be a boolean.The continuum side sends lived calls this way in continuum#4445.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo