Skip to content

Improve desktop screen-context telemetry and fix likely 'cannot see my screen' failures #9247

Closed

Description

@Git-on-my-level

Summary

Some users report that Omi Desktop cannot see what is on their screen, while local repro on David's machine works. Current prod/beta telemetry is not sufficient to tell whether current reports are permission/capture failures, Rewind DB/image failures, local-tool policy/approval failures, or model/tool-routing failures.

This issue should do both:

  1. Add end-to-end telemetry for screen context availability and use.
  2. Fix the most likely root causes that make screen context unavailable or unusable.

Evidence from quick production/beta check

PostHog project Omi (project_id=302298), macOS prod namespace com.omi.computer-macos, last 30d:

Metric Value
Active macOS users 4,288
Screen Capture Broken Detected users 65
Screen Capture Broken Detected events 2,842
Affected user rate 1.52%
Screen reset clicked users 33
Screen reset completed users 34
Screen permission requested users 930
Screen permission granted users 612
Chat users 510
Chat users with Chat Message Sent.has_context=true 9
Rewind screenshot viewed users 597

14-day daily trend showed Screen Capture Broken Detected basically absent after 2026-06-26, so current reports are not well explained by that event alone.

Sentry examples:

  • OMI-DESKTOP-20A — Screen Capture Broken Detected: 37 events / 11 users, last seen 2026-06-23.
  • OMI-DESKTOP-16 — ScreenCaptureKit: Permission request failed: The user declined TCCs...: 2,370 events / 795 users, last seen 2026-06-23.
  • OMI-DESKTOP-1T8 — PTTContextVocabulary: failed to load screenshot context: Rewind database is not initialized: 7 events / 3 users, last seen 2026-06-21.
  • Rewind DB/image failures also exist, e.g. malformed screenshot DB / OCR backfill failures.

Local sanity check on David's machine:

  • Local API status reports screen_history_available: true, database_available: true, 16k+ indexed screenshots, latest capture current.
  • Local tools exposed include get_local_status, get_screenshot, get_work_context.

Current instrumentation gaps

Chat Message Sent.has_context is not a valid screen-awareness metric today:

  • In ChatPage.swift / DashboardPage.swift, it is set from selectedApp != nil, not from actual screen context availability.
  • Dashboard chat emits has_context=false even when screen context may be available.

chat_agent_query_completed.tool_names can show that a tool like capture_screen was requested, but not whether:

  • the capture succeeded,
  • permissions failed,
  • get_work_context.screen_now.available was true,
  • OCR/timeline was present,
  • get_screenshot image bytes were loadable,
  • the agent actually used the screen result.

desktop_health_event had no recent screen/context rows in the quick query.

Likely root causes to investigate/fix

  1. Permission/capture state

    • ScreenCaptureKit/TCC denial or stale state.
    • Existing recovery path lives around ScreenCaptureService.isScreenCaptureKitBroken() and ProactiveAssistantsPlugin.attemptAutoReset().
    • Verify reset/recovery UX and ensure failures emit structured telemetry.
  2. Rewind DB/image availability

    • get_work_context depends on recent finalized Rewind frames and image loadability.
    • Failures can come from database unavailable, active chunk pending, missing image, corrupted chunk, or malformed DB.
    • LocalAgentAPIServer.screenshotUnavailableResponse already classifies some get_screenshot failures; emit telemetry for these.
  3. Local tool policy / approval path

    • ChatToolExecutor.localPolicyDecision denies capture_screen / get_screenshot with approval_required unless the proper approval/grant flow is used.
    • Make sure desktop chat handles that denial by surfacing approval / retrying correctly rather than making the model answer as if it cannot see the screen.
  4. Model/tool routing

    • Tool descriptions say to call capture_screen when asked what is on screen, while get_work_context gives current screen plus timeline and is likely the better first tool for desktop chat.
    • Ensure prompts/tool priority route screen-awareness questions to get_work_context first, and get_screenshot only when pixels are needed.
  5. Telemetry semantics

    • Replace or deprecate Chat Message Sent.has_context; it currently means selected app/persona context, not screen context.

Proposed telemetry

Add one structured event, for example Screen Context Tool Result / desktop_screen_context_result, emitted for local desktop screen-context tools:

Required properties:

  • tool_name: get_work_context, capture_screen, get_screenshot, search_screen_history
  • surface: dashboard_chat, main_chat, floating_bar, voice, local_api, etc.
  • ok: boolean
  • failure_code: enum/null, e.g. permission_denied, database_unavailable, screen_now_unavailable, screenshot_pending, screenshot_file_missing, screenshot_chunk_corrupted, image_unavailable, policy_approval_required, capture_failed, unknown
  • screen_now_available: boolean/null
  • timeline_count: number/null
  • latest_capture_age_seconds: number/null
  • has_ocr_preview: boolean/null
  • image_bytes_bucket: 0, 1-50kb, 50-250kb, 250kb+ or similar
  • permission_tcc_granted: boolean/null
  • sck_available: boolean/null
  • standard version/build/namespace properties

Also add a chat-cycle level summary event/property:

  • whether a screen tool was requested,
  • whether any screen tool succeeded,
  • whether an approval was required/denied,
  • whether the final answer included/used screen context if detectable.

Acceptance criteria

  • A dashboard/query can answer: “Of macOS users who ask screen-aware chat questions, what percent get usable current screen context?”
  • Telemetry distinguishes permission failures vs Rewind DB/image failures vs local policy/approval failures vs model never called a screen tool.
  • get_work_context emits success/failure telemetry with screen_now_available, timeline count, latest capture age, and classified failure codes.
  • capture_screen / get_screenshot emit telemetry for permission/policy/image failures without logging screen contents or OCR text.
  • Chat Message Sent.has_context is renamed, removed, or replaced with correctly named fields so dashboards do not interpret selected app/persona context as screen context.
  • Desktop chat routes “what is on my screen?” / “do you see my screen?” style prompts to get_work_context first, then get_screenshot/image access only when necessary.
  • If image access requires approval, the UI shows the approval flow and retries or clearly explains the permission request; it should not silently answer without screen context.
  • Add unit/regression tests for telemetry classification and local policy/approval handling.

Privacy constraints

Do not send OCR text, window titles, image bytes, file paths, or raw screenshots to PostHog/Sentry. Only send booleans, counts, age buckets, failure codes, and app version/build metadata.

Activity

  1. added
    bug
    chat
    p1
    on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyticsbugchatdesktopmacOSp1stability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions