diff --git a/afk-sleep-work.md b/afk-sleep-work.md index e78b852..4b12c02 100644 --- a/afk-sleep-work.md +++ b/afk-sleep-work.md @@ -33,8 +33,12 @@ The primary failure mode of unattended runs is wedging on a blocking command. > (see [`code-languages/bash.md` §3](skills-public/code-languages/bash.md)). > An unattended loop that never satisfies its exit condition hangs the session indefinitely. -- **Use tool-native blocking:** Flags like `--wait`, `--no-detach`, or task completion events over polling. -- **Enforce hard timeouts:** Wrap uncertain or long-running commands: `timeout 300s `. +- **Tool-native blocking & harness background tasks:** Prefer flags like `--wait`, `--no-detach`, or + dispatch long-running jobs as harness background tasks/daemons (with reactive completion notifications) + so the synchronous execution loop never gets wedged. +- **Enforce task-scaled timeouts:** Never run unbounded commands. Scale timeouts deliberately based on + estimated task duration (e.g. `timeout 30s` for quick checks, `timeout 180s` for tests, `timeout 15m` for + large builds) to prevent infinite hangs on deadlocks or network stalls. - **Mandatory non-interactive flags:** Supply `-y`, `--yes`, `--batch`, `--headless`, `CI=1`, or `DEBIAN_FRONTEND=noninteractive`. Never let a tool prompt `[y/N]` (see [`cli-tooling.md` §2](skills-public/cli-tooling.md)). - **Bounded retries with hypothesis variation:** Never rerun the same failing command unchanged. Cap retries @@ -77,7 +81,12 @@ When targets are shielded by splash launchers, web wrappers, or login dialogs: | :--- | :--- | :--- | | **1. Direct Bypass (Best)** | Run child binary directly | Inspect `ps aux` or wrapper configs while the launcher runs to extract child binary path and arguments, then execute it directly. | | **2. CLI / Config Flags** | Suppress launcher UI | Pass switches like `-nosplash`, `-nolauncher`, `-batch`, `--skip-intro`, or set `SkipLauncher=true` in `.ini`/`.json` configs. | -| **3. GUI Automation (Fallback)** | Drive the window | Identify window (`xdotool`, `ydotool`, or desktop MCP), capture screenshot/dump, send keys/clicks, and verify state change with a timeout guard. | +| **3. GUI Automation (Fallback)** | Drive the window | Target window non-interactively (`wmctrl -lp`, `xdotool search --name `, Wayland tree, or desktop MCP), capture screenshot/dump, send keys/clicks, and verify state change with a timeout guard. | + +> [!WARNING] +> **Beware mouse-click traps in window utilities:** Never run `xwininfo`, `xprop`, `xdotool selectwindow`, +> or ImageMagick `import` without explicit window IDs or query flags (`-root`, `-name`, `-id`). Without them, +> these tools pause and wait indefinitely for the user to click a window, hanging unattended execution instantly. ---