Skip to content

feat: stream agent stdout/stderr in real time (closes #156) - #262

Open
piyushbag wants to merge 1 commit into
gofixpoint:mainfrom
piyushbag:feat/stream-agent-output-156
Open

feat: stream agent stdout/stderr in real time (closes #156)#262
piyushbag wants to merge 1 commit into
gofixpoint:mainfrom
piyushbag:feat/stream-agent-output-156

Conversation

@piyushbag

Copy link
Copy Markdown

Summary

Remote amika sandbox agent-send (wait mode) buffered the full agent response through the synchronous POST .../agent-send API before printing anything. Local --local sandboxes already streamed via docker exec. This PR routes default remote wait-mode agent-send over SSH with live stdout/stderr, matching local behavior and the CLI docs.

Server-managed sessions (--session-id, --new-session) still use the HTTP agent-send API so session IDs and structured responses stay on the control plane.

Also stream materialize stderr to the host as commands run instead of holding it in a buffer until completion.

Changes

  • go/internal/ssh/ssh.go: add RunSSH for streaming remote commands without syscall.Exec
  • go/cmd/amika/sandbox/sandbox_agent.go: default remote wait path uses SSH streaming; HTTP path kept for session flags
  • go/internal/materialize/materialize.go: write stderr to os.Stderr during execution
  • Tests for streaming shell command shape and RunSSH

Test plan

  • go -C go test ./internal/ssh/... ./internal/materialize/... ./cmd/amika/sandbox/... -run 'TestBuildRemote|TestRunSSH|TestRun_'
  • make fmt vet lint build (from repo root)
  • Manual: remote sandbox amika sandbox agent-send <name> "..." shows output as the agent runs
  • Manual: amika sandbox agent-send <name> "..." --session-id <id> still returns structured HTTP response

Closes #156

Remote wait-mode agent-send buffered the full HTTP response before
printing. Route default remote wait through SSH with live stdout/stderr,
matching local docker exec behavior. Keep the HTTP agent-send path for
--session-id and --new-session. Stream materialize stderr during runs.

Closes gofixpoint#156
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream agent stdout/stderr to the user in real time

1 participant