File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -419,12 +419,9 @@ jobs:
419419 echo ""
420420
421421 # Stream events from AgentAPI via SSH
422- # The AgentAPI sends Server-Sent Events (SSE) with:
423- # - event: message_update (contains full terminal output including tool calls)
424- # - event: status_change (status transitions)
425- # - data: JSON payload
422+ # Parse SSE events and display message content
426423 CURRENT_STATUS="running"
427- coder ssh "${TASK_NAME}" -- timeout 600 curl -sN http://localhost:3284/events 2>/dev/null | \
424+ coder ssh "${TASK_NAME}" -- curl -sN http://localhost:3284/events 2>&1 | \
428425 while IFS= read -r line; do
429426 # Skip empty lines and SSE comments
430427 [[ -z "$line" || "$line" == :* ]] && continue
@@ -438,13 +435,11 @@ jobs:
438435
439436 # Parse data payload
440437 if [[ "$line" == data:* ]]; then
441- DATA="${line#data:}"
442- DATA="${DATA# }" # trim leading space
438+ DATA="${line#data: }"
443439
444440 case "$EVENT_TYPE" in
445441 message_update)
446442 # The API returns: {"id":N,"role":"agent|user","message":"..."}
447- # The message field contains formatted terminal output with tool calls
448443 CONTENT=$(echo "$DATA" | jq -r '.message // empty' 2>/dev/null)
449444 if [[ -n "$CONTENT" && "$CONTENT" != "null" ]]; then
450445 echo "$CONTENT"
You can’t perform that action at this time.
0 commit comments