feat(ws): add result-channel output streaming, ACK handling, and replay#182
Merged
feat(ws): add result-channel output streaming, ACK handling, and replay#182
Conversation
…play
│
~ - Add ResultChannel interface and integrate into task polling runner for
stdout/stderr capture with interval/byte-threshold flush
- Add WS client methods for SendOutput, SendFinal, sendIfActive, replayUnacked
- Wire result outbox into WS client on startup via newDefaultWebSocketRuntime
- Extend ErrorPayload with HighestAcceptedSequence for retryable gap errors
- Add ExecutionAttemptID to domain Task model
- Add tests for ack-driven outbox removal, reconnect replay, throttled
capture, retryable error handling, and HTTP fallback
e0b55b6 to
679819b
Compare
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.
Summary
Add result-channel capabilities to the existing HTTP-polling task runner and WebSocket client so task output and final results stream over the authenticated agent WebSocket with durable ACK handling. HTTP final reporting is preserved as fallback when WebSocket delivery is unavailable.
New files
app/jobs/taskjob/result_channel_test.go— tests for result-channel streaming, HTTP fallback, throttled capture, retryable error handlingModified files
app/jobs/taskjob/taskjob.go— addResultChannelinterface,processTaskWithResultChannelfor stdout/stderr pipe capture with interval/byte-threshold flush, final persistence before send, HTTP fallbackapp/services/wsclient/client.go— addSendOutput/SendFinalmethods,replayUnackedafter hello_ack, ACK-driven outbox removal, write-mutex serializationapp/services/wsclient/client_test.go— tests for ack outbox removal, reconnect replay, retryable error handlingdomain/task/task.go— addExecutionAttemptIDfield to domain taskinternal/wsprotocol/ack_sequence.go— addHighestAcceptedSequencetoErrorPayload/ErrorOptionsinternal/wsprotocol/ack_sequence_test.go— update error payload testsmain.go— wire local store as result outbox into WebSocket client; pass result channel to task jobKey design decisions
message_idfrom outbox; retryable errors keep messagesagent.hello_ackpreserves original IDs/sequences