Repository navigation
Conversation
…s give it (12/14) atomesh's gRPC `/generate` stream decodes each chunk through the request's stop decoder, as the chat stream and the unary response do, and flushes it when the stream completes, so a character split across chunks is no longer lost and both `/generate` and `/v1/completions` streams join to the unary text; the streamed text also honours stop, stop_token_ids, skip_special_tokens and no_stop_trim. The generate SSE goldens are re-recorded with the restored spaces. The unary chat answer and the streamed usage chunk report the prefix-cache hit ATOM sends on each Complete in `usage.prompt_tokens_details.cached_tokens`, as ATOM's HTTP chat does. The protocol crate's chat `Usage` has no field for it, so `render::with_cached_tokens` adds it to the answer's JSON. An ATOM worker ends an output where a stop string's own ids match, and ATOM's HTTP routes return all of it. atomesh decodes the output of an ATOM worker, or an ATOM D, with none of the request's stops (`drop_stops_for_atom`), so a stop string the model writes with other ids no longer cuts the text, inside reasoning or content, where ATOM's HTTP chat keeps it. A gRPC chat answer always carries `message.content`, "" when the output has none, and a streamed chat opens on the engine's first message with a delta carrying the role and `"content": ""`, as ATOM's HTTP chat does. The chat SSE goldens are re-recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
Closed
Closed
Collaborator
Author
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.
Part 12/14 of the stack proposed in #3657. No blocking issues.
Why
atomesh's gRPC generate stream decoded each chunk's ids alone, so a streamed completion read "disa do sedu" where the unary one read "di sa do se du". atomesh also cut an ATOM worker's text at the first stop string it decoded, which ATOM's HTTP routes keep. A chat ending in its reasoning had no content key, and none reported cached tokens.
What changed
/generatestream decodes through the request's stop decoder and flushes it onComplete(generate_streaming::run_generate_stream), as the chat stream does./v1/completionsdiffs that text, so both streams join to the unary text, for every gRPC backend.drop_stops_for_atom): ATOM ends it where a stop's own ids match, as over HTTP.message.content("" when empty), and a chat stream opens with the role and"content": "", as ATOM's HTTP chat does.usage.prompt_tokens_details.cached_tokensfrom each Complete;render::with_cached_tokensadds it, as the protocol crate's chatUsagehas no such field.Review focus
Partialwhose text the decoder holds still gets its event, so itsoutput_idsreach the client.Testing
Streams sent token by token join to the unary text; an ATOM output keeps its text past a stop string, an SGLang one is cut.
jasen/atom-grpc-12-mesh-render@ 05a919b: withatom-engine, 1408 lib and 303 integration tests passed. cargo fmt clean; clippy's four new warnings are of kinds these files already carry.Follow-ups
none
Stack
ATOM serves
atom.grpc.v1.AtomEnginebeside its HTTP server (token ids in, token ids out, ATOM's P/D flow unchanged), and atomesh routes to ATOM gRPC workers, over a Generate call per request or one Session per instance. Bottom to top:1 and 2 stand alone; 6 to 13 need only part 3 of the Python side; 14 changes both sides of the Session.
Evidence
In
atom/mesh(rustc and clippy 1.100.0), at 05a919b:Clippy against main cccc96a (warnings matched by message and file):
Against the PR below (part 11):
The lib run's one failure,
policies::tree::tests::test_tree_structure_integrity_after_stress(main's radix-tree stress test, untouched here), came under host load; it passed 3 of 3 reruns, and a full lib rerun passed 1408 of 1408.The four new clippy warnings: one
result_large_errinchat_aggregator.rs, whose two otherResult<_, Response>functions main already flags, and threefield_reassign_with_defaultinrender/tests.rs, which main flags 35 times.Reverting the
drop_stops_for_atomcalls makestest_an_atom_output_keeps_what_atom_returned_past_a_stop_stringfail with""for"test test test".🤖 Generated with Claude Code