feat(agent): stream step output chunks over CommandStream
Agent Release / build (push) Successful in 44s
Server Deploy / deploy (push) Successful in 1m51s
Agent Release / msi (push) Successful in 1m23s

This commit is contained in:
2026-07-20 12:36:37 +01:00
parent 7a60295bc1
commit 5d72088837
2 changed files with 45 additions and 11 deletions
+14 -1
View File
@@ -200,8 +200,21 @@ func connectAndHandleStream(ctx context.Context, cfg *config.Config) error {
}
if cmd.RunStep != nil {
go func(rc *pb.RunStepCmd, cid string) {
res := agentexec.RunStep(rc)
emit := func(seq uint64, data []byte) {
_ = send(&pb.AgentMessage{
ServerId: cfg.ServerID,
AgentToken: cfg.AgentToken,
StepOutput: &pb.StepOutputChunk{CommandId: cid, Seq: seq, Data: data},
})
}
res := agentexec.RunStep(rc, emit)
res.CommandId = cid
// Final eof marker so the server closes the log file.
_ = send(&pb.AgentMessage{
ServerId: cfg.ServerID,
AgentToken: cfg.AgentToken,
StepOutput: &pb.StepOutputChunk{CommandId: cid, Eof: true},
})
_ = send(&pb.AgentMessage{
ServerId: cfg.ServerID,
AgentToken: cfg.AgentToken,