Skip to content

TD-5231: agent-desktop's cursor works from the packaged app - #117

Merged
captcrock merged 1 commit into
mainfrom
td/5231-ax-cursor-packaged
Nov 3, 2026
Merged

captcrock merged 1 commit into
mainfrom
td/5231-ax-cursor-packaged

Conversation

@captcrock

Copy link
Copy Markdown
Contributor

What

Two bugs from the TD-5227 live check against the packaged build:

  1. Session race. Two sessions whose first element command ran at the same moment each started their own agent-desktop session, so one session's snapshot refs were looked up in the other's namespace (SNAPSHOT_NOT_FOUND). AxCursor now serializes start, turn-off and end under one asyncio lock; the commands themselves still run in parallel.
  2. Screenshots kept the bundled copy's cursor. The agent-desktop copy shipped inside TST Desk (TD-5228) reports "TST Desk" as the owner of its cursor windows, so the TD-5227 exclusion by owner name agent-desktop missed them. The host (cu_capture.rs) and the Python fallback now also match the owning process's executable via proc_pidpath, which keeps TST Desk's own windows.

Tests

  • Core: test_two_first_commands_at_once_start_one_session (fails without the lock); the cursor tests pass (20).
  • tst-cu-mcp: the bundled copy is found by executable while the app's own window stays; process_name reads this process. Suite on macOS: 661 passed, plus the 3 failures that main already has (DarwinBackend.hit_test). mypy: the same 4 errors as main.
  • Rust: executable_name reads this process and refuses nonsense; cargo test --lib 150 passed, cargo clippy --all-targets -- -D warnings clean.

Live (packaged binaries, macOS)

  • Two sessions clicking Calculator at the same moment now share one agent-desktop session, and both clicks are delivered.
  • While the bundled copy's cursor is on screen, the capture drops exactly its window (reported owner "TST Desk", the renderer's own process) and keeps the TST Desk window, 125 of 126 windows kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HUthoCdmzg2hy89ssk2cSF

Two bugs from the TD-5227 live check against the packaged build:

- Two sessions whose first element command ran at the same moment each
  started an agent-desktop session; one session's refs then resolved in
  the other's namespace (SNAPSHOT_NOT_FOUND). Start, turn-off and end of
  the cursor session now run under one asyncio lock; commands themselves
  still run in parallel.
- The agent-desktop copy bundled inside TST Desk reports "TST Desk" as the
  owner of its cursor windows, so captures that left out the owner name
  "agent-desktop" kept them. The host and the Python fallback now also
  match the owning process's executable (proc_pidpath), which keeps TST
  Desk's own windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCdmzg2hy89ssk2cSF
@captcrock
captcrock force-pushed the td/5231-ax-cursor-packaged branch from f4730f7 to 4703d7c Compare November 3, 2026 17:26
@captcrock
captcrock merged commit b383be3 into main Nov 3, 2026
4 checks passed
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.

1 participant