Attach call recording + transcript to the Odoo lead (Phase 3 item)

odoo_client.attach_call_artifacts posts the transcript to the lead's chatter
(readable in place) and attaches transcript_<sid>.txt + the stereo call WAV.
bot.py wires it post-call: extract_and_record now returns the Odoo ref
(persisted_to), the in-call tool path stamps it too, the audiobuffer handler
records the saved WAV path, and the attach runs in a thread after the lead
lands (brief wait for the async WAV write; failures only log — the lead is
already safe). Verified e2e against db1: create -> attach -> verify -> delete.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tocmo0nlord
2026-07-04 17:03:00 +00:00
parent 1e7b7844a4
commit bbfff482a3
4 changed files with 96 additions and 3 deletions

View File

@@ -553,7 +553,13 @@ Beyond the three reverted changes, the following hardening is live (see git hist
- [ ] Real-time calendar availability check (`odoo/calendar.py`)
- [ ] Whisper large-v3 post-call transcription (`recording/transcriber.py`)
- [ ] Recording + transcript attached to Odoo lead chatter
- [x] Recording + transcript attached to Odoo lead chatter (2026-07-04, pulled forward):
`odoo_client.attach_call_artifacts` posts the transcript as a chatter note + .txt
attachment and attaches the stereo WAV; wired post-call in `bot.py` (both the
extraction path and the in-call tool path stamp `artifacts["odoo_ref"]`). Transcript
is the live in-call Whisper `medium` text (`extract.format_transcript`), not
large-v3 — the large-v3 re-transcription remains a Phase 3 item. Verified e2e
against db1 (create → attach → verify → delete, left clean).
- [ ] Staff review flow confirmed in Odoo
**Gate:** Staff receives, reviews, and confirms a lead end-to-end