release: auto-commit + push after chat workflow finish (#614)

Merged
SW
5mo ago
+1877-0

Summary

Releases PR #614 from `test` → `main`.

  • After a chat workflow finishes naturally with sandbox changes, the workflow stages → generates a commit message (gpt-5.4-nano) → commits → pushes to the session's branch
  • Emits `data-commit` chunks live (pending → resolved) so the open-agents `GitDataPartCard` UI renders during the stream
  • Persists the resolved chunk onto the assistant message so the affordance survives page refresh

Test plan

  • 3266 unit tests passing
  • E2E preview: triggered chat that modifies files, commit landed on GitHub at recoupable/org-myco-wtf-.../commit/66f7aa26, GitDataPartCard rendered on refresh ("Committed & pushed · 66f7aa2" + commit message subtitle)
  • Persistence verified directly via Supabase MCP — chat_messages.parts contains the merged data-commit part
  • Post-merge: sanity check on sandbox.recoupable.com against https://api.recoupable.com

🤖 Generated with Claude Code


Summary by cubic

Automatically commits and pushes sandbox changes at the end of a chat, streaming live commit status and persisting it so the Git card remains after refresh.

  • New Features

    • On natural finish (not tool-calls), if the repo and sandbox are available and changes exist, stage → generate commit message via openai/gpt-5.4-nano → commit → push current branch.
    • Uses GITHUB_TOKEN if set to auth origin; falls back gracefully and reports errors without breaking the chat.
    • Emits data-commit chunks (pending → success/error with commit URL) during the stream, and persists the final chunk to chat_messages.parts so the UI shows the commit after reload.
    • Derives repoOwner/repoName from session.clone_url, removing reliance on unused columns.
  • Refactors

    • Extracted auto-commit flow into autoCommitChatTurn with focused helpers (runAutoCommit, performAutoCommit, generateCommitMessage, hasAutoCommitChanges, sendCommitChunk, buildCommitData, persistAssistantDataPart), and threaded sessionTitle/repo IDs/sandbox state through runAgentWorkflow.