Skip to content

[Bug] Crashes when OCR handles tiny screenshot during visual context generation #502

@davidvekony

Description

@davidvekony

Category

Check all that apply:

  • Keystroke / Input (Tab not working, keystrokes swallowed, input blocked)
  • App Compatibility (bug only in a specific app: Word, Outlook, Mail, browser, etc.)
  • Performance / Crash (slow response, hang, or crash)

cotabby-crash-reports.zip

Summary

Cotabby crashes after running for a while when generating visual/OCR context from the frontmost window. The crash appears to be caused by a Swift checked-continuation misuse in extractText(from:) after OCR receives a tiny screenshot.

Environment

  • macOS version: macOS 26.5 (25F71)
  • Host app: Observed while Messages was active/frontmost, but likely not app-specific
  • Cotabby engine: Open Source
  • Model name (if Open Source): gemma-4-E2B-it-Q4_K_M.gguf
  • Accessibility permission granted: yes
  • Input Monitoring permission granted: yes
  • Screen Recording permission granted: yes

Steps to reproduce

  1. Launch Cotabby 0.4.1-beta build 41 with the Open Source engine enabled.
  2. Use Cotabby normally while switching between apps/windows with visual context or screenshot/OCR context enabled.
  3. Bring a very small/floating/status-style window or tiny UI element into the frontmost context. (I'm inferring this is the case from the error logs but I don't remember seeing specifically small elements on my screen.)
  4. Wait for Cotabby to generate suggestions or visual context.

Expected behavior

Cotabby should ignore screenshots/windows that are too small for OCR, fail gracefully, and keep running.

Actual behavior

Cotabby crashes/quits. The crash reports show EXC_BREAKPOINT / SIGTRAP, and unified logs show:

SWIFT TASK CONTINUATION MISUSE: extractText(from:) tried to resume its continuation more than once, throwing ocrFailed("The image is too small in at least one dimension 2 x 2 (each dimension has to be more than 2 pixels)")

Notes

Crash reports attached.

Both crashes have the same faulting pattern:

  • _assertionFailure
  • CheckedContinuation.resume(throwing:)
  • Cotabby app frame

Related log before crash:

Visual context generation error: Screenshot OCR failed: The image is too small in at least one dimension 2 x 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions