Tracking issue for gaps surfaced by the open-agents → recoup-api chat workflow cutover (recoupable/open-agents#43). The chat-workflow port replicated the request/response wire format but did not port the post-stream side effects from open-agents' app/workflows/chat.ts + chat-post-finish.ts. Filing each gap as its own follow-up PR.
Must-fix (silent data loss / broken UX / silent revenue loss)
Multi-step + metadata (verify whether streamText.stopWhen covers these, then close as appropriate)
Lifecycle / observability
Product features
Minor
Acceptance for full deletion of open-agents /api/chat route
All "Must-fix" boxes checked + multi-step verification + (auto-commit OR explicit decision to deprecate that feature).
Source reference: open-agents/apps/web/app/workflows/chat.ts (~1000 lines) + open-agents/apps/web/app/workflows/chat-post-finish.ts (9 exported step functions, including recordWorkflowUsage at line 230).
Tracking issue for gaps surfaced by the open-agents → recoup-api chat workflow cutover (recoupable/open-agents#43). The chat-workflow port replicated the request/response wire format but did not port the post-stream side effects from open-agents'
app/workflows/chat.ts+chat-post-finish.ts. Filing each gap as its own follow-up PR.Must-fix (silent data loss / broken UX / silent revenue loss)
last_assistant_message_atso sidebar unread badge fires)handleChatCreditsorchestrator; atomic viadeduct_credits_with_auditRPC from feat: deduct_credits_with_audit RPC for atomic wallet + meter writes database#26 — atomicity now applies to research handlers too)run.statusevery 150ms and aborts via AbortController). Also blockswasAbortedgating in auto-commit.isFirstChatMessage→updateChat({title}))collectTaskToolUsageEvents(responseMessage)and inserts ausage_eventsrow per sub-agent model withagentType: "subagent". Without this, sub-agent calls aren't billed even after feat(credits): charge credits per chat turn (atomic wallet debit + audit) #612's main-turn fix landed.Multi-step + metadata (verify whether streamText.stopWhen covers these, then close as appropriate)
generateAssistantMessageIdstep threaded through everyrunAgentStepcall; resume-aware reuse for in-progress assistant turns)Lifecycle / observability
workflow_runsrow viarecordWorkflowRun— chat workflows have no workflow-run telemetry on api (status, durationMs, stepTimings). Separate from the credits gap above —recordWorkflowUsagein open-agents does BOTH but they're independent concernsProduct features
data-commitUI chunks emit live AND persist onto chat_messages.parts so theGitDataPartCardsurvives refresh). Three sub-gaps remain blocked on other items:autoCommitEnabledtoggle waits on user preferences integration below;wasAbortedgating waits on the Stop monitor above; co-author trailer is minor and not blocking.autoCommitEnabledtoggle on the auto-commit flow.MANAGED_TEMPLATE_TRIAL_MESSAGE_LIMITenforcement)Minor
upsertChatMessagecould in principle skip on cross-chat id collision (vanishingly unlikely withai'sgenerateId)console.warnwhenresult.status === "conflict"; api silently returnstoUIMessageStream— open-agents passes the prior turn for assembly; api doesn'tsendStart: false, sendFinish: false+ explicit sendStart/sendFinish steps — currently relying ontoUIMessageStreamdefaults (wire format verified identical, but interleaved-step architecture diverges)streamClosedflag and a guarded close in finally; api relies oncloseChatStreamstep in finally always runningCo-Authored-By: <GitHub App identity>as a second-m; api currently has no GitHub App equivalentbuildGitHubAuthRemoteUrl({token, owner, repo}); api inlines the template literal inperformAutoCommitAcceptance for full deletion of open-agents
/api/chatrouteAll "Must-fix" boxes checked + multi-step verification + (auto-commit OR explicit decision to deprecate that feature).
Source reference:
open-agents/apps/web/app/workflows/chat.ts(~1000 lines) +open-agents/apps/web/app/workflows/chat-post-finish.ts(9 exported step functions, includingrecordWorkflowUsageat line 230).