Repository navigation
feat(desktop): gather meeting screen evidence once, before notes - #19886
Conversation
Meeting screenshots were selected and adjudicated only when a note was opened, long after the notes were written, and the on-device roster dropped names that appear only on video tiles (conversation 449565eb). - Finalization runs on-device frame selection + adjudication for meeting sessions before asking the backend to finalize (cloudReconcile, when the conversation id is known), bounded at 20s and fail-open. The run goes through MeetingScreenshotsStore, so a note opened mid-run joins it. - /from-segments meetings adjudicate right after creation (not awaited). - A bounded OCR flush pushes the meeting's own screen-activity rows before notes so the backend screen-text digest sees the end of the call. - The selection window/fingerprint now follows the server's arithmetic (microsecond started_at, half-even rounding, 30s legacy tolerance), so the note reuses the persisted set instead of re-adjudicating. - Call-tile name rule in OnDeviceMeetingIdentityExtractor, in parity with the backend's call_tile_names and its shared test vectors; owner and AI agent tiles are excluded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lifecycle flow Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65fbd6aec4
ℹ️ 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".
| _ = await screenEvidencePass.beforeNotes( | ||
| captureInterval: Self.captureInterval(of: session), | ||
| conversationID: conversationId, | ||
| fetchConversation: { try await client.getConversation(id: conversationId) }) |
There was a problem hiding this comment.
Admit in-progress conversations before adjudicating
For a normal cloud meeting, the conversation is still in_progress while this pass runs, but backend/routers/screen_frames.py:83-84 rejects every adjudication unless the conversation is already completed. The store therefore records a 409 failure, line 441 finalizes the conversation, and no post-completion pass is scheduled, so screenshots are still selected only when the note is later opened. Coordinate the backend admission change with this call or explicitly retry after finalization.
Useful? React with 👍 / 👎.
| _ = await screenEvidencePass.beforeNotes( | ||
| captureInterval: Self.captureInterval(of: session), | ||
| conversationID: conversationId, | ||
| fetchConversation: { try await client.getConversation(id: conversationId) }) |
There was a problem hiding this comment.
Avoid the enriching detail read before evidence settles
When recovery reaches an already completed deferred conversation, this GET is not read-only: backend/routers/conversations.py:999-1002 synchronously calls _enrich_deferred_conversation, which writes the notes. Because the OCR flush runs concurrently and screenshot adjudication happens only after this fetch returns, that recovery path can generate notes before either source of evidence is ready, violating the ordering this helper promises. Fetch the transcript through a non-enriching projection or otherwise suppress deferred first-open processing here.
Useful? React with 👍 / 👎.
| // Notes are already written by `/from-segments`; adjudicate now so the screenshots exist on | ||
| // every surface before anyone opens the note. Nothing waits for it. | ||
| let pass = screenEvidencePass | ||
| Task { _ = await pass.afterCreation(conversation: hydrated) } |
There was a problem hiding this comment.
Finalize the active video chunk before the eager pass
When Rewind capture is running, VideoChunkEncoder continuously keeps a 60-second chunk open, and MeetingFrameSelector deliberately drops every frame in that current chunk because it has no finalized movie metadata (MeetingFrameSelector.swift:208-209,281-283). Starting adjudication immediately after conversation creation therefore commonly excludes the meeting's final minute; if any older candidate is committed, the server stamps the selection fingerprint and later note opens treat the pass as complete, so those tail frames are never reconsidered after the chunk finalizes. Flush/wait for the active chunk or arrange a retry after rotation before recording the pass as settled.
Useful? React with 👍 / 👎.
| /// captured after the meeting ended stay pending and may later ship one more winner for that | ||
| /// bucket; that bounded extra document is the price of notes that see the end of the call. | ||
| /// Legacy (cursor) sync is left alone. Best effort: every failure leaves the periodic path to it. | ||
| func flushMeetingWindow(_ interval: DateInterval, limit: Int = 200) async { |
There was a problem hiding this comment.
Keep meeting flush batches within the server limit
For a meeting that produces 101–200 compacted (app, window, bucket) winners, this default allows all of them to be sent in one pushRows request, while backend/routers/desktop_screen_crisp.py:110-111 rejects any request containing more than 100 rows. The flush then returns without marking anything synced and finalization proceeds, so none of that meeting's newly flushed OCR is available to the notes; periodic sync may deliver it later, but too late for this processing pass. Cap this fetch at 100 or split the candidates into server-sized batches.
Useful? React with 👍 / 👎.
…ken agent markers Review follow-ups for #19886: - Retry adjudication right after the backend finalizes when the pre-notes pass failed, timed out, or had no trusted window (and after force-process reveals the id), joining any run still in flight through the shared store. - Record degraded fallback telemetry when the pre-notes deadline expires or the pass fails (area meeting_screen_evidence). - AI-agent tile markers are whole tokens only, so Talbot/Abbot survive. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: 6ddde49564
ℹ️ 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".
| let hydrated = await hydrateUploadedLocalConversation(id: response.id) | ||
| if bundle.session.conversationRole == .meeting, let hydrated { | ||
| // Notes are already written by `/from-segments`; adjudicate now so the screenshots exist on | ||
| // every surface before anyone opens the note. Nothing waits for it. | ||
| let pass = screenEvidencePass | ||
| Task { _ = await pass.afterCreation(conversation: hydrated) } |
There was a problem hiding this comment.
Flush OCR for cloud-to-local fallback uploads
When an exhausted meeting reaches resolveExhaustedCloudReconciliation(.uploadLocalSegments), it calls uploadLocalSegments directly and bypasses the beforeNotes flush that only runs in the normal .localSegments switch. Because /from-segments writes the notes before this new afterCreation task runs, recovered meetings can still generate notes without their pending end-of-call OCR; centralize the pre-upload flush in uploadLocalSegments or invoke it from the exhausted fallback path.
Useful? React with 👍 / 👎.
| default: | ||
| break |
There was a problem hiding this comment.
Record every fail-open evidence outcome
When the pre-notes conversation GET fails (.conversationUnavailable) or its transcript window is untrusted (.untrustedWindow), this default branch lets finalization proceed without screen evidence and silently switches correctness to the post-finalize retry, but emits no fallback event. These are explicit fail-open paths just like the timeout and upload failure handled above, so record bounded degraded telemetry for them as required.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
…unk, flush telemetry Second review round for #19886: - Post-finalize adjudication waits for the terminal finalization projection (shared schedule with the meeting-completion wake), not the /finalize POST. - Seal Rewind's active chunk and reselect before judging; if frames are still unsealed, fail retryably without uploading or caching .noCapture. - OCR flush push/database failures record degraded fallback telemetry. - Call-tile rows follow the backend's updated call-window rule (shared vectors). - A screenshots-disabled pass never schedules a retry. 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: 022a3c8435
ℹ️ 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".
| if let task { await task.value } | ||
| return phase |
There was a problem hiding this comment.
Retry after a joined adjudication fails
When beforeNotes times out while its adjudication remains in flight, afterFinalize joins that task through the shared inFlight entry. If the original request subsequently fails, run caches nothing, so the joining store's adopt(nil) leaves its phase at .idle; the newly added loadAndWait then returns .idle here and afterFinalize exits without ever starting the intended retry. This can occur when the adjudication exceeds the 20-second bound and later times out or returns an error, leaving screenshots absent until someone opens the note. After joining, propagate the failed terminal result and launch a fresh adjudication rather than treating the idle phase as settled.
Useful? React with 👍 / 👎.
| let hydrated = await hydrateUploadedLocalConversation(id: response.id) | ||
| if bundle.session.conversationRole == .meeting, let hydrated { |
There was a problem hiding this comment.
Retry local-meeting evidence when hydration fails
After /from-segments succeeds, the session is already marked completed, but a transient failure in this follow-up conversation GET makes hydrateUploadedLocalConversation return nil and skips afterCreation. Completed sessions are not revisited by finalization recovery, so this meeting never gets the new eager screenshot pass unless the note is later opened on this Mac; other surfaces continue to see no frames. Schedule a retry using the returned conversation ID instead of making the one-pass behavior conditional on a single successful hydration request.
Useful? React with 👍 / 👎.
| ownerEmails.compactMap { email -> String? in | ||
| let folded = email.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() | ||
| guard folded.contains("@") else { return nil } | ||
| return folded.split(separator: "@", maxSplits: 1, omittingEmptySubsequences: false).first.map(String.init) | ||
| }) |
There was a problem hiding this comment.
Strip email plus tags before matching the owner
For an owner email such as [email protected], this preserves david.zhang+work as the local part and the later punctuation removal produces davidzhangwork, which does not match the tile name David Zhang. If the account has no display name and the tile lacks a (You) marker, the new extractor therefore adds the signed-in user as another participant and can misattribute the meeting notes. Remove the +tag suffix before normalizing the local part.
Useful? React with 👍 / 👎.
…idence fails 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: 5396e8d3ab
ℹ️ 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".
| if DesktopConversationMatchPolicy.shouldFinalizeTimestampMatchedConversation(status: match.status) { | ||
| conversation = try await apiClient.finalizeConversation(id: match.id) | ||
| conversation = try await finalizeBackendConversation(id: match.id, session: session) | ||
| } else { | ||
| conversation = match | ||
| } |
There was a problem hiding this comment.
Run evidence for already-completed reconciliation matches
When an unbound cloud meeting is reconciled to an already-completed timestamp match, this branch accepts match and immediately marks the local session completed without invoking either beforeNotes or afterFinalize. Completed sessions are excluded from recovery, so this path never performs the new eager screenshot pass and screenshots remain absent until the note is opened; schedule the post-finalization evidence pass for completed meeting matches.
Useful? React with 👍 / 👎.
| private static func isCallWindowRow(_ snapshot: MeetingScreenActivitySnapshot) -> Bool { | ||
| let app = snapshot.appName.lowercased() | ||
| if tileMessagingApps.contains(where: app.contains) { return false } | ||
| if nativeVideoApps.contains(where: app.contains) { return true } | ||
| let title = cleanLine(snapshot.windowTitle ?? "").lowercased() | ||
| return firstMatch(meetTabTitle, in: title) != nil | ||
| || conferencingMarkers.contains(where: "\(app) \(title)".contains) |
There was a problem hiding this comment.
Restrict native-app rows to actual call windows
For native clients, every Zoom, Teams, Webex, or FaceTime window is classified as a call window solely from appName. If someone uses a Teams chat/channel window during a meeting, persistent sidebar names can satisfy the three-row/25% tile threshold and be uploaded as meeting participants, corrupting attribution in the generated notes. Require call-specific title or control evidence for native-app rows instead of admitting the entire application.
Useful? React with 👍 / 👎.
| let outcome = await adjudicate(conversationID: conversationID, fetchConversation: fetchConversation) | ||
| log("MeetingScreenEvidence: after-finalize pass for \(conversationID) -> \(outcome)") | ||
| return outcome |
There was a problem hiding this comment.
Record failed post-finalization evidence fallbacks
When the post-finalization retry's conversation GET fails, its transcript window is still untrusted, or adjudication returns .failed, this method returns that terminal outcome to an unobserved background task and only writes a local log. The completed session is no longer recovered, so correctness has silently fallen back to retry-on-note-open; emit bounded recordFallback telemetry for this after_finalize → note_open fail-open just as afterCreation does.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
| let losslessEnabled = await MainActor.run { ScreenActivityLosslessSyncFeature.isEnabled } | ||
| guard losslessEnabled, let dbPool = await getDBPool() else { return } |
There was a problem hiding this comment.
Flush meeting OCR on the stable sync path
On stable production bundles where screen_activity_lossless_sync has not been explicitly enabled, this guard makes the new pre-notes OCR flush a no-op. Those users remain on the legacy cursor path, which does not close and text-sync the meeting's open buckets here, so the backend writes notes without the recent screen text this change is intended to provide. Add a legacy-compatible flush or make this bounded text upload independent of the lossless rollout flag.
AGENTS.md reference: desktop/macos/AGENTS.md:L228-L231
Useful? React with 👍 / 👎.
| + "\(selectionWindow.start) -> \(selectionWindow.end)") | ||
|
|
||
| let outcome = await selectCandidates(selectionWindow) | ||
| var outcome = await selectCandidates(selectionWindow) |
There was a problem hiding this comment.
Do not cache selector unavailability as no capture
During launch recovery or a transient database read failure, MeetingFrameSelector.selectCandidates returns an empty Outcome when SpineScreenIndex.poolWhenReady() times out or its query throws. This eager call then treats that as a genuine empty meeting, caches .noCapture, and reports a settled outcome, which suppresses the post-finalization retry and prevents a later note open in the same app session from selecting frames after the database recovers. Preserve an unavailable/failed selector outcome instead of caching it as an empty capture.
Useful? React with 👍 / 👎.
…name keys Cross-PR review with #19911: - A cached screenshot set is rendered only while its signed URLs outlive a 5-minute margin; otherwise the persisted set is re-read. A failed thumbnail load triggers one coalesced re-read. - Call-tile owner/candidate keys use full Unicode case folding (Python casefold parity: ß/ss, final sigma). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aceholder Co-Authored-By: Claude Opus 5.5 <[email protected]>
… rules Tile rows need per-window call evidence unless they are a Meet tab; agent tiles the roster classifier agrees on join the upload as names (the roster types them ai_agent). Parity with the 23 shared vectors on #19911. 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: cd58610a42
ℹ️ 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".
| /// Legacy (cursor) sync is left alone. Best effort: every failure leaves the periodic path to it. | ||
| func flushMeetingWindow(_ interval: DateInterval, limit: Int = 200) async { | ||
| let losslessEnabled = await MainActor.run { ScreenActivityLosslessSyncFeature.isEnabled } | ||
| guard losslessEnabled, let dbPool = await getDBPool() else { return } |
There was a problem hiding this comment.
Record the unavailable OCR database fallback
When RewindDatabase.initialize() fails or no effective-owner pool is available, getDBPool() returns nil and this guard silently skips the pre-notes OCR flush while finalization continues. That is a fail-open correctness path, but unlike SQL and upload failures below it emits no recordFallback, leaving operators unable to distinguish successful evidence collection from notes generated without recent OCR; record a bounded database-unavailable fallback before returning.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 221adc5416
ℹ️ 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".
| if allowForceProcess { | ||
| conversation = try await apiClient.finalizeConversation(id: backendId) | ||
| conversation = try await finalizeBackendConversation(id: backendId, session: session) | ||
| } else { | ||
| conversation = try await apiClient.getConversation(id: backendId) |
There was a problem hiding this comment.
Schedule evidence for completed non-force bindings
When a meeting has a bound backend ID and allowForceProcess is false, an already-completed conversation is accepted through this GET branch and the local session is immediately marked completed without running either beforeNotes or afterFinalize. Several normal stop/rotation callers explicitly pass false, and completed sessions are excluded from finalization recovery, so these meetings never receive the new eager screenshot pass and remain dependent on someone later opening the note on this Mac. Schedule the post-finalization evidence pass when this branch observes a completed meeting.
Useful? React with 👍 / 👎.
| let tokens = Set(words.map { $0.trimmingCharacters(in: CharacterSet(charactersIn: ".'’-")) }) | ||
| if !tokens.isDisjoint(with: rosterAgentTokens) { return true } |
There was a problem hiding this comment.
Match the backend's AI-agent classifier
For persistent agent tiles such as Otter Bot, Meetbot Recorder, or Fathom Assistant, this token rule classifies the name as an agent and therefore uploads it through callTileAgentNames. However, the receiving classifier in backend/utils/conversations/meeting_participants.py:284-295 has no equivalent generic token rule—those examples match neither its exact-name, first-token, nor phrase checks—so it records them as human participants and can attribute their activity to people in the notes. Mirror the backend predicate exactly or transmit an explicit participant kind.
Useful? React with 👍 / 👎.
| let elsewhere = nonCallRows.filter { row in | ||
| row.combinedText.components(separatedBy: .newlines).contains { tileName(cleanLine($0)) == name } | ||
| }.count |
There was a problem hiding this comment.
Case-fold the non-call chrome comparison
When OCR renders the same persistent browser label with different capitalization in call and non-call rows, this exact string comparison fails to recognize it as recurring chrome even though call-row counts and the rest of the tile identity keys are case-folded. For example, repeated Acme Support call rows and Acme SUPport non-call rows both pass tileName, but the latter never contributes to elsewhere; the label can then pass the persistence threshold and be uploaded as a meeting participant. Compare the extracted names using the same case-folded key used for counting.
Useful? React with 👍 / 👎.
…s; batch OCR flush Final review round for #19886: - Background screen-evidence passes read the server's trusted selection window from the screenshots route (trusted_selection_fingerprint) instead of the conversation detail route, which runs deferred enrichment and first-open fanout. Absent the field, they skip and the note adjudicates. - The meeting OCR flush ships batches of at most 100 rows (the sync route's limit) and drains within the pass deadline, recording degraded telemetry when it stops early. - A failed post-finalize pass records degraded telemetry (to note_open). 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: bb0369b2cb
ℹ️ 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".
| try await client.getConversationScreenFrames(conversationID: conversationID).trustedSelectionFingerprint | ||
| .flatMap(MeetingScreenshotSelectionWindow.init(serverFingerprint:)) |
There was a problem hiding this comment.
Populate the trusted selection fingerprint endpoint
For every cloud meeting, this read currently resolves to nil: the commit adds trustedSelectionFingerprint only to the Swift wire type, while backend/models/screen_frame.py::ConversationScreenFrameSet and backend/utils/screen_frames/enforcement.py::build_frame_set_response neither define nor populate trusted_selection_fingerprint. Consequently both the pre-notes pass and its post-finalization retry return .untrustedWindow without adjudicating, so the new eager screenshot flow remains dependent on opening the note. Add the trusted window to the backend response (or derive it through an existing side-effect-free API) in the same change.
Useful? React with 👍 / 👎.
…int body Co-Authored-By: Claude Opus 5.5 <[email protected]>
…de on failed window reads Post-merge review of #19886: - The bounded meeting OCR flush now runs inside uploadLocalSegments, so the exhausted-cloud-reconciliation fallback upload gets it too. - An unbound pre-notes call (no conversation id yet) is `.unbound` and records nothing; a failed screenshots-window read is `.conversationUnavailable` and records degraded fallback telemetry. 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: a3b9ab1a60
ℹ️ 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".
| let pass = screenEvidencePass | ||
| let client = apiClient | ||
| Task { [weak self] in | ||
| if await Self.awaitTerminalFinalization(conversationID: conversationID, client: client) { |
There was a problem hiding this comment.
Record exhausted finalization polling as a fallback
When the finalization projection remains nonterminal through the full polling schedule, or every status read transiently fails, awaitTerminalFinalization returns false and this task only clears its coalescing key. The local session has already been completed, so no subsequent automatic evidence attempt is scheduled and correctness silently falls back to retry-on-note-open; emit a degraded recordFallback event before abandoning this retry.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
| let tiles = | ||
| callTileNames(in: snapshots, ownerNames: ownerNames, ownerEmails: ownerEmails) | ||
| + callTileAgentNames(in: snapshots, ownerNames: ownerNames, ownerEmails: ownerEmails) |
There was a problem hiding this comment.
Sample call tiles across the full meeting
For meetings longer than the provider's 240-row window, these extractors do not actually evaluate the full interval: RewindMeetingScreenActivityProvider requests only 240 screenshots, and RewindDatabase.getScreenshots returns them newest-first. At the default three-second capture cadence this is roughly the final 12 minutes, so a participant who was visible earlier and left before that tail is absent from both the tile candidates and the ordinary participant extraction, causing the new identity evidence to omit them. Query or sample across the entire meeting interval before applying the persistence threshold.
Useful? React with 👍 / 👎.
) - Meeting listen sessions with screenshots on declare screen_evidence=enabled. - Pre-notes order is identity upload, then the bounded OCR flush, then the adjudication call, whose marker therefore means all three landed. - An empty selection, unreadable candidates, or no trusted window send the empty-candidates stamp instead of nothing. 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: 1bc1158d9f
ℹ️ 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".
| role: MeetingConversationBoundaryPolicy.Role, screenshotsEnabled: Bool | ||
| ) -> [URLQueryItem] { | ||
| guard role == .meeting, screenshotsEnabled else { return [] } | ||
| return [URLQueryItem(name: "screen_evidence", value: "enabled")] |
There was a problem hiding this comment.
Wire the evidence declaration into the backend
This query item currently has no effect: backend/routers/transcribe.py:180-201 does not declare a screen_evidence parameter, ListenRequest has no corresponding field, and a repo-wide search finds no notes-admission consumer. Consequently, when the 20-second client pass times out, /finalize can start note generation immediately while adjudication continues in the background, so the resulting notes omit the late screen evidence despite this code claiming a bounded server wait.
Useful? React with 👍 / 👎.
| phase = .noCapture | ||
| Self.cache[cacheKey] = ([], nil, notes) |
There was a problem hiding this comment.
Preserve empty-stamp failures as retryable
When selection legitimately returns zero candidates but the required empty adjudication fails because of a transient network/server error, this catch converts that failure into .noCapture and caches it. Outcome.needsRetryAfterFinalize treats .noCapture as settled, and a later note open reads the cache, so the server never receives the adjudication marker and neither automatic path retries; return .failed without caching instead so the retry and degraded fallback telemetry run.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r cache a failed stamp - MeetingFrameSelector reports an unavailable Rewind pool or failed query as localReadFailed; the store returns an uncached retryable failure and never sends the empty stamp for it. - A failed empty-stamp request is an uncached .failed (retry + degraded telemetry), not a cached .noCapture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inal window - One owner snapshot per evidence run, captured before reading that owner's Rewind/OCR data, rechecked after reads and before each upload, and bound into transport auth: frame adjudication and empty stamp, on-device identity upload, and the meeting OCR flush. An owner change aborts with degraded (auth) telemetry and nothing sent or marked. - After finalization is terminal, run the terminal pass even when the pre-pass settled, so a window widened by a late STT tail is judged; an unchanged window is a cache/persisted-set no-op. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cle flow 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: 2d4627a38d
ℹ️ 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".
| if wire.isEmpty && !bounded.isEmpty { | ||
| // Chunks aged out between selection and upload: nothing to offer, but the pass is done. | ||
| log("MeetingFrameJudge: no candidate had readable pixels; sending the empty evidence stamp") | ||
| } |
There was a problem hiding this comment.
Keep unreadable candidate sets retryable
When selection produced candidates but every pixel read fails—for example, because a just-sealed chunk is temporarily unreadable—this branch sends an empty adjudication anyway. The backend then stamps the current fingerprint and MeetingScreenshotsStore.apply caches .noCapture, suppressing both the post-finalization and note-open retries even if the pixels become readable; the settled result also bypasses fallback telemetry. Preserve this as a retryable read failure and reserve the empty stamp for a genuinely empty selector result.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
| guard await push(candidates.map(\.payload)) else { | ||
| log("ScreenActivitySync: meeting flush push failed; periodic sync will retry") | ||
| recordFallback("upload_failed") | ||
| return .pushFailed(synced: synced) |
There was a problem hiding this comment.
Separate OCR delivery from frame-request follow-up
For a meeting with multiple OCR batches, if /v1/screen-activity/sync returns 200 after storing the first batch but one of its returned frame-request claim/upload/promote operations fails, pushRows returns false here. The flush consequently stops before sending later batches and leaves the accepted first batch locally pending, so note generation can miss every remaining OCR row until periodic sync runs. Treat successful OCR delivery separately from the optional frame-request follow-up when deciding whether to continue and mark this flush batch.
Useful? React with 👍 / 👎.
| static func screenEvidenceQueryItems( | ||
| role: MeetingConversationBoundaryPolicy.Role, screenshotsEnabled: Bool | ||
| ) -> [URLQueryItem] { | ||
| guard role == .meeting, screenshotsEnabled else { return [] } | ||
| return [URLQueryItem(name: "screen_evidence", value: "enabled")] |
There was a problem hiding this comment.
Keep OCR admission independent of screenshot settings
For a cloud meeting whose screenshot setting is off, this guard omits the evidence declaration even though MeetingScreenEvidencePass.beforeNotes still flushes OCR and explicitly intends that text to serve the notes. Socket teardown can start backend capture-end finalization before the client reaches its explicit finalize call, and the backend evidence wait is non-applicable without this declaration (and currently also skips accounts with screenshots off), so end-of-call OCR and identity uploads can arrive after notes are written. Add a declaration/marker for non-image evidence or otherwise coordinate the backend wait independently of the screenshot setting.
Useful? React with 👍 / 👎.
…indows - MeetingFrameJudge distinguishes permanently missing pixels (not found, corrupt, undecodable) from retryable read failures; a retryable failure throws, so nothing is stamped and the store stays uncached and retryable. - The pre-notes pass no longer stamps a conversation with no trusted window (the server 409s it and no longer waits on it). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd every recovery path - Meeting OCR flush compaction and sync-state writes hold an INV-AUTH-1 owner mutation lease through commit, with the owner re-required inside the transaction and rechecked after the pool opens. - Evidence gathering no longer depends on force-process permission: 4-hour and max-duration rotations run the pre-notes pass and the terminal pass. - Audit fixes: identity upload on the exhausted local-fallback recovery path; terminal pass for already-processed timestamp matches; a probed 404 id is unbound (no telemetry); never seal a replacement owner's Rewind chunk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ests Frame-request delivery reads Rewind pixels across further awaits, where an account switch could pair one owner's pixels with another's headers. The backend returns recoverable requests on every sync response, so the periodic sync delivers them. 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: e82f78d9b6
ℹ️ 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".
| .task(id: Self.isFailure(phase)) { | ||
| guard Self.isFailure(phase), !reportedUnavailable else { return } | ||
| reportedUnavailable = true | ||
| onContentUnavailable?() |
There was a problem hiding this comment.
Reset thumbnail retry state after refreshing its URL
When expired thumbnails all fail together, each tile sets reportedUnavailable before the coalesced refreshPersistedSet() finishes. If that single refresh request fails transiently, or the replacement URL also fails, the flag remains true even when frame.thumbnailURL later changes because ForEach preserves the tile by frame ID. Further failures therefore never request another refresh, leaving placeholders until the note view is recreated; reset this state when the URL changes or after a failed refresh.
Useful? React with 👍 / 👎.
| guard authorization.isCurrent else { | ||
| log("OnDeviceMeetingIdentity: signed-in account changed; identity not uploaded") | ||
| return |
There was a problem hiding this comment.
Record the identity owner-change fallback
When the account changes while snapshots or owner identity are being read, this new guard only logs and returns; the enclosing finalization path then proceeds without the meeting identity and provides no bounded health event explaining that degraded evidence pass. Record this auth fallback before returning, as required for fail-open paths.
AGENTS.md reference: desktop/macos/AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb8ee7613c
ℹ️ 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".
| if let authorizationSnapshot, !RuntimeOwnerIdentity.isAuthorizationCurrent(authorizationSnapshot) { | ||
| throw AuthError.userChangedDuringRequest | ||
| } | ||
| let baseURL = await apiClient.baseURL | ||
| let generatedClient = OmiAPI.OmiApiClient(baseURL: baseURL, headers: headers) |
There was a problem hiding this comment.
Revalidate the owner immediately before the identity upload
When the account changes during await apiClient.baseURL, the last authorization check has already passed, so the generated client can still send owner A's meeting identity with owner A's cached headers after that authorization generation was revoked. This contradicts the method's owner-bound guarantee and allows an upload to continue after sign-out or an A→B switch; recheck the snapshot after this await and immediately before invoking the generated request.
Useful? React with 👍 / 👎.
| // Keyed on failure, not on appearance: the placeholder is already on screen | ||
| // while loading, so it does not re-appear when the load then fails. | ||
| .task(id: Self.isFailure(phase)) { |
There was a problem hiding this comment.
Allow another refresh after a transient URL refresh failure
When an expired thumbnail triggers this task but refreshPersistedSet() fails transiently, reportedUnavailable remains true even though the frame still has the same unusable URL. Because this tile instance will never invoke onContentUnavailable again, it remains a placeholder for the rest of the open note despite the network recovering; reset the one-shot state when the refresh fails or otherwise schedule a bounded retry.
Useful? React with 👍 / 👎.
Summary
Screen evidence, one pass (macOS side). Motivated by conversation 449565eb: a 1:1 Google Meet whose other participant's name was on their video tile the whole call, yet the notes said "the feedback user" and the roster said "You, Speaker 2".
ConversationFinalizationServicenow runs on-device frame selection andMeetingFrameJudgeadjudication before it asks the backend to finalize, whenever the conversation id is known (everyfinalizeConversationcall site in cloudReconcile). The pass is bounded at 20s and fails open. It goes throughMeetingScreenshotsStore, so a note opened mid-run joins the same in-flight run and never starts a second adjudication. If the bound expires, the work keeps running in the background and the note picks up the result. Any failure is silent (for example a 409 because egress is off), and the note view then retries on open as before..noCapturelocally. The server records the window as looked at, so a later open reads it back rather than selecting again. The stamp is sent only after a successful local read that genuinely found nothing. If Rewind's store could not be read, or the stamp request itself fails, the result is an uncached, retryable.failedwith degraded telemetry, and nothing is stamped.completed, or 404 for an inline finalization). It does not act on the/finalizeresponse, because that response can come back while Cloud Tasks is still processing. The retry uses the same schedule as the meeting-completion wake, and the two now share the delay constants. It is coalesced per conversation and not awaited. A run still in flight from the bound is joined through the shared store rather than repeated.RewindStorage.flushCurrentVideoChunk, the same finalize-and-continue flush used for power and memory transitions) and selects again. If frames are still unsealed, the run ends in a retryable.failedstate: nothing is uploaded or cached, and the next load selects again.product/invariants/auth-session.md, owner-bound background sync).MeetingEvidenceAuthorization) before it reads that owner's local stores. The snapshot is rechecked after each read and before each send, and the transport auth is bound to that owner. This covers the frame adjudication and empty stamp (MeetingFrameJudge,APIClient.adjudicateScreenFrames), the on-device identity upload (OnDeviceMeetingIdentityService,BackendDesktopMeetingUploader), and the meeting OCR flush (ScreenActivitySyncService.flushMeetingWindow,pushRows).auth.claimFrameRequests/uploadAndPromoteFrameRequestsread Rewind pixels across awaits and upload them with headers minted earlier)./from-segments) pass, or a failed or deadline-stopped OCR flush (push or database) records degraded fallback telemetry (recordFallback, areameeting_screen_evidence, reasontimeoutorupload_failed). The user sees nothing./from-segmentswrites notes synchronously, so the meeting adjudicates right after creation without blocking finalization. Screenshots then exist on every surface before the note is opened.ScreenActivitySyncService.flushMeetingWindowcompacts and pushes the meeting's own rows before notes: one winner per(app, window, bucket)inside the meeting, in batches of at most 100 (the sync route's limit), drained within the pass deadline. Legacy cursor sync is untouched._trusted_content_window/_selection_fingerprintexactly: microsecondstarted_at,timedeltamicrosecond rounding, and half-even millisecond rounding. The legacy tolerance is now the server's 30s; it was 60s.ISO8601DateFormattertruncates to milliseconds, so the note's fingerprint often differed from the one the server stamped. Every reopen then re-selected and re-uploaded frames the server had already judged.OnDeviceMeetingIdentityExtractor.callTileNamesadds the rule from the backend'scall_tile_names, pinned by the sharedbackend/tests/fixtures/meeting_identity/call_tile_vectors.json. A 2-to-4-token name line counts only if it recurs in 3 or more conferencing rows, and in at least 25% of them. The rule excludes the owner (a "(You)" tile, or a matching owner name or email), Tile names are read only from call-window rows. A "Meet - …" tab always counts. Any other conferencing window (a native video app or a conferencing marker) counts only if it shows call evidence: a call-control marker, or a meeting, call, webinar or huddle title. Teams chat lists and Zoom's home screen therefore do not count, a Meet URL in OCR alone does not count, and messaging apps never do. Agent tiles that pass every other rule, and that the roster's name classifier (ported aslooksLikeAIAgentName) also calls agents, are uploaded as plain participant names after the people. The upload has no participant kind, so the backend roster types them asai_agentby name. Title parts are compared without unread counters or trailing icons, and chrome is compared against the same app's other windows. Name keys use full Unicode case folding, the same as Pythoncasefold(): "Groß" matches "Gross", and final and medial sigma match. AI agents are matched only by whole tokens (bot, chatbot, meetbot, notebot, notes, notetaker, ai, agent, assistant, recorder, companion, boardy, otter, fireflies, fathom, gemini, granola, tldv). "James Talbot" and "Alice Abbot" survive; "Tomorrow Inc - NoteTaker" does not, window-title parts, and browser chrome. It also brings the joiner-word and 200-character roster-line rules into parity.Cross-lane dependency
Backend field (merged in #19911): the background passes never call
GET /v1/conversations/{id}, whose first read runs deferred enrichment and first-open fanout. They read the server's trusted window fromtrusted_selection_fingerprintonGET /v1/conversations/{id}/screenshotsinstead (owner route,Optional[str], null when there is no trusted window). When it is null, the passes skip adjudication and the note view adjudicates on open.Backend admission contract (#19932, merged): this PR implements the client side of the contract.
/v4/listenwithscreen_evidence=enabled. Nothing else sends it. The backend persistsexternal_data.screen_evidence_pass=true, and only then holds the meeting's notes for up to 25s, waiting for this conversation's adjudication marker.POST /v1/calendar/meetings)POST /v1/screen-frame-egress/adjudicationscandidates: []when selection finds nothing, or when every candidate's pixels are permanently gone (missing, corrupt or undecodable). That empty call only stamps the marker, so the stamp always means identity and OCR have landed. A transient pixel-read failure fails retryably and sends nothing. With no trusted window, nothing is stamped: the server does not wait on such a conversation.Deploy order: this desktop change must ship after the backend screen-evidence PR (#19911) is deployed. That PR admits
in_progress/processingconversations with a trusted window. Before it lands, the pre-notes pass gets a silent 409, and only the post-finalize retry adds screenshots.Self-audit: finalization entry paths
Every path goes through
ConversationFinalizationService. Entry points:AppState+Transcription: explicit stop, meeting end, 4-hour and max-duration rotation, automation stop.TranscriptionRetryService: crash recovery and app-relaunch recovery, throughrecoverPendingFinalizations.Order is always identity upload → OCR flush → adjudication/stamp → the backend call that writes notes. Retried attempts are idempotent:
/from-segments, stop / meeting end / crash)finalizeSessionstartuploadLocalSegments, before the POSTafterCreation, not awaitedtestLocalMeetingMaxDurationUploadPreservesMeetingRolefinalizeSessionstartbeforeNotesbeforeNoteson the server window, before/finalizetestMeetingScreenEvidenceIsGatheredBeforeTheBackendWritesNotes,testASettledPrePassIsRejudgedWhenTheTerminalWindowGrewfinalizeSessionstartbeforeNotesbeforeNotes, before the readtestMaxDurationRotationGathersEvidenceWithoutForceProcessfinalizeSessionstartbeforeNotesbeforeNoteson the client id; a 404 is.unbound, with no telemetrytestRetryingMeetingFinalizationRecoversExactIdAndWakesChatfinalizeSessionstartbeforeNotes, flush only (.unbound)retryScreenEvidenceAfterFinalizefinalizeSessionstartbeforeNotesif the match gets finalizedcompleteTimestampMatchedConversationfinalizeCloudSessionormarkRetryableFailure)uploadLocalSegmentsafterCreationfinalizeExhaustedCloudSessionFromLocalSegments, skipsfinalizeSession)uploadLocalSegmentsafterCreationtestRecoverPendingFinalizationsProcessesExhaustedBackendBoundLocalFallback.crashRecovery) and relaunch retry (.retry)"Terminal pass" means it runs after the finalization status is terminal.
Local database writes added by this PR
flushMeetingWindow): each write holds an INV-AUTH-1 owner mutation lease through the commit (LocalMutationAuthorization.withCommitLease,require()inside the transaction). The owner is rechecked after the pool opens, after every read and before every push. Test:testMeetingFlushNeverMutatesRowsOnceTheOwnerLeaseIsRevoked.flushCurrentVideoChunk, the existing mid-capture API): only while the captured owner is still current.markSession*calls are unchanged.Uploads. Each of these is owner-bound (captured before the read, rechecked before the send, auth bound to that owner):
MeetingFrameJudge)Failure handling. Terminal outcomes are cached or stamped:
.ready,.noCaptureafter a successful read, and pixels that are permanently gone. Everything else is an uncached, retryable.failedwith no stamp:Telemetry. Degraded
meeting_screen_evidencefallbacks cover:timeoutother)upload_failed)auth)They are labelled
before_notes→after_finalize,after_finalize→note_open,after_creation→note_openorocr_flush→periodic_sync. An expected unbound call or a probed 404 records nothing.Failure class
Failure-Class: none
The
fix(desktop)commit corrects defects that review found in this PR's own, not-yet-merged code: the early cache fill and the tile-name key folding. It does not fix a shipped failure.Test plan
xcrun swift build -c debug --package-path Desktop --build-tests(Xcode 27 locally; CI pins 26.6)swift test --filter 'Conversation|Transcription|Meeting|ScreenActivity|Calendar': 676 tests, 0 failuresMeetingScreenEvidencePassTests:TranscriptionFinalizationStateMachineTests.testMeetingScreenEvidenceIsGatheredBeforeTheBackendWritesNotes: adjudication runs on the server window with 0 POSTs issued, and the GET conversation precedes POST finalizeOnDeviceMeetingIdentityCallTileTests: all 14 shared backend vectors pass (run withOMI_CALL_TILE_VECTORS_PATHpointing at the backend lane's fixture), plus inline incident, owner, agent and threshold casesScreenActivityLosslessSyncTests.testMeetingFlushShipsTheOpenBucketsWinnerInsideTheMeetingOnly🤖 Generated with Claude Code