Repository navigation
feat(notes): agentic meeting notes for long meetings - #22853
Conversation
Long and meeting-like conversations get notes from a bounded agent loop: read-only owner-scoped tools (screen activity, this call's screenshots, calendar, people, memories, past meetings, tasks), a prefetched evidence packet, the personal lexicon in a cache-stable per-user prefix, and a terminal submit_notes validated as StructuredExtraction plus evidenced participants. Nested bullets are required, length scales with the transcript, action-item sections are refused, and task reconciliation stays with Dream. One function (plan_notes_agent) gates and budgets the agent: >1500 words or 300+ words with calendar, call-screen or multi-source evidence; <=15 lookups and ~2 cents, then a forced submit. Everything else, BYOK and non-gateway routes keep the one-shot path unchanged, and any failure falls back to it. Kill switch CONVERSATION_NOTES_AGENT_ENABLED (default on) with a percent/allowlist ramp. The gateway conv_structure lane now accepts tools. Adds notes-agent metrics and a reusable cached/total input-token counter on the shaped harness. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… off Suggested surfaces Co-Authored-By: Claude Opus 5.5 <[email protected]>
… import Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # backend/docs/feature-flag-registry.md
…touched Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50cdaa34c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| lo = _as_utc(start) or self.started_at | ||
| hi = _as_utc(end) or self.finished_at | ||
| if hi < lo: | ||
| lo, hi = hi, lo | ||
| if hi - lo > timedelta(hours=MAX_WINDOW_HOURS): |
There was a problem hiding this comment.
Clamp tool windows to the current conversation
The start and end values are supplied by the model from untrusted evidence, but _window accepts any parsed timestamps and only limits their distance to 12 hours. A prompt-injected or mistaken tool call can therefore read screen OCR and calendar data from an unrelated period and incorporate it into the notes; clamp both bounds to self.started_at and self.finished_at before querying.
Useful? React with 👍 / 👎.
| result = asyncio.run(invoke()) | ||
| except Exception as error: # noqa: BLE001 - the one-shot path still writes the notes | ||
| reason = 'capability_mismatch' if 'capability' in type(error).__name__.lower() else 'other' | ||
| logger.warning('conversation notes agent failed uid=%s error=%s', uid, type(error).__name__) |
There was a problem hiding this comment.
Sanitize owner IDs in failure logs
When an agent invocation fails, this writes the stable owner UID directly to application logs; the newly added owner-profile and packet-read warnings repeat the same pattern. These failures are expected fallback paths, so production incidents will persist raw account identifiers in logs instead of sanitizing or omitting them. Use the repository sanitization helpers or content-free correlation data.
AGENTS.md reference: backend/AGENTS.md:L193-L195
Useful? React with 👍 / 👎.
| 'tier_escalation': os.getenv('NOTES_TIER_ESCALATION_ENABLED', ''), | ||
| 'shaped_notes_mode': os.getenv('OMI_SHAPED_AGENT_MODE', 'off'), | ||
| 'notes_agent': os.getenv('CONVERSATION_NOTES_AGENT_ENABLED', 'true').strip().lower(), |
There was a problem hiding this comment.
Include rollout controls in the notes fingerprint
The selected notes implementation also depends on CONVERSATION_NOTES_AGENT_PERCENT and CONVERSATION_NOTES_AGENT_UID_ALLOWLIST, but only the enabled flag enters the persisted dedupe fingerprint. If an unchanged conversation was processed outside the cohort and the percentage is later raised—or its owner is allowlisted—a reprocess can reuse the earlier one-shot result without invoking the agent, undermining the staged rollout and its measurements. Include every decision control, or the resolved agent decision, in the fingerprint.
Useful? React with 👍 / 👎.
| if not text or _ROLE_PREFIX.match(text) or "'s " in text or '’s ' in text: | ||
| return False | ||
| return any(word[:1].isupper() for word in text.split()) |
There was a problem hiding this comment.
Accept participant names from uncased scripts
For participants whose names use an uncased writing system, such as 王伟 or an Arabic name, every character returns false from isupper(), so is_named rejects the valid name and repair_notes silently removes that participant. Since notes can be generated in arbitrary response languages, detect role descriptions without requiring capitalization.
Useful? React with 👍 / 👎.
| except Exception as error: # noqa: BLE001 - the one-shot path still writes the notes | ||
| reason = 'capability_mismatch' if 'capability' in type(error).__name__.lower() else 'other' | ||
| logger.warning('conversation notes agent failed uid=%s error=%s', uid, type(error).__name__) | ||
| record_fallback( |
There was a problem hiding this comment.
Classify gateway capability errors by their response code
During the documented gateway-first rollout, the old lane returns HTTP 400 with code capability_not_supported; through ChatOpenAI this surfaces as a generic bad-request exception whose type name does not contain capability. This branch consequently records the fallback as other, so the expected capability_mismatch rollout signal never appears. Inspect the structured gateway error code rather than the Python exception class name.
Useful? React with 👍 / 👎.
| result = asyncio.run(invoke()) | ||
| except Exception as error: # noqa: BLE001 - the one-shot path still writes the notes | ||
| reason = 'capability_mismatch' if 'capability' in type(error).__name__.lower() else 'other' | ||
| logger.warning('conversation notes agent failed uid=%s error=%s', uid, type(error).__name__) | ||
| record_fallback( |
There was a problem hiding this comment.
Record usage from agent runs that later fail
If a provider error occurs after one or more successful tool turns, run_notes_agent raises into this handler and record_run(result) below is skipped, even though those earlier turns were billed. During the rollout, failed multi-turn runs are therefore absent from the agent cost, token, latency, turn, and tool-call metrics, biasing the stated cost and latency thresholds toward successful runs. Preserve and record the partial result on failure before falling back.
Useful? React with 👍 / 👎.
| sections = [section for section in repaired.get('sections') or [] if isinstance(section, Mapping)] | ||
| kept = [section for section in sections if not is_action_heading(str(section.get('heading') or ''))] | ||
| if len(kept) != len(sections) and kept: | ||
| repairs.append('action_section_dropped') | ||
| repaired['sections'] = kept |
There was a problem hiding this comment.
Drop action-only sections during static repair
After the first rejected submission, a later malformed submission is accepted and relies on this repair. If every section has an action-style heading, kept is empty and the and kept guard leaves all of those sections intact, so commitments remain duplicated in both the visible note body and action_items despite the stated no-action-section contract. Assign the filtered list even when it is empty; the overview can remain as the fallback note content.
Useful? React with 👍 / 👎.
…e page Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c07289bf5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raw = os.getenv(PERCENT, '').strip() | ||
| if not raw: | ||
| return 100 |
There was a problem hiding this comment.
Declare the initial cohort before defaulting to 100%
When CONVERSATION_NOTES_AGENT_PERCENT is unset, this admits every eligible conversation, but the new flag registry explicitly says the first deployment should use 5%. I checked backend/deploy/runtime_env.yaml, the backend Helm values, and deployment workflows, and none declares this percentage or the allowlist, so the normal production rollout immediately runs the multi-turn agent at 100%, bypassing the planned cost, latency, and empty-note observation window. Add the initial rollout values to every conversation-processing host, or fail closed while the rollout variable is absent.
AGENTS.md reference: backend/AGENTS.md:L153-L153
Useful? React with 👍 / 👎.
| others = [ | ||
| person | ||
| for person in people | ||
| if str(person.get('name') or '').strip().casefold() not in owners and is_named(str(person.get('name') or '')) | ||
| ] |
There was a problem hiding this comment.
Ground participant names before persisting them
When the model submits a plausible capitalized hallucination such as Jane Doe with an arbitrary evidence string, this filter retains it because it checks only that the name is not the owner and looks capitalized. Neither check_notes nor the subsequent conversion corroborates the name against the transcript, roster, packet, or tool results, so fabricated attendees and their purported evidence become persisted user-visible notes. Validate each participant against the available evidence before retaining it.
Useful? React with 👍 / 👎.
| has_calendar=roster is not None, | ||
| has_call_screen=bool(frames) or bool(kwargs.get('desktop_meeting_capture')), |
There was a problem hiding this comment.
Distinguish a roster from calendar evidence
A non-None roster does not prove that calendar evidence exists: _rich_meeting_roster also creates one for the multi-party-speech gate and returns an empty roster when context construction fails. Consequently, a 300–1499-word multi-speaker recording with no calendar, call screen, or multi-source capture is passed as has_calendar=True and enters the agent lane contrary to the documented eligibility policy; pass the actual calendar-context signal instead.
Useful? React with 👍 / 👎.
| owner_names=owner_names, | ||
| ) | ||
|
|
||
| result = asyncio.run(invoke()) |
There was a problem hiding this comment.
Move the agent loop out of the postprocess worker
On the finalization and integration paths, process_conversation already occupies one of the 24 postprocess_executor workers, and this asyncio.run keeps that worker blocked while the agent awaits model and database operations for up to 120 seconds, potentially followed by the one-shot fallback. With 24 concurrent eligible meetings, all postprocess slots can therefore be occupied by sleeping coordinators and unrelated conversation finalizations queue behind them; run this long orchestration asynchronously or on a separately sized pool.
AGENTS.md reference: backend/AGENTS.md:L281-L281
Useful? React with 👍 / 👎.
| return ( | ||
| (prompt - cached) * INPUT_USD_PER_MILLION | ||
| + cached * CACHED_INPUT_USD_PER_MILLION | ||
| + output * OUTPUT_USD_PER_MILLION |
There was a problem hiding this comment.
Account for cache writes in the agent cost cap
Every agent run enables explicit prompt caching, and the pinned gateway rate card bills cache-write tokens at $0.125/M, but _usage returns only total input, cache reads, and output, so this estimator prices every non-read token at the ordinary $0.10/M rate. On the first turn for a conversation, the unique conversation prefix is written to cache, causing result.cost_usd, the cost histogram, and the force-submit guard to understate the billed cost and potentially let a run exceed the advertised $0.02 cap. Carry the reported cache_write_tokens and its rate through the local accounting.
Useful? React with 👍 / 👎.
Round 3 labels favored lab v2-deep 7-3: v3 ran ~1.05x production length with a median of zero lookups, so the prefetched packet replaced investigation. v4 presents the packet as leads, requires verifying every person, unnamed speaker and uncertain entity with tools (minimum 2/4/5 lookups inside the unchanged 6/10/15 caps; one send-back that keeps tool access), and raises length to ~1.3-1.4x production with a floor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le evidence v4 lost both 4b cards for not naming the other speaker. The screen tool took explicit times and the model sent UTC clock times with a local offset; screen evidence reached the packet only as raw titles; the prompt's caution outweighed its permission to name; and a body/body_markdown key slip spent the one send-back on a spurious prose complaint. Adds people_on_screen leads (call windows, chats, LinkedIn profile pages; owner, AI agents and groups excluded; titles only), UTC packet times with optional tool windows, a positive naming rule with participants speaker mapping, a one-time naming send-back when strong leads exist, and section body-key normalization, with regression tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00cd221887
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| named = [ | ||
| person | ||
| for person in arguments.get('participants') or [] | ||
| if isinstance(person, dict) and str(person.get('name') or '').strip() and not person.get('is_ai_agent') | ||
| ] |
There was a problem hiding this comment.
Reject placeholders before counting named speakers
When naming_leads contains an evidenced counterpart, a submission containing only an owner entry or a placeholder such as Other attendee satisfies this named test because it checks only for nonempty text and is_ai_agent. The naming retry is therefore skipped, and repair_notes subsequently removes that participant, allowing the notes to persist without the evidenced speaker this check was added to require. Apply the same owner/role-name validity criteria here before deciding that somebody was named.
Useful? React with 👍 / 👎.
| 'arguments': kwargs, | ||
| 'tier_escalation': os.getenv('NOTES_TIER_ESCALATION_ENABLED', ''), | ||
| 'shaped_notes_mode': os.getenv('OMI_SHAPED_AGENT_MODE', 'off'), | ||
| 'notes_agent': os.getenv('CONVERSATION_NOTES_AGENT_ENABLED', 'true').strip().lower(), |
There was a problem hiding this comment.
Add agent modules to the dedupe implementation digest
This makes agent selection part of the persisted notes fingerprint, but implementation_digest('notes') still omits every new agent implementation file, including the prompt, validation, tools, policy, and serving modules. After a prompt or repair fix changes one of those files without also touching an older file in the digest list, reprocessing an unchanged conversation can match the old hash and reuse notes produced by the previous implementation instead of running the fix.
Useful? React with 👍 / 👎.
| SUBMIT, | ||
| 'Submit the finished notes. Call exactly once, when done. A rejected submission explains what to fix.', | ||
| { | ||
| 'title': {'type': 'string', 'description': 'At most 70 characters'}, |
There was a problem hiding this comment.
Enforce the advertised title length limit
The title schema only describes the 70-character limit; it does not declare maxLength, AgentNotesSubmission.title has no maximum, and check_notes never checks the title. Consequently, any overlong title emitted by the model is accepted and persisted, while the later presentation pass intentionally does not truncate titles. Encode the limit in the schema or deterministic validation so long agent titles cannot violate the client-facing contract.
Useful? React with 👍 / 👎.
| agent_payload = agentic_notes_payload( | ||
| uid=uid, prefix=prefix, model=model, capture_evidence=context, words=words, frames=frames, kwargs=kwargs |
There was a problem hiding this comment.
Count only transcript words for agent eligibility
The words value passed here is counted from prefix.shaped_context, which includes the serialized speaker map, calendar/screen metadata, and photo descriptions before FULL TRANSCRIPT. A transcript below the 300- or 1500-word thresholds can therefore enter a larger agent tier solely because its metadata is verbose; crossing 1500 also imposes the 480-word note floor, encouraging padded notes for a shorter conversation. Derive the eligibility and length-budget count from the transcript portion only.
Useful? React with 👍 / 👎.
| def to_participant(self) -> Participant: | ||
| return Participant( | ||
| name=self.name, | ||
| organization=self.organization, | ||
| is_ai_agent=self.is_ai_agent, | ||
| source='transcript' if self.evidence_kind in (None, 'transcript') else 'roster', | ||
| evidence=self.evidence, |
There was a problem hiding this comment.
Preserve non-roster participant provenance
A participant grounded by people, memory, or past_meeting is unconditionally serialized with source='roster', even though the public field contract defines roster as meeting metadata. For example, a person identified from a People record and mapped to a current transcript speaker is exposed to clients as roster-confirmed attendance. Only actual calendar/screen-roster evidence should receive roster; other grounded speaker identities need transcript provenance or a distinct source value.
Useful? React with 👍 / 👎.
| AgentNotesSubmission.model_validate(arguments) | ||
| except ValidationError as error: | ||
| fields = sorted({'.'.join(map(str, row['loc'])) for row in error.errors(include_input=False)})[:6] | ||
| return 'Schema problems at: ' + ', '.join(fields), None | ||
| check = check_notes(arguments, transcript_words=transcript_words) |
There was a problem hiding this comment.
Validate the normalized submission instead of raw arguments
AgentNotesSubmission.model_validate(arguments) can silently drop malformed list elements through _keep_usable_content, but its normalized result is discarded and check_notes examines the original mapping. A section missing a required field can therefore supply enough bullets and words to pass check_notes, then disappear when the payload is parsed again before persistence, leaving the user with no section body. Run the checks and subsequent repairs against the validated model dump so rejected elements cannot count toward acceptance.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5eb0af0a85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| rows: Any = screen_activity_db.get_screen_activity( | ||
| uid, start_date=start - timedelta(minutes=LEAD_MINUTES_BEFORE), end_date=end, limit=400 | ||
| ) |
There was a problem hiding this comment.
Respect the production screen-context gate
When the agent lane runs in production, this unconditional query reads screen-activity rows for every eligible long transcript, even though word count alone admits the conversation and the production contract keeps OCR context reads off. build_packet then sends window titles and OCR-derived participant leads to the notes model, so long dictations and imported audio can acquire unrelated screen context without passing the existing meeting/context gate. Pass the context-read decision into the packet/toolbox and skip this read when production screen context is disabled.
AGENTS.md reference: backend/AGENTS.md:L134-L134
Useful? React with 👍 / 👎.
…22988) Four rules move from the notes agent's local fixes (#22853) into the harness so Dream, chat and future agents get them from shared code: 1. Time windows default to context. A run carries a ContextWindow on its Mount (and Dream's Session): the conversation for notes, the trailing day for Dream, the attached chat timeframe or last 24 hours for chat. Time-range tools fill missing bounds with ContextWindow.resolve. Dream temporal search defaults to the day and reports the window it used; chat get_screen_activity_tool no longer requires start/end. 2. Times in UTC. model_json/model_view render every instant shown to the model with a trailing Z (notes tool results and packet, Dream seed and tool results). parse_tool_time converts offsets, reads naive times as UTC (chat: the user's zone, matching its labelled local display) and rejects nonsense with an error that names the field and the expected format. Dream search accepts offsets and naive times instead of rejecting them; chat screen search no longer silently drops an unreadable date. 3. Normalize before validating. Schemas declare near-miss keys as output_aliases data (ExtractedSection: body -> body_markdown); normalize_output/validate_output apply them recursively. Replaces the notes agent's ad-hoc normalize_submission; Dream tool arguments and the Dream verifier's structured output go through the same path. 4. Send-back budgets per failure class. SendBackBudget keeps one budget per class (notes: format, content, evidence). Format problems go back alone, so a format complaint can no longer spend the naming-evidence retry. Documents the rules in backend/utils/llm/ARCHITECTURE.md; tests in tests/unit/test_agent_tool_rules.py. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Agentic meeting notes for long and meeting-like conversations, on the shaped harness. Production notes for the 2026-10-20 weekly Zoom said "the other speaker" although the Zoom tile, calendar and screenshots named him. Three things caused it: the notes call was a tool-free one-shot (
Budget(turns=1, tool_calls=0)), the writer ignored the roster and background pack thatrich_notes_inputsalready builds, and theconv-structuregateway lane rejects tools. In a blind review on 10 long meetings, the agentic prototype (lab v2) won 7, versus 1 for production.What ships:
Agentic notes on the shaped harness (
utils/llm/notes_agent.py). The loop isshaped_agent.run_loopwith read-only tools and a terminalsubmit_notestool. The tool's payload validates asAgentNotesSubmission, aStructuredExtractionsubclass that addsparticipantswith evidence. Participants are stored onstructured.participantswith a new optionalevidencefield; there is no client UI work. The one-shot parser schema and its prompt bytes are unchanged.Owner-scoped, read-only tools (
utils/conversations/notes_agent_tools.py). The server binds the owner UID and conversation id when it builds the toolbox, and no tool argument carries a uid. The tools reuse existing readers:view_screenshot, which serves only the frames already loaded under the screenshot setting;OwnerSearch;search_past_meetings(by person, title or topic) andget_past_meeting(ids seen in the packet or a search only).There are no write tools.
Prefetched evidence packet: calendar overlap, top window titles, screenshot ids, listed participants (roster), the existing BACKGROUND CONTEXT block (screen moments with tile names, people facts, memories, corrections), and up to 3 related past meetings (same calendar series or same participants) with gist and open tasks. The packet seeds investigation; it does not replace it.
Personal lexicon: the existing
conversation_known_spellingsblock (Dreamlearn_termvocabulary plus trusted People). It now sits in the notes agent's stable per-user prefix.Formatting: nested bullets are required, with an example in the prompt. Length is scaled to the transcript (about 1.3–1.4× production on long meetings). Action-item and next-steps sections are not allowed. A first submission that breaks these rules is sent back once with the exact problems; anything after that is repaired statically.
Task reconciliation stays with Dream:
update/completecandidates are dropped, and new items are de-duplicated againstopen_tasks.Value-proportional budget: one function,
notes_agent_policy.plan_notes_agent.record_fallback(component=conversation_notes).Cache-friendly prefix: fixed order of shared contract + instructions → tools → lexicon + owner profile (breakpoint) → packet + transcript (breakpoint) → append-only tool turns. Nothing volatile goes in the prefix. The per-user
prompt_cache_keyis computed over the stable bytes, and the gateway scopes it to the owner again. A reusableomi_shaped_agent_input_tokens_total{feature,kind=cached|uncached}metric is added to the harness.Gateway: tools are enabled on the generated
conv_structurelane (config_loader._capabilities_for_feature), so accounting and kill switches stay per feature. Image input already worked on this lane.Metrics:
omi_notes_agent_runs_total{stop},_decisions_total{reason},_tool_use_total{tool},_repairs_total{kind},_tokens_total{kind};conversation_notes_agent_receiptlog line.Rollout and ramp plan
The agent is on by default with a kill switch, registered in
config/feature-flags.yaml:CONVERSATION_NOTES_AGENT_ENABLED(ops_kill, default on;falsereturns every conversation to the one-shot path);CONVERSATION_NOTES_AGENT_PERCENT(stable conversation-hash cohort; unset = 100, unreadable = 0);CONVERSATION_NOTES_AGENT_UID_ALLOWLIST.Order matters. The gateway change must deploy first. Until it does,
conv-structurereturnscapability_not_supported, every eligible conversation falls back to one-shot (fail-open, counted inomi_fallback_total{component=conversation_notes,reason=capability_mismatch}), and it pays one extra rejected request.conv_structuretoolsCONVERSATION_NOTES_AGENT_PERCENT=5,CONVERSATION_NOTES_AGENT_UID_ALLOWLIST=<David>CONVERSATION_NOTES_AGENT_PERCENT(100%)Metrics that must stay clean during step 2:
omi_notes_agent_estimated_cost_usd): p50 ≤ $0.007, p95 ≤ $0.015;omi_fallback_total{component=conversation_notes}plusomi_notes_agent_runs_total{stop!~"submitted|forced_submit"}): ≤ 2% of eligible runs;omi_notes_agent_latency_seconds) ≤ 45 s;omi_notes_agent_tool_calls): median 5–8 on long meetings, p95 at the cap;omi_notes_agent_cache_hit_ratio,omi_shaped_agent_input_tokens_total{feature="conversation_notes_agent"}): ≥ 40%.Rollback: set
CONVERSATION_NOTES_AGENT_ENABLED=false.Blind experiments
Round 3 (v3, 10 meetings): David's labels went v2-deep 7, v3 3, prod 0. v3 was about 1.05× production length and made a median of 0 lookups: the prefetched packet replaced investigation instead of seeding it.
v4 retuned toward v2-deep and keeps the plumbing (nesting, lexicon, past-meeting packet and tools, cache layout, caps, kill switch):
Round 4 (4 fresh unseen meetings, 2.8k–10.8k words; no unused meeting with screenshots remained): task
meeting-notes-v4-2026-10(prod vs lab v2-deep vs v4), labels pending.Round 4b (4 single-sitting Mac calls) tied v2-deep 2–2, prod 0. v4 lost both of its cards because it did not name the other speaker, the original bug. The causes:
get_screen_activitysearched the wrong hours.bodyinstead ofbody_markdown, the one send-back was spent on a spurious "prose / 0 words" complaint.v5 (this head):
people_on_screenleads (utils/conversations/screen_people_leads.py, pure). Built from window titles from 10 minutes before the call to its end:The owner, AI agents (Boardy and similar), groups and channels are excluded. No OCR text is returned.
UTC everywhere. Packet times are
…Z, and the tool time arguments are optional and default to the conversation window.Positive naming rule. Name the other speaker whenever the evidence supports it, and record them in
participantswith speaker key and evidence. AI notetakers and matchmakers are never the speaker. A note that names nobody while strong leads exist is sent back once, and keeps tool access.Body alias.
bodyand similar keys are normalized tobody_markdownbefore checking.Regression tests:
v5 replay on the four 4b meetings plus the original 79e8e434 audit conversation names the right person in participants, title and notes in 5/5, on two independent runs:
v5 on these 5:
v4 ran the production modules from this PR unchanged, with a snapshot toolbox and the dev gateway's
chat-agentlane (same gpt-6-luna;conv-structuregains tools only with this PR). Private data stayed local.Out of scope, noted:
storage_bucketis the dev bucket are currently dropped byown_frames; that is pending David's decision on dev screenshot writes.Deferred:
utils/dream_vocabulary.keyterms, behindDREAM_AGENT_VOCABULARY_STT, default off, capped at 100 terms per fix(backend): refuse a custom vocabulary over 100 terms #22401). Adding trusted People names and turning it on changes live STT for every user, so it needs its own WER and cost check. It is a follow-up, not part of this PR.Verification
BACKEND_UNIT_TEST_FILE_LIST=<file> ./test.sh: the newtests/unit/test_notes_agent.pyplus the existing suites for every module touched (shaped agent, notes v2, screen-frame evidence, known spellings, gateway config, dedupe, process_conversation callers). The new tests cover:tests/unit/fixtures/notes_agent/weekly_sync_replay.json, no real user data).pyrightreports 0 errors on the new modules;scripts/check_feature_flag_registry.pypasses;make runtime-image-source-closurepasses; the app-client OpenAPI export and the generated Swift, Dart and TS client types are regenerated for the additiveParticipant.evidencefield.conv-structurewith tools returnscapability_not_supportedtoday, as expected.chat-agentacceptstool_choice=requiredand a named function, multipleprompt_cache_breakpoints andprompt_cache_key, and a second call read 1,318 of 1,450 prompt tokens from cache across a tool_choice change.Product invariants affected
structured.action_itemspath and the sametask_intelligence_capturepolicy, so desktop still gets Candidates and other clients still get the conservative filter. The agent prompt carries the same strict/loose split as the one-shot prompt (conservative filter when there is no Suggested surface). The notes pass never updates or completes tasks: those candidates are dropped, and reconciliation stays with Dream.OwnerSearch, and participants are stored on the conversation'sstructured.participants, not in any memory tier.UI-Evidence: none -- only the generated Swift DTO gains an optional Participant.evidence field; no rendered UI changes
🤖 Generated with Claude Code