Repository navigation
v0.8.3 — openApp idempotency + agent runaway guard
User reported Outlook launching repeatedly during a test. Root-cause diagnosis traced to three compounding failures: (1) PlatformAdapter.openApp spawned a new instance even when the app was already running, (2) the escalation ladder (router → blind → hybrid → vision) re-ran open_app at each rung because earlier rungs couldn't verify success through New Outlook's sparse WebView2 accessibility tree, (3) clawdcursor stop only killed the start process on port 3847, missing serve (different port / same port different process) and mcp (stdio, no port) entirely. A stale serve kept receiving MCP traffic after the user thought they'd stopped everything.
Fixed
openApp/launchAppidempotency (Windows + macOS + Linux). When the target app already has a visible window AND the caller didn't setalwaysNewInstance: trueAND nourlis passed, the adapter now focuses the existing window and returns its pid instead of spawning another instance. Match policy: case-insensitive exact processName → processName substring → title substring → UWP AppId tail. Closes the "N windows of Outlook stacking up" class of bug under any retry loop.src/v2/platform/{windows,macos,linux}.ts.- Agent runaway guard — if the agent calls the same tool + identical args ≥ 3 times within the last 6 turns, the loop exits with
give_upand a targeted message suggestingdetect_webview_appswhen the target is likely Electron/WebView2. Prevents the generalized "retry-loop-because-a11y-is-opaque" anti-pattern.src/pipeline/agent/agent.ts. clawdcursor stopnow sweeps all modes. After the graceful/stopon port 3847, iterates every pidfile in~/.clawdcursor/*.pid, SIGTERMs any live pid, SIGKILLs after 500ms if still running, and unlinks the pidfile. Catchesmcp(stdio-only), zombieserve, and any start/serve on a non-default port.src/index.ts.
Notes
- Stale-pidfile cleanup at startup was already correct via
claimPidFile(checksisProcessAlive(existingPid)and overwrites when dead) — no code change needed there; the issue was exclusivelystop. - Tests: 429 / 430 pass (1 skipped, same as 0.8.2). No schema snapshot change — these are behavioral fixes, not catalog changes.