feat: chunked exec streaming — server-side temp file assembly (#116) - #107
Merged
Conversation
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
…ls.py (#116) Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
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.
What
Adds server-side chunked exec streaming support — receives
exec_chunkmessages from nodes, assembles base64-encoded chunks into temp files, and resolves waiters with the file path on completion.How
Config — four new fields on
NodeServerConfig:exec_chunk_dir— temp file directory (default/tmp/hermes-exec-chunks)exec_chunk_max_total_mb— total disk cap across all active chunks (default 50 MiB, 0 = unlimited)exec_chunk_timeout_s— stale chunk timeout (default 30s)exec_chunk_size— advisory chunk size advertised to nodes (default 64 KiB)Registry —
ChunkStatedataclass + lifecycle methods (get/set/remove_chunk_state,fail_node_chunks). Wired intoregister()/unregister()for disconnect cleanup.Server dispatch —
_handle_exec_chunk()interceptsexec_chunkmessages in the WebSocket loop, decodes base64, appends to temp files viamkstemp, resolves waiters with{output_file, exit_code, status, duration_ms, truncated}on final chunk.Cleanup:
*.chunkfiles from unclean shutdownfail_node_chunkson node disconnect/replaceTools —
_node_exec_impldual-path read:output_file(chunked) vs legacystdout/stderr.hello_ack — advertises
exec_chunkcapability so nodes know the server supports it.Tests: 46/46 pass.