Repository navigation
Conversation
|
A case file has been opened for 685. Future reviews will auto-run 90 minutes after code updates are pushed.
|
2f0ed9d to
80c87b3
Compare
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core streaming mechanism in
Walkthrough
Merge Risk: High · up to
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core streaming mechanism in
Walkthrough
Merge Risk: High · up to
|
80c87b3 to
b9864ab
Compare
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe incremental DSML streaming core (
Walkthrough
Merge Risk: High · up to
|
A DeepSeek tool call now reaches the client as the model writes it: the call's name is announced when its header completes, and its argument text is published fragment by fragment instead of arriving whole when the invoke tag closes. The pinned `deepseek-recipe` parser already releases each argument label and text fragment as it decodes input, but `DsmlOutput` collected them and emitted the begin, arguments and end events together at `ToolCallArgumentsEnd`. A client therefore received nothing between the tool name and the finished argument object: a multi-kilobyte `write` argument left the stream silent for the whole generation, which a client renders as a stalled response and an agent loop cannot tell apart from a hung model. The encoder and both block emitters already open a tool call on `Event::ToolBegin` and forward each `Event::ToolArguments` fragment, so the defect was confined to when the parser published them. `DsmlOutput::apply` now emits `Event::ToolBegin` at `ToolNameEnd`, publishes the argument bytes appended by each argument-text action and the rest at `ToolCallArgumentsEnd`, so label bytes travel with the next text fragment or that end, and emits `Event::ToolEnd` after `validate_arguments` accepts the object. A `string="false"` value stays private while `close_literal` may still rewrite it, so no published byte is replaced, and the published fragments concatenate to exactly the stored arguments. Strict tools keep the existing parking path, so they still emit no frame before the compiled schema accepts their arguments. A call announced before its arguments are complete must not fail the request when the generation is cut short. `Accumulator::finish` keeps its pre-PR `&self` shape and its error for an unfinished call at natural end-of-sequence; the drop of an announced but unfinished Chat call moves to `discard_unfinished_call`, which `Encoder::finish` calls under `drops_unfinished_call(cause)`. On the Responses wire, `ResponseOutput` reports the block it closed for a truncated call through `is_abandoned(index)` while the encoder renders its closing frame, and `discard_abandoned()` removes it afterwards. An abandoned item reports status `incomplete` for every termination that drops it, not only for the output limit, and a custom tool call among them skips the JSON parse and grammar validation over arguments that never arrived and closes with an empty input instead of failing the request. `docs/api.md` states which parsers publish fragments, what those fragments concatenate to, how a truncated call ends, and that a `required` or named tool choice still fails when omitting the call leaves no completed call. Two contracts `main` guarantees change here, and both follow from publishing before the envelope closes: a non-EOS truncation omits the announced call where `main` raised `incomplete emitted tool call`, and streamed fragments are published before `validate_arguments` and before the 1 MiB parser bound that NVIDIA#364 introduced. @voipmonitor and @yatesdr, as NVIDIA#364's author and reviewer: do you accept the omission rather than the error for a non-EOS truncated call, and post-publication validation and size enforcement for streamed calls? If either answer is no, say which behavior you want and this pull request changes instead of leaving the rule reversed. Clients receive the tool name as soon as the call opens and argument text as the model writes it, and it works against the served backend: a live request that previously returned two frames for a 2.2 KB `write` argument now returns 566. The fragments a client assembles equal the arguments of the completed call byte for byte, reasoning, content and tool-call ordering are unchanged, and a call cut off by an output limit, a stop string or a cancellation now ends as an incomplete item rather than a failed request. The Qwen function-tag, GLM argument-tag, MiniMax XML and Gemma call parsers still buffer because their arguments are synthesized from parameter syntax, so this pull request streams only the DSML dialect. A chat-completions request with `stream: true`, one `write` tool and `tool_choice: "required"` returned 566 argument frames totalling 2196 bytes, and their concatenation hashed identically to the same request's non-streaming arguments; the tagged dialects were not exercised against a served model. Tests: `helios/src/server/protocol/tests.rs` drives a truncated custom call and a truncated function call on all three wire protocols and every termination cause, including the custom call's empty input, its missing input frames and the forced tool choice that must still fail, and it holds the truncation matrix as one table per property. In `helios/src/output/dsml.rs` the streaming tests assert the published prefix while an envelope is open, concatenation against the stored arguments at every UTF-8 split, a rewritten literal, end-of-sequence and schema rejection after fragments, and the folded truncation rows. On `75764de2`, `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --no-fail-fast` runs all fifteen targets and reports 1848 passed, 20 failed and 84 ignored, against 1846 passed and 21 failed for the same command at `b9864ab8`; all 20 failures exist at both heads, eleven of them engram tests that fail against this host's 8 MiB `RLIMIT_MEMLOCK` (`register Engram staging: Cannot allocate memory`) and pass when run alone, nine needing `FLARE_TEST_TEMPLATE_DIR` from `tests/frontend/prepare_templates.py`, and the `message_boundaries` suite failing the same 3 tests at both heads. The `deepseek_output` and `deepseek_requests` integration suites pass 15 each. `cargo build --locked --release --manifest-path flare/Cargo.toml` and the same for `flare-cli/Cargo.toml` both succeed, and their suites report 254 and 245 passed with no failure. Two probes drive the review's symptoms directly: at `b9864ab8` a truncated custom call fails with `custom tool input does not match its grammar` and a `UserStop` truncation reports status `completed`; at `75764de2` both succeed with status `incomplete`. Design-Signed-Off-By: pi coding agent; design-review=2e5b Signed-off-by: Giulio De Pasquale <git@depasquale.giugl.io>
75764de to
dd38123
Compare
|
@flare-autobot take another look please |
|
Autobot declined to run because no new commits have been pushed since the last review. See the existing Case file — push new changes and mention |
A custom tool call publishes no argument fragment while the model writes, and the text a client assembles is the item's input rather than the stored argument object, so the fragment-identity sentence held only for function calls. Design-Signed-Off-By: pi coding agent; design-review=2e5b Signed-off-by: Giulio De Pasquale <git@depasquale.giugl.io>
|
@flare-autobot the head now carries a new commit since your last pass (826a427): please take another look. |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedCommit
Walkthrough
Merge Risk: Medium · up to
|
Only a Responses item carries a status: a truncated Messages block ends with content_block_stop and reports the truncation through message_delta, and a Chat call has no per-call closing frame. Design-Signed-Off-By: pi coding agent; design-review=2e5b Signed-off-by: Giulio De Pasquale <git@depasquale.giugl.io>
|
@yatesdr, @voipmonitor do you have feedback on this? |
Design-Signed-Off-By: pi coding agent; design-review=2e5b Signed-off-by: Giulio De Pasquale <git@depasquale.giugl.io>
|
Round 4's three simplifications and two nits are on the head, and every technical finding is closed: One ordering detail follows from the first item: the 1 MiB check now runs inside @voipmonitor @yatesdr: the remaining blocker is your decision on the two @flare-autobot the head carries the review's simplifications and two documentation commits. |
A DeepSeek tool call now reaches the client as the model writes it: the call's name is announced when its header completes, and its argument text is published fragment by fragment instead of arriving whole when the invoke tag closes.
The pinned
deepseek-recipeparser already releases each argument label and text fragment as it decodes input, butDsmlOutputcollected them and emitted the begin, arguments and end events together atToolCallArgumentsEnd. A client therefore received nothing between the tool name and the finished argument object: a multi-kilobytewriteargument left the stream silent for the whole generation, which a client renders as a stalled response and an agent loop cannot tell apart from a hung model. The encoder and both block emitters already open a tool call onEvent::ToolBeginand forward eachEvent::ToolArgumentsfragment, so the defect was confined to when the parser published them.DsmlOutput::applynow emitsEvent::ToolBeginatToolNameEnd, publishes the argument bytes appended by each argument-text action and the rest atToolCallArgumentsEnd, so label bytes travel with the next text fragment or that end, and emitsEvent::ToolEndaftervalidate_argumentsaccepts the object. Astring="false"value stays private whileclose_literalmay still rewrite it, so no published byte is replaced, and the published fragments concatenate to exactly the stored arguments. Strict tools keep the existing parking path, so they still emit no frame before the compiled schema accepts their arguments.A call announced before its arguments are complete must not fail the request when the generation is cut short.
Accumulator::finishkeeps its pre-PR&selfshape and its error for an unfinished call at natural end-of-sequence; the drop of an announced but unfinished Chat call moves todiscard_unfinished_call, whichEncoder::finishcalls underdrops_unfinished_call(cause). On the Responses wire,ResponseOutputreports the block it closed for a truncated call throughis_abandoned(index)while the encoder renders its closing frame, anddiscard_abandoned()removes it afterwards. An abandoned item reports statusincompletefor every termination that drops it, not only for the output limit, and a custom tool call among them skips the JSON parse and grammar validation over arguments that never arrived and closes with an empty input instead of failing the request.docs/api.mdstates which parsers publish fragments, what those fragments concatenate to, how a truncated call ends, and that arequiredor named tool choice still fails when omitting the call leaves no completed call. It scopes the fragment-identity claim to function calls, because a custom tool call publishes no fragment while the model writes and the text a client assembles is the item's input rather than the stored argument object.Two contracts
mainguarantees change here, and both follow from publishing before the envelope closes: a non-EOS truncation omits the announced call wheremainraisedincomplete emitted tool call, and streamed fragments are published beforevalidate_argumentsand before the 1 MiB parser bound that #364 introduced. @voipmonitor and @yatesdr, as #364's author and reviewer: do you accept the omission rather than the error for a non-EOS truncated call, and post-publication validation and size enforcement for streamed calls? If either answer is no, say which behavior you want and this pull request changes instead of leaving the rule reversed.Clients receive the tool name as soon as the call opens and argument text as the model writes it, and it works against the served backend: a live request that previously returned two frames for a 2.2 KB
writeargument now returns 566. The fragments a client assembles equal the arguments of the completed call byte for byte, reasoning, content and tool-call ordering are unchanged, and a call cut off by an output limit, a stop string or a cancellation now ends as an incomplete item rather than a failed request. The Qwen function-tag, GLM argument-tag, MiniMax XML and Gemma call parsers still buffer because their arguments are synthesized from parameter syntax, so this pull request streams only the DSML dialect. A chat-completions request withstream: true, onewritetool andtool_choice: "required"returned 566 argument frames totalling 2196 bytes, and their concatenation hashed identically to the same request's non-streaming arguments; the tagged dialects were not exercised against a served model.Tests:
helios/src/server/protocol/tests.rsdrives a truncated custom call and a truncated function call on all three wire protocols and every termination cause, including the custom call's empty input, its missing input frames and the forced tool choice that must still fail, and it holds the truncation matrix as one table per property. Inhelios/src/output/dsml.rsthe streaming tests assert the published prefix while an envelope is open, concatenation against the stored arguments at every UTF-8 split, a rewritten literal, end-of-sequence and schema rejection after fragments, and the folded truncation rows.On this head,
cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --no-fail-fastruns all fifteen targets and reports 1848 passed, 20 failed and 84 ignored. The same command at the branch point1fbcc3c9reports 1776 passed and 17 failed in the library plus the same 3message_boundariesfailures, so the twenty failures are older than this pull request and none of them touches the tool-call code: eleven engram tests fail against this host's 8 MiBRLIMIT_MEMLOCK(register Engram staging: Cannot allocate memory) and pass when run alone, and nine chat-template tests needFLARE_TEST_TEMPLATE_DIRfromtests/frontend/prepare_templates.py. Thedeepseek_outputanddeepseek_requestsintegration suites pass 15 each.cargo build --locked --release --manifest-path flare/Cargo.tomland the same forflare-cli/Cargo.tomlboth succeed, and their suites report 254 and 245 passed with no failure. Two probes drive the review's symptoms directly: at the branch point a truncated custom call fails withcustom tool input does not match its grammarand aUserStoptruncation reports statuscompleted; on this head both succeed with statusincomplete.Discord: peperunas