Skip to content

Annotation index lifecycle unclear — LLMs waste retries on stale annotations #8

@rafiki270

Description

@rafiki270

Problem

LLMs use screenshot-annotated to get numbered element annotations, then use click-annotation or fill-annotation with those indices. But annotations expire silently when the page changes, and the LLM doesn't know:

  • How long annotations are valid
  • What invalidates them (any navigation? DOM mutation? scroll?)
  • Whether there's a way to check if annotations are still valid

The ANNOTATION_EXPIRED error code exists but only appears after the LLM has already tried to use a stale index.

Proposal

  1. Include annotation TTL/validity info in the screenshot-annotated response:

    { "annotations": [...], "validUntil": "next_navigation", "sessionId": "abc123" }
  2. Add an annotations-valid endpoint to check without taking a new screenshot

  3. Document annotation lifecycle in --llm-help metadata for screenshot-annotated, click-annotation, and fill-annotation

  4. Consider auto-invalidation warning: if the page URL or DOM hash changed since the last annotation, include a warning in the next command's response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions