feat(agent_meetings): post-call meeting summary + context label
Summary
- After a Google Meet call ends, generate a structured post-call summary (headline + key points + action items) and a short context label (e.g. "Q3 Roadmap") via a single best-effort LLM call.
- Title the meeting thread with the context label and add it alongside the shared
"Meetings"label, so calls are distinguishable in the thread list. - Append the structured summary as a closing message in the meeting thread.
- New
agent_meetings::summarymodule: transcript rendering with tail-truncation (24k chars), fence/prose-tolerant JSON extraction, action-item mapping, and markdown formatting.
Problem
- Meeting threads previously held only the raw transcript under a generic title, so calls were hard to tell apart in the thread list and gave no at-a-glance outcome or action items.
- Scope is the
agent_meetingsdomain only (3 files), backend Rust core — no transport or UI changes — so review can focus on the summarisation logic and its fallback path.
Solution
agent_meetings::summary::generate_meeting_summary()renders the transcript (tail-truncated at 24k chars so long calls don't blow the context window), resolves thesummarizationworkload role viacreate_chat_provider, and parses the JSON reply (tolerant of code fences, surrounding prose, and braces inside string literals).- Action items are mapped to
executablevsadvisorywith optional tool/assignee; the context label is sanitised and length-capped. create_meeting_thread_with_transcriptnow titles the thread with the label, adds it as a second label, and appends the formatted summary as a closing system message.- Design decision — best-effort: any failure (config, provider, parse) logs a warning and falls back to the plain transcript thread. Thread creation never depends on the LLM succeeding.
Submission Checklist
If a section does not apply to this change, mark the item as
N/Awith a one-line reason. Do not delete items.
- [x] Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
- [x] Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via
diff-cover) meet the gate enforced by.github/workflows/pr-ci.yml. Runpnpm test:coverageandpnpm test:rustlocally; PRs below 80% on changed lines will not merge. - [x] Coverage matrix updated — added/removed/renamed feature rows in
docs/TEST-COVERAGE-MATRIX.mdreflect this change (orN/A: behaviour-only change) - [x] All affected feature IDs from the matrix are listed in the PR description under
## Related—N/A: no matrix feature ID covers this surface - [x] No new external network dependencies introduced (mock backend used per Testing Strategy)
- [x] Manual smoke checklist updated if this touches release-cut surfaces (
docs/RELEASE-MANUAL-SMOKE.md) —N/A: backend domain logic, no release-cut UI surface - [x] Linked issue closed via
Closes #NNNin the## Relatedsection
Impact
- Desktop/CLI only — Rust core (
agent_meetingsdomain); no mobile/web/UI surface touched. - Adds one
summarization-role LLM call per ended Google Meet call, off the thread-creation critical path. No migrations, no schema changes, no new external network dependencies (reuses the existing provider stack).
Related
- Closes: #3510
- Follow-up PR(s)/TODOs: tool-aware actionables (connected-tool execution + approval gating),
agent_meetings_generate_summaryRPC, and frontend thread header / "Generate summary" button.
AI Authored PR Metadata (required for Codex/Linear PRs)
Keep this section for AI-authored PRs. For human-only PRs, mark each field
N/A.
Linear Issue
- Key: N/A
- URL: N/A
Commit & Branch
- Branch:
feat/agent-meetings-post-call-summary - Commit SHA:
2fce800a098689123619b25b1575cb912a4fd340
Validation Run
- [x]
pnpm --filter openhuman-app format:check - [x]
pnpm typecheck - [x] Focused tests:
cargo test --lib agent_meetings::summary(15 passed) - [x] Rust fmt/check (if changed):
cargo fmt --check/cargo check - [x] Tauri fmt/check (if changed): N/A — no Tauri changes
Validation Blocked
command:N/Aerror:N/Aimpact:N/A
Behavior Changes
- Intended behavior change: ended Google Meet calls produce an LLM summary + context label on the meeting thread.
- User-visible effect: thread is titled with the meeting topic and ends with a structured summary message.
Parity Contract
- Legacy behavior preserved: on any summarisation failure, the thread falls back to the prior plain-transcript behaviour.
- Guard/fallback/dispatch parity checks: best-effort generation; thread creation never depends on the LLM call.
Duplicate / Superseded PR Handling
- Duplicate PR(s): N/A
- Canonical PR: N/A
- Resolution (closed/superseded/updated): N/A
[!NOTE] Currently processing new changes in this PR. This may take a few minutes, please wait...
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID:
810aaf23-e49f-498e-852f-a9807324fdc9📥 Commits
Reviewing files that changed from the base of the PR and between afab6e5ede6c53c545553d40b4fbc448201a52ae and 2fce800a098689123619b25b1575cb912a4fd340.
📒 Files selected for processing (3)
src/openhuman/agent_meetings/mod.rssrc/openhuman/agent_meetings/ops.rssrc/openhuman/agent_meetings/summary.rs____________________________________________________________________________ < I've got bills to pay, so I'm gonna find, find, find those bugs every day. > ---------------------------------------------------------------------------- \ \ (\__/) (•ㅅ•) / づ
Comment @coderabbitai help to get the list of available commands and usage tips.
Code Review — PR #3709: post-call meeting summary + context label
Walkthrough. Adds a new agent_meetings::summary module that, after a Google Meet call ends, makes one best-effort summarization-role LLM call to produce a structured summary (headline / key points / action items) plus a short context label. create_meeting_thread_with_transcript then titles the thread with the label, adds it as a second label beside the shared "Meetings" label, and appends the formatted summary as a closing message. The parsing/formatting helpers are clean and very well unit-tested. My main concern is where in the pipeline the LLM call is awaited — it isn't as "off the critical path" as the description claims.
Changed files
| File | Change |
|---|---|
src/openhuman/agent_meetings/mod.rs |
pub mod summary; |
src/openhuman/agent_meetings/ops.rs |
Generate summary up front; title thread + add context label + append summary message |
src/openhuman/agent_meetings/summary.rs |
New module: transcript render/truncate, tolerant JSON extraction, action-item mapping, markdown formatting (+15 tests) |
Major
1. The summary LLM call is awaited inline ahead of the durable persistence path — it is on the critical path, not off it. src/openhuman/agent_meetings/ops.rs:138 & bus.rs:65,80
The PR description states "off the thread-creation critical path" and "thread creation never depends on the LLM." But generate_meeting_summary(...).await runs first inside create_meeting_thread_with_transcript (ops.rs:138), before the thread is created and the transcript appended. And in bus.rs, the memory-tree ingest (ingest_backend_meeting_transcript, bus.rs:80) only runs after create_meeting_thread_with_transcript returns. So the new LLM call now gates both thread/transcript persistence and the pre-existing memory-ingest pipeline.
The provider has a 120s per-request timeout (compatible_request.rs:119) and the reliable wrapper retries transient failures with backoff — so a slow/flaky summarization provider can stall the entire post-call persistence pipeline for minutes. On main this path was local-only and fast; this is a latency regression on a durability path. Correctness of the fallback is fine (it only depends on the call returning, not succeeding) — the issue is the coupling.
Two clean fixes, either works:
// Option A — persist first, summarize after. Thread is created with just
// "Meetings", transcript + memory ingest happen immediately, then the summary
// is generated and the title/second-label/summary-message applied. You already
// call thread_update_title in a separate step (ops.rs:197), so the title can be
// set after generation with no extra machinery.
// Option B — bound the best-effort call so it can never dominate the path:
let generated = match tokio::time::timeout(
std::time::Duration::from_secs(30),
super::summary::generate_meeting_summary(turns, correlation_id.as_deref()),
)
.await
{
Ok(Ok(g)) => Some(g),
Ok(Err(e)) => { tracing::warn!("[agent_meetings] summary generation failed: {e}"); None }
Err(_) => { tracing::warn!("[agent_meetings] summary generation timed out"); None }
};
Minor / Questions
2. Per-meeting label pollutes the shared label taxonomy. ops.rs:176-179
Each call appends the generated context label ("Q3 Roadmap", …) as an actual thread label, not just the title. Over time this accrues one unique, never-reused label per meeting. The thread title (set at ops.rs:197) already disambiguates calls in the list. Was adding it as a second label (vs. title-only) intentional? If labels are meant as shared/reusable categories elsewhere in the UI, this will clutter that namespace.
3. MAX_TRANSCRIPT_CHARS measures bytes, not chars. summary.rs:26,207-208
cap_tail compares against s.len() (byte length), so the constant is really a 24 KB byte cap. For non-ASCII (CJK, etc.) transcripts the effective character budget is 2-3× smaller than the name implies. Functionally safe (still bounds the context window) — just rename to MAX_TRANSCRIPT_BYTES or document it.
4. Test gap: the generate→parse→map happy path isn't exercised. summary.rs:347
Only the empty-transcript early-return is covered for generate_meeting_summary; the provider call + JSON parse + ActionItem mapping aren't run together. The repo has a test_provider_override mechanism (factory.rs:415, #[cfg(test)]) that injects a scripted mock provider — a single test that scripts a JSON reply and asserts the resulting GeneratedSummary/label would close the gap network-free. The individual helpers are already thoroughly covered, so this is a nice-to-have.
Nitpicks
extract_json_object(summary.rs:231) takes the last top-level{…}; if a model emits the real JSON and then a trailing prose block containing braces, the trailing one wins. The comment acknowledges the heuristic and tests cover the common cases — acceptable.
Looks good
- Brace-aware, string-literal-tolerant JSON extraction with direct-parse fast path — solid and well-tested.
cap_tailcorrectly walks to a char + line boundary; multibyte test included.- Fallback discipline is right: any
Errlogs a warning and degrades to the plain-transcript thread;non_empty/trim hygiene on every field; label dequoted and length-capped. - Markdown formatter omits empty sections and distinguishes executable vs advisory cleanly.
Read-only review — no changes pushed.
@sanil-23 thanks for the thorough review — all four items addressed in dda9aaaae.
① (blocking) Critical-path coupling. Did both of your suggested fixes:
- Persist-then-summarize: the thread is now created with just the
"Meetings"label and the transcript appended before any LLM work, so thread/transcript persistence — and the memory-tree ingest that runs aftercreate_meeting_thread_with_transcriptreturns (bus.rs:80) — no longer gate on summarization. - Bounded: the best-effort summary runs under a 30s
tokio::time::timeout(SUMMARY_GENERATION_TIMEOUT), so even the post-persistence enrichment can't be dominated by a slow/flaky provider. Timeout/error → warn + plain-transcript fallback. This makes the PR's stated contract literally true now.
② Per-meeting label — not intentional, removed. You're right: a unique, never-reused label per call pollutes the shared taxonomy and the title already disambiguates. The topic is now applied as the thread title only; the only label is the shared "Meetings".
③ MAX_TRANSCRIPT_CHARS. Renamed → MAX_TRANSCRIPT_BYTES (it compares against str::len) and documented the multibyte implication.
④ Happy-path test. Added generate_meeting_summary_parses_and_maps_provider_reply — uses the test_provider_override mock to script a JSON reply and assert the resulting GeneratedSummary (label sanitisation, meeting_id flow-through, executable/advisory mapping with tool/assignee), network-free.
Re-requesting review when you have a moment.