Skip to content

fix: report the matched window and add exactTitle for window targets (#89) - #137

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/window-match-89
Oct 24, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/window-match-89

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #89.

What

A generic window:Code could match a different window by substring (topmost wins), and start_recording never said which one. That's a quiet privacy failure under the threat model.

  • selectWindow now also returns matchKind (exact | substring) and up to 5 candidates, and takes { exactOnly }.
  • New pure windowMatchReport() builds the fields both capture tools return: matchedWindow, matchCount, matchKind, region (rect only), and a windowWarning listing candidates when the match was a substring or ambiguous.
  • start_recording returns those fields (it used to drop the match entirely) and stores matchedWindow on the session, so get_session shows it.
  • exactTitle: true on screenshot and start_recording refuses the substring fallback; the error lists near-miss titles.

Small shape change: screenshot's region for a window target is now just {x, y, width, height}; the match details are top-level. Noted under Changed in the CHANGELOG.

Tests

  • Unit: exact single match (no warning), substring + ambiguous match (warning lists candidates), exactOnly refusal with near misses, candidate cap.
  • Live capture harness (Windows, 10/10): start_recording on a real window with exactTitle reports matchedWindow / matchKind: exact, get_session keeps it, and a strict prefix of the title is refused under exactTitle.

Version 0.14.0; README, ROADMAP, CHANGELOG, mcp-tools.json updated.

🤖 Generated with Claude Code

…89)

start_recording now returns matchedWindow, matchCount, matchKind and the
captured region, as screenshot does, and keeps matchedWindow on the
session. A substring-only or ambiguous match adds a windowWarning listing
the candidate titles, and exactTitle: true refuses the substring
fallback entirely.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@TMHSDigital
TMHSDigital merged commit ae51a30 into main Oct 24, 2026
8 checks passed
@TMHSDigital
TMHSDigital deleted the fix/window-match-89 branch October 24, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

window: target can silently record the wrong window, and start_recording does not report which window matched

1 participant