Skip to content

feat(harness): add onRound callback for agent heartbeat persistence - #1

Merged
belarusian merged 1 commit into
mainfrom
collab7/proj-agent-heartbeat
Jun 18, 2026
Merged

feat(harness): add onRound callback for agent heartbeat persistence#1
belarusian merged 1 commit into
mainfrom
collab7/proj-agent-heartbeat

Conversation

@belarusian

Copy link
Copy Markdown
Owner

Summary

  • Add optional onRound(state: AgentLoopState) callback to AgentLoopInput interface
  • Fires after every round in both sync and streaming paths with full loop state (round, toolCallCount, hasToolCalls, lastFinishReason, lastText)
  • Enables orchestrator-side heartbeat persistence (heartbeat.json per round + final.json on completion/failure)

Test plan

  • tsc --noEmit — zero errors
  • vitest run — 25 passed, 5 skipped (integration tests requiring API keys)

Files changed

  • src/agent.ts — added onRound to AgentLoopInput, fires at end of each round in sync path and stream path (tool execution, no-tool-call exit, max-steps exit)

…ersistence

Add optional onRound(state: AgentLoopState) callback that fires after each
round in both sync and streaming agent loop paths. State includes round
number, tool call count, finish reason, text content, and hasToolCalls flag —
enough data for orchestrator to write heartbeat.json per round and final.json
on completion.
@belarusian
belarusian merged commit bd7323a into main Jun 18, 2026
0 of 4 checks passed
@belarusian
belarusian deleted the collab7/proj-agent-heartbeat branch June 18, 2026 05:00
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.

1 participant