Skip to content

MCP: screenshot right after set_option returns the frame from before the change #599

Open

Description

@bastien-gallay

Observed

Right after set_option changes the theme, the MCP screenshot tool
returns the frame from before the change. The next screenshot shows the new
theme. set_option had already answered success, and list_options and
other calls in between reported the new value, so the setting was applied
but not yet drawn.

Seen 3 times out of 3, with the window unfocused each time:

  • on an isolated dev instance (TERMHERD_DATA_DIR and TMPDIR throwaways,
    dev fixture, mcp.attach): dark → light, then light → nord, with a
    list_sessions or two snapshot calls between set_option and
    screenshot;
  • on the release app, driven from a session it hosts: dark → light.

Expected

A screenshot taken after set_option has answered shows the change, as the
calling rule "act, then observe" assumes. An agent checking a theme or colour
change otherwise reads the old frame and concludes the change did not land.

Steps to reproduce

  1. Run an isolated instance with the bridge attached
    (docs/agents/running.md, Driving an isolated build from outside).
  2. Leave its window unfocused.
  3. Call set_option with {"id": "theme", "value": "light"}.
  4. Call screenshot: the chrome is still the previous theme.
  5. Call screenshot again: the chrome is light.

Guess (unverified)

An idle, unfocused window draws no new frame until an event arrives, and the
screenshot request is that event: it captures the last presented frame and
triggers the redraw that the next capture sees. The idle-window capture
latency of #128 may share the cause.

Activity

  1. added
    area:mcp
    area:capture
    on Nov 21, 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

    area:capturearea:mcp

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions