Write the coder transcript to thread_events #23

Closed AtlantisPleb opened this 2d ago 1 comment

Outcome

openagents coder posts its transcript to POST /api/v3/threads/{id}/events as the turn loop runs: turn.user, turn.reasoning (whole, not deltas), tool.ran (call and bounded result as one event), turn.assistant (with usage). The server copy is the only copy; on exit nothing is lost.

Current behavior

src/coder-thread.ts opens and revokes threads but keeps the transcript in memory. The server routes and cursor exist and payloads are unbounded (openagents.com cb4d5cc); the client writer is the missing half named in OpenAgentsInc/openagents.com docs 2026-08-24-coder-account-integration-audit.md.

Notes

  • Plugin and tool runs carry their identity in the tool.ran payload so usage attribution works later.
  • Delivery is blocked by #19 (the pre-push conformance gate fails closed on clean main).

Part of the Coder v1 release arc (OpenAgentsInc/openagents.com docs 2026-08-24-coder-first-cloud-complements.md section 7).

  1. AtlantisPleb opened this issue 2d ago
  2. A AtlantisPleb Author 2d ago

    Closing as completed. Merged to main and pushed as f69fc6d5d6 (WAL receipt seq 66). The coder's thread lane now records its transcript to POST /api/v3/threads/{id}/events as the turn loop runs: turn.user (with steered flag), turn.reasoning (whole blocks — plumbed and tested; records live content once the CLI parses the proxy's new delta.reasoning field, #31), tool.ran (one event per call with call_id/tool/arguments/status and results kept to 64,000 chars), and turn.assistant (text, summed usage, tool-call count, interrupted flag). A background pump posts strictly in order on the account token, retries transient failures on a 500ms-30s ladder, surfaces one notice after three consecutive failures, drops only invalid events on non-terminal 4xx, stops for good on thread_terminal, and flushes before revoke on exit. Rebased over 0a86e618d3's concurrent tool execution, preserving the accounting. 449 package tests pass; 16 new. Server-side API feedback filed as OpenAgentsInc/openagents.com#208. This unblocks #24 (--resume).

  3. closed this as completed 2d ago
Sign in with GitHub to comment on this issue.