Skip to content

Inline suggestions leak text across windows/apps/tabs and loop on repeated phrases #32

@shreeraman96

Description

@shreeraman96

Summary

Inline ghost-text suggestions can surface text the user never typed in the focused field — leaking content across windows, apps, and browser tabs — and can loop on phrases already written. I hit this repeatedly in real use (examples below) and traced it to several independent gaps in the OCR window picker, the output filter, writing-history selection, and the reuse cache.

Symptoms & reproductions

1. Cross-window OCR bleed (same app).
Typing in a notes window, the suggestion contained text from a different window of the same app — e.g. after my own text the ghost continued with “…where Elon musk is speaking”, which was only present in another window I had open, not the one I was typing in.

2. Repetition loop.
After typing …You can use it to access the OpenAI. And, the suggestion was you can use it to access the OpenAI — re-proposing a phrase already on screen, which loops if accepted.

3. Cross-app writing-history bleed.
In a fresh Gmail draft containing only Hi Molly,, the suggestion was you can use it to access the OpenAI — verbatim content from my Notes app (a different application), parroted into the email.

4. Clipboard echo across browsers.
Composing in Gmail (Chrome), the suggestion was if you require maintenance of UPS systems or — text from a localhost page open in Safari that I had copied. It rode in via clipboard context and was parroted verbatim.

5. Cross-tab OCR staleness.
Composing in Gmail (Chrome), the suggestion was 2 of 10 ikea — a results-counter + search term from a different tab/window. On a window/tab switch the cached OCR text from the previous window was still served before the new capture completed.

Suspected root causes

  • OCR window selection picks the focused app’s largest window with no caret awareness, so with multiple same-app windows it can OCR the wrong one; overlapping windows also tie to the background one. (Symptom 1)
  • The repetition guard, where present, only caught a completion that was entirely a substring of recent text, missing the common “repeat then diverge” loop. (Symptom 2)
  • previousUserInputs (writing history) was selected across all apps, so unrelated content from another app/tab was injected and copied. (Symptoms 3, partially 4/5 conceptually)
  • Clipboard / OCR side context had no guard against the model reproducing it verbatim. (Symptom 4)
  • On a window/tab change the OCR cache kept the previous window’s text until the async re-capture finished. (Symptom 5)
  • The reuse cache re-shows previously-approved completions without re-checking context-dependent guards, so a repeat/echo can resurface as beforeCursor/clipboard change.

Environment

  • Affected features are the opt-in Screen-context OCR, clipboard context, and writing history that feed the completion prompt.
  • macOS, multi-display and multi-window/tab setups make symptoms 1 and 5 more likely.

A fix PR follows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions