🙌 OpenHands: AI-Driven Development
feat: verify-openhands skill with control-openhands CLI and the full feature map (#17961)
Engel Nysted815e141409
diff --git a/.agents/skills/verify-openhands/SKILL.md b/.agents/skills/verify-openhands/SKILL.mdnew file mode 100644index 0000000000..1304c4607c--- /dev/null+++ b/.agents/skills/verify-openhands/SKILL.md@@ -0,0 +1,178 @@+---+name: verify-openhands+description: >+ This skill should be used to "verify OpenHands features", "test the Canvas UI+ like a user", "drive Agent Canvas", "check a UI change in the real app",+ "create or update the feature map", or "run the weekly feature audit". Ships+ control-openhands (launch, doctor, browser, LLM profiles, conversations,+ evidence, cleanup) and the maintained map of every user-facing feature.+triggers:+- /verify-openhands+- feature map+- verify feature+---++# Verify OpenHands through the real app++Prove what a user sees, not that a route rendered or CI passed. Three parts work+together:++1. **`control-openhands`** ([scripts/](scripts/)) is the lever. It launches this+ checkout as an isolated real stack (Agent Server, automation, static frontend,+ ingress), keeps one browser alive between commands, and turns every user step+ into a command you can rerun.+2. **The feature map** ([references/feature-map/](references/feature-map/README.md))+ lists every user-facing behavior with stable IDs, user entry points, exact+ `control-openhands` recipes, observable results and gotchas.+3. **Evidence**: screenshots, ARIA snapshots and a pass/fail/blocked/not-run+ ledger that survive cleanup.++Neither this skill nor the map authorizes external writes, paid models beyond+the budget you were given, or product fixes the user did not ask for.++## The CLI comes first++Put it on `PATH` and read its help before anything else:++```sh+export PATH="$PWD/.agents/skills/verify-openhands/scripts:$PATH"+control-openhands --help # then: control-openhands <command> --help+```++Requirements: Node >=24 (the launcher's engine), npm dependencies installed+(`npm ci --ignore-scripts`), `uv`/`uvx`, and a Chromium Playwright can launch+(set `CONTROL_OPENHANDS_BROWSER=/path/to/chrome` when the pinned browser is not+installed). Every command prints one JSON object; exit 0 ok, 1 action failed,+2 usage, 3 environment.++If a user path cannot be driven with the CLI, that is a **harness gap**: extend+`scripts/control-openhands.mjs` (keep it executable, document the verb in+`--help` and below), prove the new verb live, then write the recipe. Never work+around a gap with an untracked one-off script the next agent cannot rerun.+Other agents on the machine may be running the same script: edit a copy, run+`node --check` and the tests on it, then move it into place in one step.++## Launch → doctor → drive → evidence → cleanup++```sh+export OH_VERIFY_RUN=$(control-openhands launch --new --print-run) # builds if needed; isolated run+control-openhands doctor # read-only; must be ok before driving+control-openhands llm preset deepseek # deepseek-flash (active) + deepseek-pro; key from $DEEPSEEK_API_KEY or --api-key-file+control-openhands onboard --skip # consent + onboarding (walk it instead when F01 is under test)+control-openhands browser goto /settings/secrets+control-openhands browser testids # discover handles on the current page+control-openhands browser click 'testid=add-secret-button'+control-openhands browser screenshot --feature F14.create --name form+control-openhands evidence add --feature F14.create --result pass --entry "Settings > Secrets > Add" \+ --expected "add form" --actual "add form" --artifact evidence/F14.create/form.png+control-openhands stop # stops only this run; evidence stays+```++- **Which run.** Commands use `--run DIR` (anywhere on the line), else `$OH_VERIFY_RUN`, else the only live+ run. With several live runs they refuse to guess, so export `OH_VERIFY_RUN` in+ every shell command when other agents share the machine: an agent that drives+ someone else's run corrupts both evidence ledgers. For the same reason never+ `pkill -f` or `killall` by pattern; `control-openhands stop` ends only your run.+- **Launch** refuses to start when less than about 2 GB of memory is free: each+ run holds an Agent Server, automation, a static frontend and Chromium (about+ 1.5 GB together). Stop runs you are done with; several agents on one machine+ should each `launch --new`, export their own `OH_VERIFY_RUN`, and never touch+ another agent's run.+- **Launch** starts `bin/agent-canvas.mjs` from this checkout with a private+ `HOME`, state, session key and free port block, so it never touches a user's+ `~/.openhands` or another run. `launch --new` starts a second independent run+ (for a baseline, or to drive two backends); `--public` exercises the API-key+ login screen (`control-openhands login`). It still binds to 127.0.0.1; it only+ stops injecting the session key into the page. `--sdk-version`, `--sdk-ref` or+ `--sdk-path` (and the `--automation-*` equivalents) choose other backends;+ record them. Version variables exported in your shell are not forwarded.+ The block includes the VS Code editor port (`ports.vscode`) only when the+ checkout's launcher sets VS Code up (the port is reserved even if the+ agent-server has no editor binary and nothing listens there). Where that is opt-in (#17660), `--vscode`+ turns it on; where the editor is bundled (before #17660, or since #18048), it+ is always included and `--vscode` changes nothing.+- **Doctor** checks the launcher's process group, ports, served build revision,+ unauthenticated rejection, authenticated settings, Agent Server pin and the+ UI's minimum Agent Server version, automation health and a throwaway-tab UI+ probe. Run it first, after every surprising+ failure, and before blaming the product. A wedged UI on a healthy stack:+ capture evidence, `browser reload` or `goto /`, retry once.+- **Drive** through the real UI with `control-openhands browser ...`. Selectors are+ `testid=`, `role=button[name="Save"]`, `label=`, `text=`, chained with ` >> `.+ Use `browser testids` and `browser snapshot` to find handles; prefer scoped+ test IDs and accessible names over CSS. Failures return a hint and a+ screenshot path; read the screenshot before retrying. A click returns the URL+ from *before* any client-side navigation: use `click ... --expect-url '<regex>'`+ (or `browser wait-url`) after every navigating click, because many routes+ redirect (`/settings` → `/settings/agents`, `/customize` → `/mcp`).+- **Arrange, don't fake.** `llm`, `fixture` and `api ... --write` exist to set up+ preconditions (a configured profile, a git repo, a dummy secret). They never+ count as proof that the UI path works; the map says which steps are UI proof.+ Never intercept routes or add mock LLM responses to make a live check pass.+- **Essential pathways** are single commands so recipes can start from a known+ state: `onboard`, `llm preset|set`, `conversation start --prompt ... --wait`+ (add `--workspace qa-repo` to run it in a `fixture git-repo`),+ `conversation events <id>`, `workspace open`.+- **State control** reaches states a happy path never shows, without mocks:+ `browser reset` (fresh browser profile: first run again), `service stop+ automation|agent-server` (backend-down UI), `restart` (same state after a+ backend restart: persistence and reconnection) and `restart --rotate-key`+ (stale session key). `restart` keeps the browser on its page. While a service+ is stopped, a reload replaces the page with the backend-unavailable screen, so+ drive backend-down states on the page that was already loaded. `browser+ network`, `browser toasts` and `browser media` observe requests by origin,+ toasts and sound without changing anything. Check `--help` before calling a+ state unreachable: most "can't be driven" claims predate a verb.+- **Evidence** goes under `<run>/evidence/<feature-id>/` and the append-only+ ledger `<run>/evidence/ledger.jsonl`. Nothing is overwritten: a repeated+ screenshot name is saved as `<name>-2.png`, so cite the path the command+ prints; `evidence report` renders the table from+ [the report contract](references/report.md). Keys, logs, browser profile and+ downloads stay in `<run>/private/`. Evidence is not automatically public:+ review every image before publishing it. The CLI masks password fields in+ `snapshot`, `value` and `testids`; a screenshot of a visible key field is+ still a leak.+- **Cleanup** with `control-openhands stop` (add `--purge-private` to delete keys+ and state once you have checked the evidence). It only signals the process+ group it launched and verifies the ports closed. Delete run-owned fixtures+ through the UI when deletion is the path under test.++## LLM budget++Features that start a real agent with automation or debugging skills (for+example "Debug with OpenHands") can act on other fixtures by name: stop those+conversations when their recipe is done.++Use `deepseek-flash` for everything that needs a model; switch to `deepseek-pro`+only for checks that need a second profile or a stronger model. Keep prompts+small and confined to the run workspace. Without a key, run every credential-free+recipe and record model-dependent ones as `blocked` with the missing+prerequisite; never substitute a mock and call it a pass.++## Choose the job++- **Verify a change or a PR**: map the changed paths to feature IDs (the map's+ `Source:` lines help), drive every entry point those features list at desktop+ and phone viewports, and report with [the report contract](references/report.md).+- **Create or extend the map**: follow [references/mapping.md](references/mapping.md).+ It teaches how to discover features, write entries against the CLI and prove+ each one live. `control-openhands map coverage` measures what is still unmapped.+- **Maintain the map (periodic or weekly)**: follow+ [references/maintenance.md](references/maintenance.md): index hygiene, a source+ wave, one live pass over every feature, PR-intent reconciliation for the week's+ changes, and at most one PR of proven corrections.++## Triage what you find++- **Map drift**: the map describes something the app no longer does by design.+ Fix the entry with current source and live evidence.+- **Harness gap**: the app works but the CLI cannot drive it. Fix the CLI, re-drive.+- **Product bug**: the app is broken. Keep the evidence, search existing issues,+ report it separately (right repository: Canvas UI here, Agent Server/SDK in+ `OpenHands/software-agent-sdk`, scheduling/dispatch in `OpenHands/automation`).+ Never rewrite an expected result to bless broken behavior.+- **Blocked**: name the missing prerequisite (account, entitlement, OS, binary)+ and the route you attempted. Unreachable is never a pass.++See [references/adaptation.md](references/adaptation.md) for where these ideas+come from and what was deliberately left out.diff --git a/.agents/skills/verify-openhands/references/adaptation.md b/.agents/skills/verify-openhands/references/adaptation.mdnew file mode 100644index 0000000000..1d80010eb9--- /dev/null+++ b/.agents/skills/verify-openhands/references/adaptation.md@@ -0,0 +1,49 @@+# Where this workflow comes from++This is an independently written adaptation of ideas from poteto's MIT-licensed+[pstack](https://github.com/cursor/plugins/tree/main/pstack) and the+[cursor-team-kit](https://github.com/cursor/plugins/tree/main/cursor-team-kit)+control skills:++- [create-verification-skill](https://github.com/cursor/plugins/blob/main/pstack/skills/create-verification-skill/SKILL.md):+ interview the repo, then generate launch / doctor / drive / evidence / cleanup+ and a feature map, and prove one recipe end to end before handing it over.+- [The feature-map example](https://github.com/cursor/plugins/tree/main/pstack/skills/create-verification-skill/references/feature-map-example):+ one file per feature with four sections, stable IDs, and every step written+ against a `control-<app>` CLI so it is a literal, rerunnable command.+- [maintain-verification-skill](https://github.com/cursor/plugins/blob/main/pstack/skills/maintain-verification-skill/SKILL.md):+ index hygiene, a parallel source wave, one serial live pass, and triage into+ map drift, harness gaps and product bugs.+- [Build the Lever](https://github.com/cursor/plugins/blob/main/pstack/skills/principle-build-the-lever/SKILL.md)+ and [control-ui](https://github.com/cursor/plugins/blob/main/cursor-team-kit/skills/control-ui/SKILL.md):+ build the tool that drives and proves the work; one structural action per+ step, fresh state before each assertion, stable handles over coordinates.+- [cli-for-agents](https://github.com/cursor/plugins/blob/main/cli-for-agent/skills/cli-for-agents/SKILL.md):+ non-interactive flags, layered `--help` with examples, actionable errors,+ idempotent commands, machine-readable output.++OpenHands-specific decisions:++- `control-openhands` wraps the repository's own production launcher+ (`bin/agent-canvas.mjs`) instead of a new stack, and isolates each run with a+ private `HOME`, state directory, session key and port block.+- A long-lived browser daemon keeps one page between commands and records page+ errors, console errors and failed requests continuously, so short CLI calls do+ not lose the transitions between them.+- LLM profiles are configured from an environment key (`llm preset deepseek`),+ validated with a one-token completion first, so a CI agent can run+ model-backed recipes without typing secrets into argv or the UI log.+- Weekly maintenance adds what OpenHands needs beyond pstack: a frozen+ BASE/TARGET, a PR-intent ledger, and intent kept separate from runtime results,+ with multi-repository attribution (Canvas, Agent Server/SDK, automation).+- Not imported: Cursor plugin configuration, model routing,+ `disable-model-invocation`, autonomous shipping or merge authority, and the+ zero-pixel-difference rule (deliberate weekly product changes are expected).++These are contributor workflows for this repository under `.agents/skills`+([AgentSkills format](https://docs.openhands.dev/sdk/guides/skill)), not public+catalog skills from `OpenHands/extensions`. They complement the public+`qa-changes` skill (a verdict on one PR) and [the release testing+matrix](../../../../docs/TESTING_MATRIX.md) (installer × OS × agent), and do not+replace either. The first version of this map was seeded from the September 2026+UI audit in OpenHands/OpenHands#17435 and OpenHands/OpenHands#17569.diff --git a/.agents/skills/verify-openhands/references/feature-map/F01-first-run-and-sign-in.md b/.agents/skills/verify-openhands/references/feature-map/F01-first-run-and-sign-in.mdnew file mode 100644index 0000000000..ca440a93c7--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F01-first-run-and-sign-in.md@@ -0,0 +1,107 @@+# F01 — First run, onboarding and sign-in++What a user sees before the normal app shell. A browser that has never finished+or skipped onboarding gets a full-screen onboarding modal on every route: choose+an agent, set up the LLM (or ACP credentials), then say hello, which starts the+first conversation. In public mode the flow starts with an "Add a backend" step+that asks for the server's API key, and a browser with no stored key gets a+full-screen API-key screen instead of the app. A one-time telemetry consent+modal appears for each local backend. Unknown routes render an in-app "Page not+found" page inside the app shell, and the tab title follows the open+conversation.++Source: `src/root.tsx`, `src/components/features/onboarding/`, `src/components/features/analytics/telemetry-consent-banner.tsx`, `src/components/features/backends/api-key-entry-screen.tsx`, `src/routes/root-layout.tsx`, `src/routes/not-found.tsx`, `src/hooks/use-app-title.ts`.++## Sub-features++- `F01.first-run-gate`: with no `openhands-onboarded` flag in localStorage, any URL (including `/conversations`) shows only `first-run-onboarding-screen` with the onboarding modal. There is no sidebar. Finishing or skipping sets the flag, and the app stays revealed after a reload.+- `F01.telemetry-consent`: on a connected local backend whose `user_consents_to_analytics` is `null`, an elevated "Help improve OpenHands" modal names the backend and host. It has a checked-by-default "Send anonymous usage data" box and "Confirm preferences". Escape does not dismiss it. The choice is saved to backend settings, and the modal does not return after a reload.+- `F01.onboarding-modal`: a segmented progress bar (3 steps, or 4 with the backend step) over a sliding rail. Neither Escape nor a click on the backdrop dismisses it. "Skip for now" shows on every step except the last, and Back/Next move between steps.+- `F01.onboarding-backend-step`: when no reachable backend exists (public mode), step 0 "Add a backend" prefills the name `Local` and the page origin as host. Next stays disabled until an API key is typed. A wrong key shows "Could not connect to <host>" / "Invalid API key" inline. The right key saves the backend, and the flow collapses to 3 steps on "Choose your agent" with no Back button. The first paint must not raise an error toast.+- `F01.onboarding-choose-agent`: radio tiles for OpenHands (preselected), Claude Code, Codex and Gemini CLI. Next saves the agent kind with a "Settings saved" toast.+- `F01.onboarding-setup-llm`: the embedded LLM form is prefilled with `openai/gpt-5.6-sol`. Typing a custom model and key then Next saves them. On a local backend it also creates and activates an LLM profile named after the model (`deepseek/deepseek-flash` → `deepseek-flash`).+- `F01.onboarding-acp-secrets`: choosing an ACP agent swaps the LLM step for "Add your API keys" with that provider's fields. When the host CLI is already logged in, a green "already signed in" banner makes them optional. Back returns to the agent step.+- `F01.onboarding-say-hello`: the last step has a prefilled message. An empty message disables send. Enter or the send button creates a conversation, navigates to `/conversations/<id>` and completes onboarding, and the agent replies. A recommended-automations list sits under an "Or" separator, and a "Skip Getting Started checklist" box sits below the modal.+- `F01.onboarding-hello-close`: the last step has Back and Close instead of "Skip for now". Close dismisses the modal without creating a conversation, sets the `openhands-onboarded` flag and leaves the app shell on `/`.+- `F01.onboarding-recommended-automation`: picking a card under "Start from a proven workflow" on the last step completes onboarding too. A card with its own setup form (for example "Daily news digest") navigates to `/automations/new/<id>` and opens that form. Nothing is created until the form is submitted.+- `F01.onboarding-skip-checklist`: the "Skip Getting Started checklist" box under the last step hides the sidebar **Getting started** card (F02) once the app is revealed. It is the same per-browser setting as the Settings → Application switch, and it is saved as soon as you tick it, preview mode included.+- `F01.onboarding-skip`: "Skip for now" closes the modal and sets the flag. In public mode, skipping before a key is stored lands on the API-key screen; skipping after the backend step lands in the app.+- `F01.onboarding-preview`: `?previewOnboardingStep=0..3` on any route opens the modal (`data-preview="true"`) on that phase, even after onboarding. Values outside 0-3 are ignored. Skip and Close do nothing, so leave by navigating to a URL without the parameter.+- `F01.onboarding-phone`: every onboarding step fits a 390 px viewport without horizontal overflow.+- `F01.api-key-entry`: in public mode with no usable key (onboarding skipped, the last backend removed, or a stored key the server now rejects), a full-screen "Add a backend" card appears. The host is read-only and set to the origin, and Connect stays disabled until the name and key are filled. A wrong key shows "Invalid API key. Please check the key and try again." The right key opens the app shell, which survives a reload, and the consent modal then names the new backend.+- `F01.onboarding-cloud-login`: the backend step's "OpenHands Cloud" column has "Connect to OpenHands" (device-flow login) and an "Advanced" toggle. The toggle reveals a Cloud Host field (placeholder `https://app.all-hands.dev`) for self-hosted Cloud deployments. The login itself is blocked: it needs an OpenHands Cloud account.+- `F01.route-error-boundary`: an unknown URL renders a "Page not found" page inside the app shell, with the sidebar and a **Home** link back to `/`, and logs no page errors.+- `F01.document-title`: the tab title is `OpenHands`. On a conversation it is `<status emoji> <conversation title> | OpenHands`.+- `F01.bootstrap-loading`: a centered spinner card shows while `/server_info` loads (transient, not-run).+- `F01.locked-cloud-first-run`: on a canvas locked to an OpenHands Cloud host, first run shows only the Cloud login (Add backend) without a progress bar or close button (blocked).+- `F01.cookie-auth-redirect`: OHE cookie-auth deployments probe the main-app session behind a spinner and redirect to its `/login` when it is missing (blocked).++## How to get to it (user POV)++- First run: open any URL of the app in a browser profile that has never onboarded. Every `control-openhands launch --new` starts with a fresh browser profile, and `control-openhands browser reset` gives the same run a fresh one again. Backend-side state (consent answer, LLM profile, agent kind) stays.+- Public mode: `control-openhands launch --new --public` serves the UI without the injected key, so step 0 is "Add a backend". The API-key screen appears after skipping onboarding, after removing the last backend under backend selector → Manage backends (see F25), or when the server's key changes under a stored one.+- Telemetry consent: appears by itself over onboarding or the app. It is changed later in Settings → Application (see F16).+- Onboarding preview: direct URL with `?previewOnboardingStep=N`, for example `/?previewOnboardingStep=3` or `/settings/app?previewOnboardingStep=3`.+- Last onboarding step: Close, a recommended-automation card, or the "Skip Getting Started checklist" box below the modal.+- Not-found page: any unknown direct URL, such as `/this-route-does-not-exist`. Its **Home** button returns to `/`.+- There is no command-menu entry or keyboard shortcut for onboarding.++## Driving it with control-openhands++Preconditions:++- A fresh run you launched yourself: `control-openhands launch --new` (local) or `control-openhands launch --new --public`, then `export OH_VERIFY_RUN=<run from the launch JSON>` and `control-openhands doctor`. Do **not** run `control-openhands onboard --skip`: it consumes the first-run state this family tests.+- The model-backed say-hello check needs a DeepSeek key in `DEEPSEEK_API_KEY`. It is typed into the onboarding form with `--value-env`, which replaces `llm preset deepseek` here.+- Each fresh browser profile walks first run once; `control-openhands browser reset` starts another first run on the same stack. Local and public mode still need separate runs (`launch --new` and `launch --new --public`): the local walk, public run A (backend step walked) and public run B (onboarding skipped). Stop each one with `control-openhands stop` when done.+- Desktop viewport unless stated.++Local run (`launch --new`):++- **First-run gate (`F01.first-run-gate`).** Run `control-openhands browser goto /conversations` and `control-openhands browser testids`. The list starts with `first-run-onboarding-screen`, `telemetry-consent-form` and `onboarding-modal`; `root-layout` is absent. Run `control-openhands browser screenshot --feature F01.first-run-gate --name fresh`. The screenshot shows the consent modal over "Choose your agent".+- **Consent (`F01.telemetry-consent`).** Run `control-openhands browser snapshot 'testid=telemetry-consent-form'`. It reads `This preference is saved for the local backend “Local” at http://127.0.0.1:<port>.` and the checkbox is `[checked]`. Run `control-openhands browser press Escape` and `control-openhands browser count 'testid=telemetry-consent-form'`; the count stays `1`. Run `control-openhands browser uncheck 'testid=telemetry-consent-form >> role=checkbox'`, `control-openhands browser click 'testid=confirm-telemetry-preferences'`, `control-openhands browser wait 'testid=telemetry-consent-form' --state detached`, then `control-openhands api GET /api/settings`. It shows `"user_consents_to_analytics": false`. Run `control-openhands browser reload` and `control-openhands browser count 'testid=telemetry-consent-form'`; the count is `0`.+- **Modal shell (`F01.onboarding-modal`).** Run `control-openhands browser press Escape`, `control-openhands browser count 'testid=onboarding-modal'` (`1`) and `control-openhands browser attr 'testid=onboarding-modal' data-current-step` (`0`). Run `control-openhands browser mouse-click 40 40` on the bare backdrop; the count stays `1` and the step is unchanged. `onboarding-progress-step-0..2` exist and `-3` does not, because the backend is healthy.+- **Choose agent (`F01.onboarding-choose-agent`).** Run `control-openhands browser attr 'testid=onboarding-agent-option-openhands' aria-checked` (`true`) and `control-openhands browser count 'testid=onboarding-agent-back'` (`0`). Then run `control-openhands browser click 'testid=onboarding-agent-option-codex'` and `control-openhands browser attr 'testid=onboarding-agent-option-codex' aria-checked` (`true`), and switch back with `control-openhands browser click 'testid=onboarding-agent-option-openhands'`. Run `control-openhands browser click 'testid=onboarding-agent-next'` and `control-openhands browser wait-text 'Settings saved'`; `data-current-step` becomes `1`. Run `control-openhands browser click 'testid=onboarding-llm-back'`; `data-current-step` is `0`. Click `testid=onboarding-agent-next` again.+- **LLM step (`F01.onboarding-setup-llm`).** Run `control-openhands browser snapshot 'testid=onboarding-step-setup-llm'`. It shows `Set up your LLM` and Basic tab comboboxes `OpenAI` / `gpt-5.6-sol`. Run `control-openhands browser click 'testid=onboarding-step-setup-llm >> testid=sdk-section-advanced-toggle'` and `control-openhands browser value 'testid=onboarding-step-setup-llm >> testid=llm-custom-model-input'` (`openai/gpt-5.6-sol`). Then run `control-openhands browser fill 'testid=onboarding-step-setup-llm >> testid=llm-custom-model-input' deepseek/deepseek-flash`, `control-openhands browser fill 'testid=onboarding-step-setup-llm >> testid=llm-api-key-input' --value-env DEEPSEEK_API_KEY` and `control-openhands browser click 'testid=onboarding-llm-next'`. Wait with `control-openhands browser wait '[data-testid=onboarding-modal][data-current-step="2"]'`. Second view: `control-openhands llm show` lists profile `deepseek-flash` (`deepseek/deepseek-flash`, `api_key_set: true`) as `active_profile`.+- **Say hello (`F01.onboarding-say-hello`).** Run `control-openhands browser count 'testid=onboarding-skip'` (`0` on the last step), `control-openhands browser fill 'testid=onboarding-hello-input' ''` and `control-openhands browser enabled 'testid=onboarding-hello-input-form >> testid=submit-button'` (`false`). Then run `control-openhands browser fill 'testid=onboarding-hello-input' 'Reply with only the word hello. Do not run any tools.'` (`enabled` turns `true`), `control-openhands browser press Enter --selector 'testid=onboarding-hello-input'` and `control-openhands browser wait-url '/conversations/[0-9a-f-]+'`. Take `<id>` from `control-openhands browser url`. Run `control-openhands conversation wait <id> --timeout 180` and `control-openhands conversation events <id> --kinds MessageEvent`. The agent message is `hello`, and `control-openhands browser count 'testid=onboarding-modal'` is `0`. `control-openhands browser eval "localStorage.getItem('openhands-onboarded')"` returns `"1"`. After `control-openhands browser reload` and `control-openhands browser goto /`, `testid=first-run-onboarding-screen` and `testid=onboarding-modal` both count `0`.+- **Tab title (`F01.document-title`).** On `/` run `control-openhands browser url`; `title` is `OpenHands`. On `/conversations/<id>` (after a reload, once the title is generated) the title is `<emoji> <conversation title> | OpenHands`, for example `✅ … | OpenHands` for a finished conversation.+- **Preview (`F01.onboarding-preview`).** Run `control-openhands browser goto '/?previewOnboardingStep=3'`, then `control-openhands browser attr 'testid=onboarding-modal' data-preview` (`true`) and `control-openhands browser count 'testid=onboarding-step-say-hello'` (`1`). Step `2` shows the LLM slide. Steps `0` and `1` both show "Choose your agent" when the backend is healthy. `/?previewOnboardingStep=9` renders no modal. `control-openhands browser goto '/settings/app?previewOnboardingStep=3'` works too. Run `control-openhands browser goto '/?previewOnboardingStep=1'` and `control-openhands browser click 'testid=onboarding-skip'`; the modal stays (`count` `1`). `control-openhands browser goto /` shows no modal.+- **Skip checklist box (`F01.onboarding-skip-checklist`).** Run `control-openhands browser goto /conversations` and `control-openhands browser count 'testid=sidebar-onboarding-checklist'` (`1`). Run `control-openhands browser goto '/?previewOnboardingStep=3'`, then `control-openhands browser click 'text=Skip Getting Started checklist'`. `control-openhands browser eval "document.querySelector('[data-testid=onboarding-skip-getting-started-checklist]').checked"` is `true`. Run `control-openhands browser goto /conversations` and `control-openhands browser reload`; the checklist count is `0`. On `/settings/app`, `control-openhands browser eval "document.querySelector('[data-testid=show-getting-started-checklist-switch]').checked"` is `false`. Restore it: go back to `/?previewOnboardingStep=3`, where the box now reads `true`, click the same text again, and the checklist count on `/conversations` is `1`.+- **Phone (`F01.onboarding-phone`).** Run `control-openhands browser viewport phone`. Then for N in 1, 2 and 3 run `control-openhands browser goto '/?previewOnboardingStep=N'`, `control-openhands browser bbox 'testid=onboarding-modal'` and `control-openhands browser screenshot --feature F01.onboarding-phone --name step-N`. The modal is 351 px wide with `insideViewport` `true` and `pageHorizontalOverflow` `false`, and Back/Next or Back/Close are visible. Return with `control-openhands browser viewport desktop`.+- **Error page (`F01.route-error-boundary`).** Run `control-openhands browser errors --clear`, `control-openhands browser goto /this-route-does-not-exist` and `control-openhands browser snapshot 'testid=not-found-screen'`. It shows `heading "Page not found"`, the paragraph `This address does not match any page. Check the URL, or go back to the home page.` and `link "Home"` (`/url: /`). `control-openhands browser count 'aside[data-collapsed]'` is `1`: the sidebar stays. `control-openhands browser screenshot --feature F01.route-error-boundary --name not-found` shows the message and the Home button centered beside the sidebar. `control-openhands browser errors --app-only` reports `pageErrors` `0` and `appErrors` `0`. Run `control-openhands browser click 'testid=not-found-home-link' --expect-url '/$'`; `control-openhands browser count 'testid=home-screen'` is `1`.+- **Clean up.** Delete the hello conversation from its header menu: `control-openhands browser goto /conversations/<id>` (the hello conversation's `<id>` from Say hello; the Error page bullet left `/`), `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'`, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=delete-button'`, `control-openhands browser click 'role=button[name="Confirm Delete"]'`. `control-openhands conversation list` then shows `count` `0`.++Public run A (`launch --new --public`), backend step walked:++- **Backend step (`F01.onboarding-backend-step`).** Run `control-openhands browser goto /`, `sleep 12` (gives a late toast time to appear), `control-openhands browser toasts --history`, `control-openhands browser screenshot --feature F01.onboarding-backend-step --name fresh` and `control-openhands browser snapshot 'testid=onboarding-step-check-backend'`. The toast history is `[]`, and the screenshot shows no toast. The snapshot shows `Add a backend`, name `Local`, host `http://127.0.0.1:<port>`, Type `Local` checked, `button "Next" [disabled]`, and an "OpenHands Cloud" column with "Connect to OpenHands". Run `control-openhands browser fill 'testid=onboarding-backend-api-key' qa-wrong-key`, `control-openhands browser click 'testid=onboarding-backend-next'` and `control-openhands browser text 'testid=onboarding-backend-error'`. It reads `Could not connect to http://127.0.0.1:<port>` / `Invalid API key`, and `data-current-step` stays `0`. Run `control-openhands browser fill 'testid=onboarding-backend-api-key' --value-file "$OH_VERIFY_RUN/private/session-key"`, `control-openhands browser click 'testid=onboarding-backend-next'` and `control-openhands browser wait 'testid=telemetry-consent-form'`. The modal is on "Choose your agent" with `data-current-step` `0`, `testid=onboarding-progress-step-3` and `testid=onboarding-agent-back` both count `0`, and the consent form names `“Local”`. Answer it with `control-openhands browser click 'testid=confirm-telemetry-preferences'`.+- **ACP credentials (`F01.onboarding-acp-secrets`).** Run `control-openhands browser click 'testid=onboarding-agent-option-claude-code'`, `control-openhands browser click 'testid=onboarding-agent-next'` and `control-openhands browser wait-text 'Settings saved'`. Then run `control-openhands browser snapshot 'testid=onboarding-step-setup-acp-secrets'`. It shows `Add your API keys` with `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_API_KEY` and `ANTHROPIC_BASE_URL`, and `control-openhands api GET /api/settings` shows `"agent_kind": "acp"`. Run `control-openhands browser click 'testid=onboarding-acp-secrets-back'`, `control-openhands browser click 'testid=onboarding-agent-option-openhands'` and `control-openhands browser click 'testid=onboarding-agent-next'`. `testid=onboarding-step-setup-llm` is shown and `agent_kind` is back to `openhands`.+- **Skip into the app (`F01.onboarding-skip`).** Run `control-openhands browser click 'testid=onboarding-skip'`, `control-openhands browser wait 'testid=root-layout'`, `control-openhands browser reload`, `control-openhands browser count 'testid=onboarding-modal'` (`0`) and `control-openhands browser count 'testid=api-key-entry-screen'` (`0`).+- **Last backend removed (`F01.api-key-entry`).** Run `control-openhands browser click 'testid=backend-selector'`, `control-openhands browser click 'testid=manage-backends-menu-item'`, `control-openhands browser click 'testid=manage-backends-remove-Local'` and `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`. `control-openhands browser wait 'testid=api-key-entry-screen'` succeeds. Restore with the Connect recipe below.++Public run B (`launch --new --public`), onboarding skipped:++- **Skip to API-key screen (`F01.onboarding-skip`, `F01.api-key-entry`).** Run `control-openhands browser goto /`, `control-openhands browser click 'testid=onboarding-skip'` and `control-openhands browser wait 'testid=api-key-entry-screen'`. After `sleep 12`, `control-openhands browser toasts --history` is `[]`: the screen raises no error toast. Run `control-openhands browser reload`, `control-openhands browser wait 'testid=api-key-entry-screen'`, `sleep 12` and `control-openhands browser toasts --history` again: still `[]` when the API-key screen is the first paint. Run `control-openhands browser value 'testid=api-key-entry-host'` (the origin; the field is disabled) and `control-openhands browser enabled 'testid=api-key-entry-submit'` (`false`). Fill only the key with `control-openhands browser fill 'testid=api-key-entry-api-key' qa-wrong-key`; `enabled` is still `false` because Host Name is required. Run `control-openhands browser fill 'testid=api-key-entry-name' 'QA Public'` (`enabled` turns `true`), `control-openhands browser click 'testid=api-key-entry-submit'` and `control-openhands browser text 'testid=api-key-entry-status'`. It reads `Invalid API key. Please check the key and try again.`, the screen stays, and `control-openhands browser screenshot --feature F01.api-key-entry --name wrong-key` shows the red line above Connect. While the screen is still up, run `control-openhands browser viewport phone` and `control-openhands browser bbox 'testid=api-key-entry-form'`. It gives `insideViewport` `true` and `pageHorizontalOverflow` `false`. Return with `control-openhands browser viewport desktop`.+- **Connect (`F01.api-key-entry`).** Run `control-openhands browser fill 'testid=api-key-entry-name' 'QA Public'`, `control-openhands browser fill 'testid=api-key-entry-api-key' --value-file "$OH_VERIFY_RUN/private/session-key"`, `control-openhands browser click 'testid=api-key-entry-submit'` and `control-openhands browser wait 'testid=api-key-entry-screen' --state detached`. `testid=root-layout` is shown, the consent form names `“QA Public”`, and `control-openhands browser snapshot 'testid=backend-selector'` shows `combobox "QA Public"`. After `control-openhands browser reload`, `testid=api-key-entry-screen` counts `0` and `testid=root-layout` counts `1`.+- **Stale key re-prompt (`F01.api-key-entry`).** Answer consent if it is open (`control-openhands browser click 'testid=confirm-telemetry-preferences'`). Run `control-openhands restart --rotate-key` (`rotatedKey` `true`), then `control-openhands browser reload` and `control-openhands browser wait 'testid=api-key-entry-screen'`; `testid=root-layout` counts `0`. Connect again as above with the new `$OH_VERIFY_RUN/private/session-key`. After a reload, `testid=root-layout` counts `1`, and `control-openhands browser eval "JSON.parse(localStorage.getItem('openhands-backends')).length"` is `1`, so no duplicate backend is added.+- **Close on the last step (`F01.onboarding-hello-close`).** Run `control-openhands browser reset` and `control-openhands browser goto /`. Walk to the last step: `control-openhands browser fill 'testid=onboarding-backend-api-key' --value-file "$OH_VERIFY_RUN/private/session-key"`, `control-openhands browser click 'testid=onboarding-backend-next'`, `control-openhands browser wait 'testid=onboarding-step-choose-agent'` (consent does not return: the backend already has an answer), `control-openhands browser click 'testid=onboarding-agent-next'` and `control-openhands browser wait '[data-testid=onboarding-modal][data-current-step="1"]'`. Then fill the key with `control-openhands browser fill 'testid=onboarding-step-setup-llm >> testid=llm-api-key-input' --value-env DEEPSEEK_API_KEY`, open `testid=sdk-section-advanced-toggle` and fill `llm-custom-model-input` with `deepseek/deepseek-flash` as in the LLM step. Run `control-openhands browser click 'testid=onboarding-llm-next'` and `control-openhands browser wait '[data-testid=onboarding-modal][data-current-step="2"]'`. Check `control-openhands conversation list` (`count` `0`), then run `control-openhands browser click 'testid=onboarding-hello-close'` and `control-openhands browser wait 'testid=onboarding-modal' --state detached`. `testid=root-layout` counts `1`, the URL is `/` and `localStorage.getItem('openhands-onboarded')` is `"1"`. `conversation list` still shows `count` `0`, and after `browser reload` the modal count is `0`.+- **Recommended automation (`F01.onboarding-recommended-automation`).** Run `control-openhands browser reset`, `control-openhands browser goto /`, and walk to the last step as above (the LLM step's Next works without retyping the key once the profile is saved). Run `control-openhands browser click 'testid=recommended-automation-card-news-digest' --expect-url '/automations/new/news-digest(\?|$)'`. `testid=onboarding-modal` counts `0`, `openhands-onboarded` is `"1"`, and the "Daily news digest" setup form (`testid=setup-dialog`) is open. Leave without creating anything: `control-openhands browser click 'testid=setup-dialog-close'` and `control-openhands browser wait 'testid=setup-dialog' --state detached` (the URL becomes `/`). `control-openhands api GET /api/automation/v1` shows `"total": 0`.+- **Cloud login column (`F01.onboarding-cloud-login`).** Run `control-openhands browser reset`, `control-openhands browser goto /` and `control-openhands browser click 'testid=onboarding-backend-advanced-toggle'`. `browser attr 'testid=onboarding-backend-advanced-toggle' aria-expanded` is `true`, and `browser attr 'testid=onboarding-backend-cloud-host' placeholder` is `https://app.all-hands.dev`. `browser text 'testid=onboarding-backend-advanced-panel'` mentions self-hosted Cloud deployments. Do not click `testid=onboarding-backend-login-button`: the device-flow login is blocked without an OpenHands Cloud account.++Not reachable locally:++- **Locked Cloud first run (`F01.locked-cloud-first-run`).** Blocked: needs a build locked to a Cloud host (`VITE_LOCK_TO_CLOUD` or `static-server --lock-to-cloud`) and an OpenHands Cloud account. `launch` has no such flag.+- **Cookie-auth redirect (`F01.cookie-auth-redirect`).** Blocked: needs an OHE cookie-auth deployment.+- **Bootstrap spinner (`F01.bootstrap-loading`).** Not-run: it lasts under a second on a healthy stack, and slowing `/server_info` would mean intercepting requests.++## Gotchas++- Use a fresh run or `browser reset` for every first-run check, and never `onboard --skip` first. The browser profile lives in `<run>/private/browser-profile`. `browser reset` clears only the browser, so the server keeps the consent answer (the consent modal does not return), the LLM profile and the agent kind.+- `control-openhands login` passes both key prompts: the onboarding backend step, and the API-key screen, where it names the backend `Local` when Host Name is empty (after Skip and after `restart --rotate-key`, with no duplicate backend). Use it when the screen is only in the way. To check the screen itself (the disabled Connect, the wrong-key line, a chosen name), use the explicit fills above.+- Inactive onboarding slides stay mounted and are translated off-screen. Plain `browser testids` lists only the active slide, but `count` and `wait` still find handles on the others. Assert the active step with `data-current-step`, for example `browser wait '[data-testid=onboarding-modal][data-current-step="2"]'`. The `testid=` selector cannot carry attribute filters.+- Slide indices renumber. After the public backend step succeeds, "Choose your agent" becomes index `0` and has no Back. `previewOnboardingStep` counts phases with the backend step included, so `0` and `1` look identical on a healthy backend.+- The consent modal (z-70) sits over the onboarding modal, and clicks at the screen center land on agent tiles once it closes. A forced click on `first-run-onboarding-screen` selected Codex. Check backdrop non-dismissal with `browser mouse-click 40 40`, a corner outside the modal.+- The say-hello default message ("Create a basic webpage…") makes the agent work for a while. Replace it with a tiny prompt to keep model cost down.+- The tab title prefixes a status emoji to the stored title. A generated title that already starts with an emoji therefore shows twice (`✅ ✅ Reply hello without tools | OpenHands`). Right after launch the title is `Conversation <id prefix>` until a reload picks up the generated one.+- Right after Next, the ACP step reads "Checking for an existing Claude Code login…" with Next disabled. Wait for `testid=onboarding-acp-auth-detected` before reading the banner. The "already signed in" banner depends on the host's CLI login. On a clean CI machine the fields become required, and Next is blocked until they are filled.+- Choosing an ACP agent saves `agent_kind: acp` immediately. Re-choose OpenHands before leaving, or later conversations in the run use the ACP agent.+- In preview mode, Skip and Close are inert. The LLM slide shows `gpt-5.6-sol` even when another model is saved, so do not read it as data loss.+- `browser toasts --history` lists every status or alert text (toasts and alert banners) seen since the page loaded, including success toasts and progress lines such as `Checking your backend connection…`. Read it on a page that has just loaded (or reloaded) to check that no error toast appeared. A page with a standing banner never reads `[]`: the app shell of a backend with no LLM lists the `Your LLM isn't set up yet` alert.diff --git a/.agents/skills/verify-openhands/references/feature-map/F02-app-shell.md b/.agents/skills/verify-openhands/references/feature-map/F02-app-shell.mdnew file mode 100644index 0000000000..167d2fdf25--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F02-app-shell.md@@ -0,0 +1,107 @@+# F02 — App shell, sidebar and command menu++Every page inside the root layout shares one shell. On desktop it is a left rail+with the logo, **Search commands**, **New Chat**, **Customize**, **Automate**+(when the automation interface is present), the conversation list, the+**Getting started** checklist, an update tile (only when a newer release exists)+and the backend selector with a settings gear. The rail collapses to icons and+remembers that choice. Below 768 px the rail turns into a drawer that opens from+a top bar or the chat header. A user can pin Customize or Automate as the page+`/` opens. A Ctrl/Cmd+K command menu searches pages, settings and actions.+Failed requests show error toasts.++Source: `src/components/features/sidebar/`, `src/components/features/command-menu/`, `src/stores/sidebar-store.ts`, `src/stores/command-menu-store.ts`, `src/hooks/use-pinned-home-route.ts`, `src/routes/index-home.tsx`, `src/utils/mobile-section-nav.ts`, `src/components/features/settings/agent-canvas-version-tile.tsx`, `src/components/features/alerts/alert-banner.tsx`, `src/utils/custom-toast-handlers.ts`.++## Sub-features++- `F02.nav-links`: the logo and **New Chat** open `/conversations`. **Customize** opens `/customize`, which redirects to `/mcp` on desktop, and stays highlighted and marked `aria-current="page"` on `/skills`, `/plugins`, `/apps` and `/mcp`. **Automate** opens `/automations`. Canvas extension pages add their own rows (`sidebar-canvas-extension-<ext>-<id>`).+- `F02.pin-as-home`: hovering Customize or Automate reveals a pin. Pinning makes `/` redirect to that page, pinning the other one moves the pin, and unpinning restores the default home. The pin is stored per backend and org.+- `F02.sidebar-collapse`: the chevron collapses the rail to a 60 px icon rail with hover tooltips, a Settings icon and a backend icon with a status dot that opens a backend popover. The checklist is hidden while collapsed. The state survives a reload. To expand, click the chevron that appears when you hover the logo, or click empty rail space.+- `F02.settings-link`: the gear next to the backend selector, and the collapsed Settings icon, open `/settings` in the same tab for a local backend. On desktop that redirects to `/settings/agents`.+- `F02.conversation-list`: the expanded rail embeds the conversation list (`conversation-panel`). The list itself belongs to the conversations family.+- `F02.command-menu-open-close`: Control+k, Meta+k and the sidebar **Search commands** row (also the search icon on the collapsed rail) open a modal `Command menu` dialog with the input focused. Escape or the backdrop closes it, and the query is cleared on close. Escape returns focus to the element that had it before the menu opened (the **Search commands** row when it opened the menu). The row and the menu header show the shortcut as `Ctrl+K` off Apple platforms and `⌘K` on macOS and iOS.+- `F02.command-menu-focus`: the shortcut works while typing in another field (the composer) and moves focus to the search input. Tab moves focus to the first option. Escape closes the menu from any focused element inside it and returns focus to the composer.+- `F02.command-menu-items`: the menu shows Navigation (New chat, Customize, Automations, MCP servers), Settings (Settings, Agent settings, LLM profiles, Model Router, Condenser, Agent Context, Verification, Application, Secrets) and Actions (Toggle sidebar). Each **Go** item navigates to its route.+- `F02.command-menu-toggle-sidebar`: the **Toggle sidebar** action collapses or expands the desktop rail.+- `F02.command-menu-search`: every search term must match the title, description or keywords. **No commands found** is the empty state. The X button clears the query. Arrow keys wrap around the list, hovering an item selects it, Enter runs the selected item, and Enter does nothing when nothing matches.+- `F02.command-menu-new-tab`: a middle-click or modifier-click on a **Go** item opens the route in a new tab and leaves the menu open.+- `F02.command-menu-phone`: at 390 px the menu fits the screen and opens from the drawer's Search row. Escape closes the menu and leaves the drawer open. Running an item closes the drawer.+- `F02.mobile-drawer`: at phone width the rail is hidden and a hamburger (`sidebar-mobile-menu-toggle`) opens a 300 px drawer. The hamburger is in the top bar, or in the chat header on conversation pages. The drawer closes on its chevron, Escape, a backdrop click or any route change.+- `F02.mobile-top-bar`: at phone width, settings sub-pages and Customize detail pages (`/skills`, `/mcp`, `/plugins`, `/apps`) show a Back chevron that returns to `/settings` or `/customize`.+- `F02.checklist`: after onboarding, the expanded rail shows a **Getting started** card with **N complete** and six items. They link to `/settings/llm`, `/conversations`, `/automations`, `/settings/agents`, `/mcp` and the external Slack invite.+- `F02.checklist-item-links`: clicking an item's row navigates in the same tab to its route (for example **Schedule a task** opens `/automations`) without marking the item done.+- `F02.checklist-progress`: items get a check and a strikethrough when done. The LLM item completes when a profile is configured, Start your first chat when a conversation exists, Customize your agent after a visit to `/settings/agents`, and Join Slack on click.+- `F02.checklist-preview`: hovering an item shows a preview with a description, a **Documentation** link and an action button that navigates.+- `F02.checklist-minimize`: the card header minimizes and expands the card, and the state survives a reload.+- `F02.checklist-hide`: the **Show Getting Started checklist** switch in Settings → Application hides the card (it stays hidden after a reload) and can show it again.+- `F02.checklist-all-complete`: the card disappears once all six items are complete. Completion is recomputed from current data, so deleting the automation or the MCP server brings the card back.+- `F02.update-tile`: when npm `latest` is newer than the running version, a **New version** tile (`agent-canvas-version-tile`) opens an update modal with the npm and Docker commands. The tile is never shown in locked-Cloud mode.+- `F02.alert-banner`: when the server config reports maintenance, faulty models or an error message, a dismissible banner (`alert-banner`) appears at the top of the content area.+- `F02.settings-404-modal`: if the backend's settings return 404, the LLM settings modal opens by itself. Other settings fetch errors show a toast.+- `F02.error-toasts`: failed requests show a top-right error toast with the product or server message, and the toast closes by itself.++## How to get to it (user POV)++- Any page in the app: the left rail (desktop) or the hamburger (phone, `browser viewport phone`).+- Direct URLs: `/` (the default home, or a redirect to the pinned page), `/conversations`, `/customize`, `/automations`, `/settings`.+- Command menu: press `Control+k` or `Meta+k` anywhere, or click **Search commands** (`command-menu-trigger`) in the rail or drawer. Type a page or setting name, then press Enter or click the row.+- Hover a sidebar row to reveal its pin. Hover the collapsed rail's logo to reveal the expand chevron.+- Settings → Application (`/settings/app`): the **Show Getting Started checklist** switch.+- The **Getting started** card: click an item row to go to its page, or hover it for the preview.+- Keyboard: `Control+k` also works while the composer has focus; Tab moves from the search input into the option list.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done), desktop viewport, sidebar expanded, no home pin, checklist shown.+- `F02.checklist-progress` (LLM and chat items) needs `control-openhands llm preset deepseek` and one conversation (`control-openhands conversation start --prompt "Reply with only the word: ok" --wait --timeout 180`). Run both before the `F02.conversation-list` bullet. The preset writes through the API, so `control-openhands browser reload` before you read the LLM item. The conversation-header hamburger check in `F02.mobile-drawer` reuses that conversation.+- `F02.update-tile` (the sidebar tile) is blocked unless the installed version is older than npm `latest` and the browser can reach `registry.npmjs.org`. The Settings → Application check runs either way.+- `F02.alert-banner` is blocked on the local backend, whose config always reports no alerts; it needs a Cloud backend that publishes them.+- `F02.settings-404-modal` is blocked: it needs a backend whose settings endpoint returns 404.+- `F02.checklist-all-complete` needs an automation and an MCP server on top of the four items above. Both are added through the UI from two fixtures (see that bullet) and deleted again afterwards.++- **Sidebar links (`F02.nav-links`).** Run `control-openhands browser goto /conversations`, `control-openhands browser click 'testid=sidebar-skills-link'`, then `control-openhands browser wait-url '/mcp$'`. The URL ends in `/mcp` because desktop `/customize` redirects there. Run `control-openhands browser attr 'testid=sidebar-skills-link' class`; the class contains `bg-tertiary` (the active style), and `control-openhands browser attr 'testid=sidebar-skills-link' aria-current` is `page`. Repeat `browser goto` with `/skills`, `/plugins` and `/apps`; each time the class still contains `bg-tertiary` and `aria-current` is still `page`. Run `control-openhands browser click 'testid=sidebar-automations-link'`, `control-openhands browser url` (ends in `/automations`) and `control-openhands browser attr 'testid=sidebar-automations-link' aria-current` (`page`); `control-openhands browser attr 'testid=sidebar-skills-link' aria-current` is now `null`. Then run `control-openhands browser click 'testid=sidebar-conversations-link'` and `control-openhands browser click 'aside[data-collapsed] >> role=link[name="OpenHands Logo"]'`; both leave the URL at `/conversations`.+- **Pin as home (`F02.pin-as-home`).** From `/conversations` run `control-openhands browser visible 'testid=sidebar-pin-home-toggle-customize'` (`false`), `control-openhands browser hover 'testid=sidebar-skills-link'`, the same `visible` (`true`), then `control-openhands browser click 'testid=sidebar-pin-home-toggle-customize'` and `control-openhands browser attr 'testid=sidebar-pin-home-toggle-customize' aria-pressed` (`true`). Run `control-openhands browser goto /` and `control-openhands browser wait-url '/mcp$'`; the URL ends in `/mcp`. Run `control-openhands browser screenshot 'aside[data-collapsed]' --feature F02.pin-as-home --name customize-pinned`; the screenshot shows a filled pin on the Customize row with no hover. Move the pin: run `control-openhands browser hover 'testid=sidebar-automations-link'` and `control-openhands browser click 'testid=sidebar-pin-home-toggle-automations'`. The Customize pin's `aria-pressed` becomes `false`, and `control-openhands browser goto /` lands on `/automations`. Unpin with `control-openhands browser click 'testid=sidebar-pin-home-toggle-automations'`, then run `control-openhands browser goto /` and `control-openhands browser count 'testid=home-screen'`. The URL stays `/` and the count is `1`. `control-openhands browser storage --values` shows `oh:pinned-home-route:<backend>:<org>` as `null`.+- **Collapse and expand (`F02.sidebar-collapse`).** Run `control-openhands browser click 'testid=sidebar-collapse-toggle'` and `control-openhands browser attr 'aside[data-collapsed]' data-collapsed` (`true`). Run `control-openhands browser reload`; the attribute is still `true`, `browser storage --values` shows `openhands-sidebar` with `"collapsed":true`, and `control-openhands browser bbox 'aside[data-collapsed]'` reports width `60`. `control-openhands browser count 'testid=sidebar-onboarding-checklist'` is `0`. For the tooltip, hover one icon, then another: `control-openhands browser hover 'testid=sidebar-automations-link'`, `control-openhands browser hover 'testid=sidebar-skills-link'`, then `control-openhands browser wait 'role=tooltip'` and `control-openhands browser text 'role=tooltip'` (`Customize`). For the backend popover, run `control-openhands browser hover 'testid=collapsed-backend-selector-link'`; its `aria-expanded` is `true`, `browser testids --filter backend` lists `add-backend-menu-item` and `manage-backends-menu-item`, and `control-openhands browser screenshot --feature F02.sidebar-collapse --name backend-popover` shows the popover. Expand by clicking empty rail space with `control-openhands browser click 'aside[data-collapsed]'` (`data-collapsed` becomes `false`). Collapse again, then run `control-openhands browser hover 'aside[data-collapsed] >> role=link[name="OpenHands Logo"]'`; the toggle's class has `opacity-100` and its `aria-label` is `Expand sidebar`. `control-openhands browser click 'testid=sidebar-collapse-toggle'` expands the rail.+- **Settings gear (`F02.settings-link`).** The previous bullet expanded the rail: collapse it with `control-openhands browser click 'testid=sidebar-collapse-toggle'`, then run `control-openhands browser click 'testid=collapsed-settings-link'` and `control-openhands browser wait-url '/settings'`. Expand it again with `control-openhands browser click 'testid=sidebar-collapse-toggle'`, then run `control-openhands browser goto /conversations`, `control-openhands browser click 'testid=backend-selector-settings-link'` and `control-openhands browser url`; the URL ends in `/settings/agents`. `control-openhands browser attr 'testid=backend-selector-settings-link' target` is `null` (same tab).+- **Conversation list (`F02.conversation-list`).** After `conversation start` (preconditions), run `control-openhands browser goto /conversations` and `control-openhands browser testids 'testid=conversation-panel'`. The list includes `conversation-card`.+- **Open and close the menu (`F02.command-menu-open-close`).** From `/conversations` run `control-openhands browser text 'testid=command-menu-trigger'`. It reads `Search commands` and `CTRL+K` on Linux and Windows (the hint is `Ctrl+K`, drawn in capitals; macOS and iOS show `⌘K`). Run `control-openhands browser press Control+k`, then `control-openhands browser visible 'testid=command-menu'` (`true`), `control-openhands browser eval "document.activeElement && document.activeElement.id"` (`command-menu-search`) and `control-openhands browser text 'testid=command-menu >> css=kbd'` (`CTRL+K`, the header hint). `control-openhands browser screenshot --feature F02.command-menu-open-close --name open` shows the dimmed, blurred backdrop. Run `control-openhands browser press Escape`; `browser count 'testid=command-menu'` is `0`. Run `control-openhands browser press Meta+k` (count `1`), `control-openhands browser type 'testid=command-menu >> role=combobox' secr`, then `control-openhands browser click 'testid=command-menu >> role=button[name="Close command menu"]'` (the backdrop; count `0`). Run `control-openhands browser click 'testid=command-menu-trigger'` and `control-openhands browser value 'testid=command-menu >> role=combobox'`; the value is `""` because the query was cleared on close. Close it with `control-openhands browser press Escape`; focus is back on the row (`control-openhands browser eval "document.activeElement.dataset.testid"` is `command-menu-trigger`). Collapsed rail: run `control-openhands browser click 'testid=sidebar-collapse-toggle'`, `control-openhands browser click 'testid=command-menu-trigger'` (the search icon; count `1`), `control-openhands browser press Escape`, then expand with `control-openhands browser click 'aside[data-collapsed]'`.+- **Every item navigates (`F02.command-menu-items`).** The previous bullet closed the menu: run `control-openhands browser press Control+k`, then `control-openhands browser snapshot 'testid=command-menu' --feature F02.command-menu-items --name all-items`; it lists 14 options under Navigation, Settings and Actions, with Model Router after LLM profiles and Agent Context after Condenser settings. Close it with `control-openhands browser press Escape` and rest the pointer off the list with `control-openhands browser hover 'testid=command-menu-trigger'` (see Gotchas). For each item run `control-openhands browser goto /conversations`, `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' '<term>'`, `control-openhands browser press Enter` and `control-openhands browser wait-url '<route>$'`. Expected routes: `New chat` → `/conversations`, `Customize` → `/mcp` (via `/customize`), `Automations` → `/automations`, `MCP servers` → `/mcp`, `Settings overview` → `/settings/agents` (via `/settings`), `Agent settings` → `/settings/agents`, `LLM profiles` → `/settings/llm`, `Model Router` → `/settings/meta-llm`, `Condenser` → `/settings/condenser`, `Agent Context` → `/settings/agent-context`, `Verification` → `/settings/verification`, `Application` → `/settings/app`, `Secrets` → `/settings/secrets`. `browser count 'testid=command-menu'` is `0` after each run. Click path: `control-openhands browser goto /settings/app`, open the menu, type `new chat`, then `control-openhands browser click 'testid=command-menu >> role=option[name=/New chat/]'`; the URL becomes `/conversations`.+- **Toggle sidebar (`F02.command-menu-toggle-sidebar`).** Run `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' toggle`, `control-openhands browser press Enter`, then `control-openhands browser attr 'aside[data-collapsed]' data-collapsed` (`true`). Repeat with the term `sidebar`; the value returns to `false`.+- **Search, empty state, keyboard (`F02.command-menu-search`).** The Toggle sidebar action closed the menu: open it with `control-openhands browser press Control+k`, then run `control-openhands browser fill 'testid=command-menu >> role=combobox' theme` and `control-openhands browser count 'testid=command-menu >> role=option'` (`1`, Application, matched by its keywords). The term `settings secret` leaves `1` option, `secret automations` leaves `0` (all terms must match) and `model` leaves `3` (MCP servers, LLM profiles, Model Router). Fill `qa-zzz-nothing`, then run `control-openhands browser text 'testid=command-menu >> role=listbox'` (`No commands found` / `Try a page, action, or setting name.`) and `control-openhands browser screenshot --feature F02.command-menu-search --name no-results`. Run `control-openhands browser press Enter`; the menu stays open and the URL does not change. Run `control-openhands browser click 'testid=command-menu >> role=button[name="Clear search"]'`; the value is `""` and the count is back to `14`. Keyboard: `control-openhands browser attr 'testid=command-menu >> role=combobox' aria-activedescendant` starts at `command-menu-option-new-chat`. `control-openhands browser press ArrowUp` wraps to `command-menu-option-toggle-sidebar`, and `ArrowDown` returns to `new-chat`, then moves to `customize`. `control-openhands browser hover 'testid=command-menu >> role=option[name=/Secrets settings/]'` sets the value to `command-menu-option-secrets-settings`.+- **Open in a new tab (`F02.command-menu-new-tab`).** With the menu open and `secrets` typed, `control-openhands browser attr 'testid=command-menu >> role=option[name=/Secrets settings/]' href` is `/settings/secrets`. Run `control-openhands browser click 'testid=command-menu >> role=option[name=/Secrets settings/]' --button middle` and `control-openhands browser tabs`; tab 1 is `/settings/secrets`, tab 0 keeps its URL, and `browser count 'testid=command-menu'` is still `1`. Run `control-openhands browser close-tab 1`. The modifier path works the same: `control-openhands browser click 'testid=command-menu >> role=option[name=/Secrets settings/]' --modifiers Control` opens tab 1 with the menu still open; close that tab too. The click leaves focus on the option; `control-openhands browser press Escape` still closes the menu (count `0`).+- **Keyboard focus (`F02.command-menu-focus`).** From `/conversations` run `control-openhands browser click 'testid=chat-input'`, `control-openhands browser press Control+k`, `browser count 'testid=command-menu'` (`1`) and `control-openhands browser eval "document.activeElement && document.activeElement.id"` (`command-menu-search`): the shortcut opens the menu from inside the composer. Run `control-openhands browser press Tab`; the same `eval` returns `command-menu-option-new-chat`. `control-openhands browser press Escape` closes the menu from the option (count `0`), and `control-openhands browser eval "document.activeElement.dataset.testid"` returns `chat-input`: focus is back in the composer.+- **Phone drawer (`F02.mobile-drawer`).** Run `control-openhands browser viewport phone` and `control-openhands browser goto /conversations`. `control-openhands browser visible 'aside[data-collapsed]'` is `false`. Run `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'` and `control-openhands browser wait 'testid=sidebar-mobile-drawer'`. `control-openhands browser bbox 'testid=sidebar-mobile-drawer'` gives width `300`, `insideViewport` `true` and `pageHorizontalOverflow` `false`, and `control-openhands browser screenshot --feature F02.mobile-drawer --name open` shows the full rail. Close paths, each followed by `control-openhands browser wait 'testid=sidebar-mobile-drawer' --state detached`: `control-openhands browser click 'testid=sidebar-mobile-drawer-close'`; `control-openhands browser press Escape`; `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=sidebar-automations-link'` (route change; the URL becomes `/automations`); and a backdrop click to the right of the drawer, `control-openhands browser mouse-click 350 400` (on `/conversations`, `control-openhands browser click 'testid=submit-button' --force` also lands on the backdrop, because the empty composer's send button sits at x≈326 under it). On a conversation page (`browser goto` the URL from `conversation start`), `control-openhands browser bbox 'testid=sidebar-mobile-menu-toggle'` is at the top-left of the chat header. `control-openhands browser screenshot --feature F02.mobile-drawer --name conversation-header` shows it beside the title, and clicking it opens the drawer. Return with `control-openhands browser viewport desktop`.+- **Back chevron (`F02.mobile-top-bar`).** The Phone drawer bullet returned to desktop: run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/llm` and `control-openhands browser attr 'testid=sidebar-mobile-back-button' aria-label` (`Settings`). Then run `control-openhands browser click 'testid=sidebar-mobile-back-button'` and `control-openhands browser url`; the URL is `/settings`, and on that page `browser count 'testid=sidebar-mobile-back-button'` is `0`. `control-openhands browser screenshot --feature F02.mobile-top-bar --name settings-root` shows only the hamburger above the settings menu. Do the same from `/skills`: the label is `Customize` and the click lands on `/customize`, which on phone is the hub (`extensions-mobile-hub`).+- **Phone command menu (`F02.command-menu-phone`).** At phone width open the drawer, then run `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=command-menu-trigger'`. `control-openhands browser bbox 'testid=command-menu >> role=listbox'` reports `insideViewport` `true` and `pageHorizontalOverflow` `false`, and `control-openhands browser screenshot --feature F02.command-menu-phone --name open` shows it. `control-openhands browser press Escape` closes only the menu: `browser count 'testid=command-menu'` is `0` and `control-openhands browser visible 'testid=sidebar-mobile-drawer'` is still `true`. Reopen it with `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=command-menu-trigger'`, type `secrets` and press Enter; `control-openhands browser wait-url 'secrets$'` passes and `control-openhands browser wait 'testid=sidebar-mobile-drawer' --state detached` passes.+- **Checklist card (`F02.checklist`).** The phone bullets above leave the phone viewport on `/settings/secrets`: run `control-openhands browser viewport desktop`, `control-openhands browser goto /conversations`, then `control-openhands browser count 'testid=sidebar-onboarding-checklist >> role=listitem'` (`6`) and `control-openhands browser text 'testid=sidebar-onboarding-checklist'`. The first lines are `Getting started` and `N complete`. `control-openhands browser snapshot 'aside[data-collapsed]'` shows the six links: `/settings/llm`, `/conversations`, `/automations`, `/settings/agents`, `/mcp` and `https://openhands.dev/joinslack`.+- **Item links (`F02.checklist-item-links`).** Run `control-openhands browser click 'testid=sidebar-onboarding-checklist-item-schedule-task' --expect-url '/automations(\?|$)'` and `control-openhands browser click 'testid=sidebar-onboarding-checklist-item-configure-llm' --expect-url '/settings/llm(\?|$)'`; both pass, `browser tabs` still lists one tab, and `browser count 'testid=sidebar-onboarding-checklist-item-schedule-task >> css=span.line-through'` stays `0` (visiting is not completing).+- **Progress (`F02.checklist-progress`).** Each completed item renders a struck-through label, so `control-openhands browser count 'testid=sidebar-onboarding-checklist-item-<id> >> css=span.line-through'` is `1`. Run `control-openhands browser goto /settings/agents`, then come back; `customize-agent` is done. Run `control-openhands browser click 'testid=sidebar-onboarding-checklist-item-join-slack'`; `join-slack` is done and `browser tabs` shows an external Slack tab, which you close with `control-openhands browser close-tab 1`. After `llm preset deepseek`, run `control-openhands browser reload` (the open page does not refetch settings written through the API), then `control-openhands browser wait 'testid=sidebar-onboarding-checklist-item-configure-llm >> css=span.line-through' --timeout 15000`. After `conversation start`, `start-conversation` is done. The header count rises each time (`4 complete` after these four).+- **Item preview (`F02.checklist-preview`).** Run `control-openhands browser hover 'testid=sidebar-onboarding-checklist-item-join-slack'`, `control-openhands browser hover 'testid=sidebar-onboarding-checklist-item-connect-mcp'` and `control-openhands browser wait 'testid=sidebar-onboarding-checklist-preview-connect-mcp' --timeout 5000`. Then run `control-openhands browser text 'testid=sidebar-onboarding-checklist-preview-connect-mcp'`; it reads the title, the description, `Documentation` and `Connect`. `control-openhands browser attr 'testid=sidebar-onboarding-checklist-preview-docs-connect-mcp' href` is `https://docs.openhands.dev/overview/model-context-protocol`. Take `control-openhands browser screenshot --feature F02.checklist-preview --name connect-mcp`, then run `control-openhands browser click 'testid=sidebar-onboarding-checklist-preview-action-connect-mcp'` and `control-openhands browser wait-url '/mcp$'`.+- **Minimize (`F02.checklist-minimize`).** Run `control-openhands browser click 'testid=sidebar-onboarding-checklist-toggle'`, `control-openhands browser attr 'testid=sidebar-onboarding-checklist' data-minimized` (`true`) and `browser count 'testid=sidebar-onboarding-checklist >> role=listitem'` (`0`). After `control-openhands browser reload` the attribute is still `true` and the toggle's `aria-label` is `Expand checklist`. Click the toggle again to restore `false`.+- **Hide from settings (`F02.checklist-hide`).** Run `control-openhands browser goto /settings/app` and `control-openhands browser click 'text=Show Getting Started checklist'`; `browser count 'testid=sidebar-onboarding-checklist'` is `0`. After `control-openhands browser reload` the count is still `0`, and `control-openhands browser eval "document.querySelector('[data-testid=show-getting-started-checklist-switch]').checked"` is `false`. Click the same text again; the count is `1`.+- **All complete (`F02.checklist-all-complete`).** Start with the four items above done (`5 complete` would mean one fixture is left over). Arrange two fixtures: a minimal stdio MCP server, `control-openhands fixture file --name qa-f02-mcp.py --content "$(printf '%s\n' 'import sys,json' 'for line in sys.stdin:' ' m=json.loads(line)' ' if "id" not in m: continue' ' r={}' ' if m.get("method")=="initialize": r={"protocolVersion":m["params"].get("protocolVersion","2024-11-05"),"capabilities":{"tools":{}},"serverInfo":{"name":"qa","version":"1"}}' ' elif m.get("method")=="tools/list": r={"tools":[]}' ' sys.stdout.write(json.dumps({"jsonrpc":"2.0","id":m["id"],"result":r})+"\n"); sys.stdout.flush()')"`, and `control-openhands fixture file --name qa-f02.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F02 Done","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":false,"prompt":"Reply with the single word: pong. Do not run any tools."}}'`. Add the server in the UI: `control-openhands browser goto /mcp`, `control-openhands browser click 'testid=mcp-add-custom-server'`, `control-openhands browser click 'testid=server-type-dropdown'`, `control-openhands browser click 'role=option[name="STDIO"]'`, `control-openhands browser fill 'testid=name-input' qa_f02_mcp`, `control-openhands browser fill 'testid=command-input' python3`, `control-openhands browser fill 'testid=args-input' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f02-mcp.py"`, `control-openhands browser click 'testid=mcp-custom-editor >> testid=submit-button'` and `control-openhands browser wait 'testid=mcp-custom-editor' --state detached`. The header reads `5 complete`. Import the automation: `control-openhands browser goto /automations`, `control-openhands browser click 'testid=automations-add-automation'`, `control-openhands browser click 'testid=automations-import-automation'`, `control-openhands browser upload 'testid=automations-import-file' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f02.automation.json"`, `control-openhands browser click 'testid=import-automation-confirm'` and `control-openhands browser wait 'testid=import-automation-modal' --state detached`. Now `browser count 'testid=sidebar-onboarding-checklist'` is `0`, still `0` after `control-openhands browser reload`, and `control-openhands browser screenshot 'aside[data-collapsed]' --feature F02.checklist-all-complete --name rail` shows the rail without the card. Restore and prove it comes back: open the card's kebab with `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F02 Done >> role=button[name="Automation actions"]'`, then `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Delete"]'`, `control-openhands browser click 'role=heading[name="Delete automation"] >> xpath=.. >> role=button[name="Delete"]'` and `control-openhands browser reload`; the card count is `1` again (`5 complete`). Then `control-openhands browser goto /mcp`, `control-openhands browser click 'testid=mcp-server-detail-qa_f02_mcp'`, `control-openhands browser click 'testid=mcp-custom-editor-delete'`, `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'` and `control-openhands browser reload`; `testid=mcp-installed-empty` is back and the card reads `4 complete`.+- **Update tile (`F02.update-tile`).** The tile is blocked in an up-to-date checkout or without registry access. Check with `control-openhands browser count 'testid=agent-canvas-version-tile'`. When the count is `1`, click it; the modal has `agent-canvas-update-command-npm`, `agent-canvas-update-command-docker` and `agent-canvas-update-check-button`. The manual check runs either way: on `/settings/app` (`control-openhands browser goto /settings/app`; the previous bullet ends on `/mcp`), `testid=agent-canvas-update-badge` reads `Up to date` (or `New version`), `control-openhands browser click 'testid=agent-canvas-update-toggle'` opens `agent-canvas-update-modal`, and `control-openhands browser click 'testid=agent-canvas-update-check-button'` reports the result in `agent-canvas-update-status` (`You're running the latest version. What's new` when current). Close it with `control-openhands browser click 'testid=close-agent-canvas-update-modal'`.+- **Error toast (`F02.error-toasts`).** Run `control-openhands browser goto /conversations/00000000-0000-0000-0000-000000000001` and `control-openhands browser wait-text 'This conversation does not exist'`. The URL becomes `/conversations`, and `control-openhands browser screenshot --feature F02.error-toasts --name missing-conversation` shows a top-right error toast. It is the only toast: `control-openhands browser toasts` lists just the "This conversation does not exist, or you do not have permission to access it…" text, and `control-openhands browser toasts --history` has no entry containing `this UI does not understand`. `control-openhands browser wait 'text=This conversation does not exist' --state hidden` passes within 30 s.+- **Check for errors.** Run `control-openhands browser errors --app-only` after each group; it reports `pageErrors` `0` and `appErrors` `0`. External `registry.npmjs.org` and `cdn.simpleicons.org` failures are sandbox noise.+- **Restore.** Leave the sidebar expanded, unpinned, with the checklist shown and expanded, at `browser viewport desktop`.++## Gotchas++- The rail animates its width for 200 ms. A `bbox` taken right after the collapse click reads an intermediate width (about 70); measure after `browser reload`.+- `browser url` straight after clicking **Customize** can still read `/customize`; desktop redirects to `/mcp` a moment later. Use `browser wait-url '/mcp$'`.+- `/settings` redirects to `/settings/agents` on desktop but shows the settings menu on phone. That redirect also marks the checklist's **Customize your agent** item done, so visiting Settings by any route completes it. The sidebar **Customize** link (`/customize`) does not.+- The pin toggles are hidden until hover (`visible` is `false`), except a pinned row's toggle, which stays visible. They exist only on the expanded rail.+- The two desktop elements share the label `Sidebar navigation`, and settings pages add a second `complementary` landmark, so `role=complementary` is ambiguous. Use `aside[data-collapsed]` for the desktop rail and `testid=sidebar-mobile-drawer` for the drawer.+- HeroUI tooltips (the collapsed rail and checklist previews) often stay closed on the first `browser hover` after a navigation. Hover a neighbor first, then the target, and `browser wait` for the tooltip. Never `count` it right away.+- When collapsed, the expand chevron is `opacity-0 pointer-events-none` until the rail is hovered. A forced click on it lands on the logo link and does nothing; hover the logo first.+- With the full list open, the command-menu panel covers the viewport center, so clicking the backdrop button by selector only works after a filter shortens the list (type `secr` first). `control-openhands browser mouse-click 1300 500` hits the desktop backdrop with any list length.+- The new-tab path works with `browser click ... --button middle` and with `--modifiers Control` (or `Meta`). The phone drawer's backdrop has no handle; `browser mouse-click 350 400` clicks it.+- Escape closes one layer at a time (#18044): with the command menu open over the phone drawer, the first Escape closes the menu and the second closes the drawer. Focus goes back to whatever had it when the menu opened: right after `browser goto /conversations` that is the composer (`chat-input` takes focus on load), and on `/settings/app` it is `<body>`.+- **Toggle sidebar** at phone width flips the stored desktop state without any visible change. Expand the rail again after returning to desktop.+- Typing does not reset the command menu's selection. The active option keeps its index, cut down to the shorter list, from the last ArrowUp/ArrowDown or hover, and a pointer resting where the list opens hovers the option under it. A term with several matches can then run a later one on Enter: after two `ArrowDown` presses, typing `LLM profiles` (LLM profiles and Model Router) selects Model Router. Before opening the menu for an Enter check, rest the pointer with `browser hover 'testid=command-menu-trigger'`, and read `aria-activedescendant` before Enter when a term matches several items. Repro candidate, not yet filed.+- The command menu's **LLM profiles** item uses a magnifier icon (`lucide-search`, the same icon as the menu's search field).+- The checklist card has no dismiss button. Hide it with the App settings switch or by completing every item. Clicking **Join the OpenHands Slack** counts as joining and opens an external tab you must close.+- Registry access depends on the sandbox. Where the browser cannot reach `registry.npmjs.org` (`ERR_CERT_AUTHORITY_INVALID`), the update check reports `Couldn't check for updates`; that is the environment, not the product. Where it can, the badge reads `Up to date` and the check says `You're running the latest version.`+- Adding a custom MCP server tests the connection first and refuses an unreachable one (`Could not reach the server...`, or `Connection failed: McpError: Connection closed` for `uvx mcp-server-time` here), so the all-complete recipe uses the local stdio fixture.diff --git a/.agents/skills/verify-openhands/references/feature-map/F03-home.md b/.agents/skills/verify-openhands/references/feature-map/F03-home.mdnew file mode 100644index 0000000000..f914a2966a--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F03-home.md@@ -0,0 +1,147 @@+# F03 — Home and starting work++Home is the "What do you want to work on?" screen at `/` and `/conversations`.+A user describes a task in the composer and, on a local backend, can first pick+a workspace folder (Open Workspace, folder browser, Manage Workspaces), a+workspace mode and plugins; submitting creates a conversation and opens it. A+warning banner replaces a silent failure when no LLM is configured. Below the+composer, home offers recommended automations, a pinned-automations grid and an+activity list of enabled automations with per-item actions.++Source: `src/routes/home.tsx`, `src/routes/index-home.tsx`, `src/components/features/home/`, `src/components/features/plugins/plugin-picker-modal.tsx`, `src/components/features/automations/recommended-automations-launcher.tsx`, `src/hooks/use-home-pinned-automations.ts`, `src/hooks/use-home-automation-actions.ts`, `src/utils/recommended-automation-rail.ts`, `src/components/features/automations/responder-deployment-modal.tsx`.++## Sub-features++Starting work:++- `F03.home-entry-points`: `/`, `/conversations`, the sidebar **New Chat** and the command-menu item **New chat** show the launcher (`home-chat-launcher`) with the heading, subtitle and the `Describe an engineering task…` composer.+- `F03.llm-not-configured-banner`: with no usable LLM, a `role=alert` banner reads `Your LLM isn't set up yet, so conversations won't run. Finish setup to get started.`; **Set up LLM** opens `/settings/llm`; the banner is gone once a profile with a key is active.+- `F03.composer-blocked-without-llm`: with no LLM, Send is disabled and Enter creates nothing (the text stays editable).+- `F03.draft-persistence`: the home draft survives a reload and is cleared after a conversation is created.+- `F03.home-model-command`: `/model <profile>` sent from home activates that LLM profile without creating a conversation.+- `F03.launch-in-workspace`: submitting with a workspace picked shows `Creating conversation…`, opens `/conversations/<id>`, and the agent runs in that folder.+- `F03.launch-without-workspace`: with nothing picked, the conversation runs in a fresh per-conversation folder under the server home.+- `F03.create-error-toast`: when creation fails, the loading toast is replaced by one error toast and the prompt is not lost.+- `F03.plugin-picker`: **Plugins** opens **Attach plugins** (catalog, search, Add/Remove switch, `N selected`, Done and X); the pill then shows a count badge.+- `F03.launch-with-plugin`: a conversation started with a plugin attached loads it; the selection resets afterwards.++Workspaces (local backend):++- `F03.open-workspace-dialog`: **Open Workspace** opens a dialog with a workspace combobox; Confirm stays disabled until a pick; confirming swaps the pill for a preview bar that reopens the dialog; X and Escape close it.+- `F03.workspace-dropdown-search`: typing filters workspaces; with more than one group, workspaces are grouped by parent with an **Other** group; no match (or no workspaces) shows `No workspaces yet`.+- `F03.selection-after-reload`: after a reload the preview bar is gone, but the dialog preselects the last confirmed workspace.+- `F03.workspace-mode`: the preview bar's mode menu switches **Local Repo** / **New Worktree**; the choice persists across reloads.+- `F03.folder-browser`: **+ Add Workspace** opens **Add workspaces** at the server home with Favorites/Locations, Up and the current path; **Add this directory** adds and selects the folder, **Add all subdirectories** adds a parent whose children become workspaces, **Cancel** adds nothing.+- `F03.folder-browser-locations`: the browser's **Favorites** (Home, plus `workspace` once a no-folder conversation exists) and **Locations** (`/`) jump to that folder; Up is disabled at `/`.+- `F03.manage-workspaces`: **Manage Workspaces** lists workspaces and parents (with children); every Remove asks for confirmation; Cancel keeps, Confirm removes for good and clears the selection; with nothing left it reads `You don't have any workspaces yet.`+- `F03.open-repository-dialog`: on a Cloud backend, **Open repository** picks provider, repository and branch (blocked locally).+- `F03.isolated-workspace-notice`: on an isolated-runtime backend a status line explains the new isolated workspace and offers **Clear host workspace** (blocked locally).+- `F03.workspaces-unsupported`: on an Agent Server without workspace APIs the pill is disabled with a tooltip (blocked locally).++Automations on home:++- `F03.recommended-automations-rail`: a horizontally scrolling rail of recommended automations with edge fades; cards with a setup form open `/automations/new/<id>`.+- `F03.recommended-responder-choice`: GitHub/Slack responder cards on a local backend first ask **Choose how your responder should run**.+- `F03.responder-cloud-option`: in that dialog **Open OpenHands Cloud integrations** opens `https://app.all-hands.dev/settings/integrations` in a new tab, closes the dialog and saves no secret; X closes it without a choice.+- `F03.recommended-missing-integration`: a card whose required integration is missing opens that integration's install dialog first.+- `F03.recommended-hides-added`: a catalog automation that already exists (matched by name, enabled or not) drops off the rail; deleting it brings the card back.+- `F03.recommended-prompt-launch`: a card with no setup form and no missing integration creates a conversation that sends the automation prompt (blocked locally).+- `F03.home-automations-list`: **Automations** lists enabled automations with schedule, last run and status, a sparkline, **+ Add**, and `No automations yet. Add one to automate repetitive work.` when empty.+- `F03.home-automation-links`: a row opens `/automations/<id>`, a sparkline bar opens `/automations/<id>?run=<runId>`, **+ Add** opens `/automations`.+- `F03.home-run-tooltip`: hovering a row shows its trigger, status, last run and task.+- `F03.home-row-menu`: the row kebab offers Run now, View, Edit, Turn off and Pin to dashboard; Run now toasts `Automation dispatched` and is disabled while a run is in flight; Edit saves with `Automation updated`.+- `F03.cancel-in-flight-run`: **Cancel run** appears while a run is pending or running and cancels it (`Automation run cancelled`).+- `F03.turn-off-confirmation`: Turn off asks `Turn off "<name>"? It will stop running on its schedule until you turn it back on.`; Cancel keeps it on, Turn off disables it and drops it from home.+- `F03.pinned-automations-grid`: **Pin to dashboard** adds a card to **Pinned automations** (prompt, pills, status strip, Runs); the title opens the detail page; a deleted automation's card disappears.+- `F03.pinned-card-menu`: a pinned card's kebab has the same actions with **Unpin from dashboard**.+- `F03.pinned-card-links`: a pinned card's sparkline bar opens `/automations/<id>?run=<runId>`, and Enter on its focused title opens the detail page.+- `F03.pinned-reorder-drag`: dragging a pinned card's title row (`Reorder <name>`) onto another card reorders the pins, and the order survives a reload.+- `F03.home-automations-view-more`: past 10 rows **View more**/**View all**, past 6 pins **View more**/**View less** (not arranged).+- `F03.automations-backend-down`: with the automation service down, the rail, pinned grid and list are hidden and the composer still works.+- `F03.phone`: at 390 px the banner, launcher, rail, pinned grid, list and the workspace dialogs fit without horizontal overflow, and folder names stay readable.++## How to get to it (user POV)++- Sidebar **New Chat** (`sidebar-conversations-link`), which opens `/conversations`; the logo does the same (see F02).+- Direct URL `/` (unless a page is pinned as home, see F02) or `/conversations`.+- Command menu (`Control+k`, `Meta+k` or `command-menu-trigger`): search "New chat", choose **New chat**.+- Under the composer: **Open Workspace** (`open-workspace-button`) or, once confirmed, the preview bar (`home-git-control-bar-preview`); **Plugins** (`open-plugin-picker`).+- In the Open Workspace dialog: the combobox (`workspace-dropdown`) and its footer **+ Add Workspace** (`add-workspaces-button`) and **Manage Workspaces** (`manage-workspaces-button`, shown once any workspace or parent exists); in **Add workspaces**, the Favorites/Locations sidebar (`folder-browser-sidebar-<name>`).+- Below the composer: recommended cards (`recommended-automation-rail-card-<id>`), pinned cards (`pinned-automation-card-<id>`) and rows (`running-automation-row-<id>`) with their kebabs; **+ Add** (`home-automations-manage`).++## Driving it with control-openhands++Preconditions:++- `F03.llm-not-configured-banner` and `F03.composer-blocked-without-llm` need a fresh `control-openhands launch --new` with only `control-openhands onboard --skip` done (no `llm preset` yet). Run them first.+- Everything else: baseline state with `control-openhands llm preset deepseek` (deepseek-flash active).+- Workspace fixtures: `control-openhands fixture git-repo --name qa-f03-repo` and `control-openhands fixture folder --name qa-f03-folder` (both under `<run>/workspace`).+- Automation fixtures (arranged through F22 import and F21 Turn on, not proof): `control-openhands fixture file --name qa-f03-pong.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F03 Pong","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":true,"prompt":"Reply with the single word: pong. Do not run any tools."}}'` and the same with `qa-f03-beta` / `QA_F03 Beta`. Run `control-openhands browser goto /automations`, then for each file run `control-openhands browser click 'testid=automations-add-automation'`, `control-openhands browser click 'testid=automations-import-automation'`, `control-openhands browser upload 'testid=automations-import-file' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f03-pong.automation.json"`, `control-openhands browser click 'testid=import-automation-confirm'`, `control-openhands browser wait 'testid=import-automation-modal' --state detached`. Imports arrive disabled: turn each on with `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F03 Pong >> role=button[name="Automation actions"]'` and `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Turn on"]'`. The yearly cron never fires by itself.+- Blocked here: `F03.open-repository-dialog` (OpenHands Cloud backend with a connected GitHub/GitLab/Bitbucket provider), `F03.isolated-workspace-notice` (isolated-runtime backend), `F03.workspaces-unsupported` (an Agent Server without `/api/workspaces`), `F03.recommended-prompt-launch` (a Tavily/Linear/Jira integration installed so some card has nothing missing).++Starting work:++- **No-LLM banner (`F03.llm-not-configured-banner`).** On a fresh run after `onboard --skip`, run `control-openhands browser text 'testid=home-llm-not-configured-banner'`: `Your LLM isn't set up yet, so conversations won't run. Finish setup to get started.` and `Set up LLM`; `control-openhands browser screenshot --feature F03.llm-not-configured-banner --name banner`. At phone width (`control-openhands browser viewport phone`), `control-openhands browser bbox 'testid=home-llm-not-configured-banner'` is inside the viewport (`F03.phone`; the banner exists only before `llm preset`); return with `control-openhands browser viewport desktop`. `control-openhands browser click 'testid=home-llm-not-configured-action' --expect-url '/settings/llm'` lands on `/settings/llm`. Run the blocked-composer bullet and the draft bullet next (they also need no LLM); only then `control-openhands llm preset deepseek`, `control-openhands browser goto /` and `control-openhands browser count 'testid=home-llm-not-configured-banner'` is `0`.+- **Blocked composer (`F03.composer-blocked-without-llm`).** Still without an LLM, run `control-openhands browser goto /` (the banner's action left `/settings/llm`), `control-openhands browser type 'testid=chat-input' 'QA no llm'`, `control-openhands browser enabled 'testid=home-chat-launcher >> testid=submit-button'` (`false`), `control-openhands browser press Enter --selector 'testid=chat-input'`, then `control-openhands browser url` (still `/`) and `control-openhands api GET '/api/conversations/search?limit=5'` (`items` is empty).+- **Draft (`F03.draft-persistence`).** With text in the home composer, `control-openhands browser reload` and `control-openhands browser text 'testid=chat-input'` returns the same text; `control-openhands browser storage --session` lists `oh:home-prompt-draft`. That the draft clears after a successful launch is checked in the first launch (Launch without a folder).+- **Entry points (`F03.home-entry-points`).** `control-openhands browser goto /conversations` and `control-openhands browser count 'testid=home-chat-launcher'` is `1` (same for `/`). From `/settings/secrets` (`control-openhands browser goto /settings/secrets`), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' 'New chat'`, `control-openhands browser snapshot 'testid=command-menu'` (one option `New chat Start a fresh OpenHands conversation. Go` [selected]), `control-openhands browser press Enter`, `control-openhands browser url`: `/conversations`. From `/settings/secrets` (`control-openhands browser goto /settings/secrets` again), `control-openhands browser click 'testid=sidebar-conversations-link' --expect-url '/conversations(\?|$)'` and `browser count 'testid=home-chat-launcher'` is `1`.+- **`/model` on home (`F03.home-model-command`).** `control-openhands api GET /api/profiles` shows `active_profile` `deepseek-flash`. Run `control-openhands browser goto /` (Entry points ended on `/conversations`). The draft from the earlier bullets is still in the composer: clear it with `control-openhands browser fill 'testid=chat-input' ''` (typing would append). Run `control-openhands browser type 'testid=chat-input' '/model deepseek-pro'`, `control-openhands browser press Escape --selector 'testid=chat-input'` (closes the slash menu), `control-openhands browser press Enter --selector 'testid=chat-input'`. The URL stays `/`, `chat-input` is empty, the composer's model pill (`browser text 'testid=chat-input-llm-profile'`) reads `deepseek-pro`, `api GET /api/profiles` shows `active_profile` `deepseek-pro`, and `api GET '/api/conversations/search?limit=20'` lists no new conversation. Restore with the same steps and `/model deepseek-flash`.+- **Launch without a folder (`F03.launch-without-workspace`, `F03.draft-persistence`).** Run `control-openhands browser goto /conversations` (no workspace is picked yet; the pill reads Open Workspace), then fill `chat-input` with `Reply with only the word ok.` and click `testid=home-chat-launcher >> testid=submit-button` with `--expect-url '/conversations/[^/]+$'`. `control-openhands conversation wait <id> --timeout 180` reports `workspace` `<run>/private/home/workspace/project/<id without dashes>`. This is the first successful launch: `control-openhands browser click 'testid=sidebar-conversations-link' --expect-url '/conversations$'` shows an empty `chat-input` and `browser storage --session` no longer lists `oh:home-prompt-draft`.+- **Plugins (`F03.plugin-picker`).** Run `control-openhands browser goto /conversations` (a fresh page), `control-openhands browser click 'testid=open-plugin-picker'` and `control-openhands browser wait 'testid=plugin-picker-loading' --state hidden --timeout 60000`; cards `plugin-picker-card-<name>` are listed. `control-openhands browser fill 'testid=plugin-picker-search-input' weather` leaves one card (`control-openhands browser count '[data-testid^="plugin-picker-card-"]'` is `1`); `zzz-none` makes `browser text 'testid=plugin-picker'` read `No plugins available.` With `weather` again, `control-openhands browser click 'testid=plugin-picker-toggle-city-weather'`: the footer reads `1 selected` and `control-openhands browser attr 'testid=plugin-picker-toggle-city-weather' aria-label` is `Remove`. `control-openhands browser click 'testid=plugin-picker-done'`, then `control-openhands browser text 'testid=plugin-picker-count'` is `1`; reopening keeps the switch checked, and `testid=plugin-picker-close` also closes it.+- **Plugin reaches the agent (`F03.launch-with-plugin`).** With `city-weather` attached, start the no-folder launch above without its `goto` (a page load drops the attached plugin), then `control-openhands api GET '/api/conversations/<id>/events/search?limit=20'`: the system prompt contains `city-weather:now` (a conversation started without the plugin has none). Back on `/conversations` (`control-openhands browser goto /conversations`), `control-openhands browser count 'testid=plugin-picker-count'` is `0`.+- **Creation failure (`F03.create-error-toast`).** Fill `chat-input` with `QA error path`, run `control-openhands service stop agent-server`, then `control-openhands browser click 'testid=home-chat-launcher >> testid=submit-button' --observe 'role=status' --observe-ms 4000` and `control-openhands browser toasts`. Expected: `Creating conversation…` replaced by one error toast and the text still in the composer. Today there are three identical `HTTP request failed (502 Bad Gateway)` toasts and the composer is empty (the draft only returns after a reload); `browser screenshot --feature F03.create-error-toast --name toasts`. Bring the stack back with `control-openhands restart` and `control-openhands browser reload`.++Workspaces:++- **Folder browser (`F03.folder-browser`).** Run `control-openhands browser click 'testid=open-workspace-button'`; before any workspace is picked, `control-openhands browser snapshot 'role=dialog'` shows `Open Workspace`, `combobox "Select a workspace"` and `button "Confirm" [disabled]` (`F03.open-workspace-dialog`). Run `control-openhands browser click 'testid=workspace-dropdown'`; with no saved workspace, `control-openhands browser text 'testid=workspace-dropdown-empty'` is `No workspaces yet`, above **+ Add Workspace** (`F03.workspace-dropdown-search`; `browser screenshot --feature F03.workspace-dropdown-search --name empty-list`). Run `control-openhands browser click 'testid=add-workspaces-button'`. `control-openhands browser text 'testid=folder-browser-current-path'` is `<run>/private/home`. Run `control-openhands browser click 'testid=folder-browser-up'` twice (now `<run>`) and `control-openhands browser click 'testid=folder-browser-entry-workspace'`; `control-openhands browser text 'testid=folder-browser-list'` lists `qa-f03-folder` and `qa-f03-repo` as `Folder` (`browser screenshot --feature F03.folder-browser --name workspace-dir`). Then, reopening the browser each time with `browser click 'testid=workspace-dropdown'` and `browser click 'testid=add-workspaces-button'` (the Open Workspace dialog stays open behind it; the browser always restarts at `<run>/private/home`, so repeat Up twice and `folder-browser-entry-workspace`):+ - `control-openhands browser click 'testid=folder-browser-cancel'`: `browser count 'testid=folder-browser-modal'` is `0` and the selection is unchanged.+ - `control-openhands browser click 'testid=folder-browser-add-all-subdirs'`: the browser closes; after `browser click 'testid=workspace-dropdown'` the dropdown offers `qa-f03-folder` and `qa-f03-repo` (`browser snapshot 'role=dialog'`: `option "qa-f03-folder"`, `option "qa-f03-repo"`, `button "Manage Workspaces"`).+ - `control-openhands browser click 'testid=folder-browser-use'` (Add this directory) at `<run>/workspace`: `control-openhands browser value 'testid=workspace-dropdown'` is `workspace` (auto-selected).+- **Favorites and locations (`F03.folder-browser-locations`).** With the browser open, `control-openhands browser testids 'testid=folder-browser-sidebar'` lists `folder-browser-sidebar-home`, `folder-browser-sidebar-/` and, after any no-folder conversation, `folder-browser-sidebar-workspace`. `control-openhands browser click 'testid=folder-browser-sidebar-/'` makes `browser text 'testid=folder-browser-current-path'` read `/` and `control-openhands browser enabled 'testid=folder-browser-up'` `false`; `folder-browser-sidebar-workspace` goes to `<run>/private/home/workspace` and `folder-browser-sidebar-home` back to `<run>/private/home`. Close with `testid=folder-browser-cancel`.+- **Open Workspace (`F03.open-workspace-dialog`).** The dialog is still open from the previous bullets, with `workspace` selected (its disabled Confirm before a pick is checked at the start of Folder browser). Run `control-openhands browser click 'testid=workspace-dropdown'`, `control-openhands browser click 'testid=workspace-dropdown-menu >> role=option[name="qa-f03-repo"]'`, `control-openhands browser enabled 'testid=workspace-launch-button'` (`true`), `control-openhands browser click 'testid=workspace-launch-button'`. The dialog closes and `control-openhands browser text 'testid=home-git-control-bar-preview'` is `qa-f03-repo` and `Local Repo` (`browser screenshot --feature F03.open-workspace-dialog --name preview-bar`). `control-openhands browser click 'testid=home-git-control-bar-preview >> role=button[name*="qa-f03-repo"]'` reopens the dialog with `browser value 'testid=workspace-dropdown'` `qa-f03-repo`; `control-openhands browser click 'testid=close-open-workspace-dialog'` closes it, and so does `control-openhands browser press Escape`.+- **Launch in a folder (`F03.launch-in-workspace`).** Open Workspace (above) left `qa-f03-repo` confirmed in the preview bar. Run `control-openhands browser fill 'testid=chat-input' 'Run pwd and reply with only its output.'` and `control-openhands browser click 'testid=home-chat-launcher >> testid=submit-button' --observe 'text=Creating conversation' --expect-url '/conversations/[^/]+$'`. `observed` shows `Creating conversation…` then `<absent>`; the returned URL holds `<id>`. `control-openhands conversation wait <id> --timeout 180` reports `workspace` `<run>/workspace/qa-f03-repo`, and `control-openhands conversation events <id> --kinds ObservationEvent,MessageEvent` shows the terminal observation and the reply `<run>/workspace/qa-f03-repo`.+- **Search, groups and empty (`F03.workspace-dropdown-search`).** Run `control-openhands browser goto /` (Launch in a folder left its conversation), `control-openhands browser click 'testid=open-workspace-button'` and `control-openhands browser click 'testid=workspace-dropdown'`. With the dropdown open, `control-openhands browser fill 'testid=workspace-dropdown' repo` and `control-openhands browser text 'testid=workspace-dropdown-menu'` is `qa-f03-repo`. With the parent and the standalone `workspace` saved, the menu text is `workspace`, `qa-f03-folder`, `qa-f03-repo`, `Other`, `workspace` and `control-openhands browser count 'testid=workspace-group-header'` is `2` (`--name grouped`). `control-openhands browser fill 'testid=workspace-dropdown' zzz-none` shows the empty state: `control-openhands browser text 'testid=workspace-dropdown-empty'` is `No workspaces yet` (`--name no-match`) and `control-openhands browser count 'testid=add-workspaces-button'` is still `1`. Clear with `control-openhands browser fill 'testid=workspace-dropdown' ''`; `browser count 'testid=workspace-dropdown-empty'` is `0` again.+- **Reload (`F03.selection-after-reload`).** After confirming qa-f03-repo, `control-openhands browser reload`; `control-openhands browser count 'testid=home-git-control-bar-preview'` is `0` and the pill is back. Click it; `control-openhands browser value 'testid=workspace-dropdown'` is `qa-f03-repo` (sessionStorage `oh:home-selected-workspace-path`).+- **Workspace mode (`F03.workspace-mode`).** With the preview bar showing, `control-openhands browser click 'testid=workspace-mode-selector'`, `control-openhands browser snapshot 'testid=workspace-mode-selector-menu'` (`menuitemradio "Local Repo" [checked]`, `menuitemradio "New Worktree"`), `control-openhands browser click 'testid=workspace-mode-selector-option-new_worktree'`. `browser storage --values` shows `openhands-last-local-workspace-mode` `new_worktree`; after `browser reload` and reconfirming the workspace, `browser text 'testid=home-git-control-bar-preview'` reads `qa-f03-repo` and `New Worktree`. Restore with `testid=workspace-mode-selector-option-local_repo`.+- **Manage (`F03.manage-workspaces`).** With the parent and `workspace` saved: `control-openhands browser click 'testid=workspace-dropdown'`, `control-openhands browser click 'testid=manage-workspaces-button'`; `control-openhands browser testids 'testid=manage-workspaces-modal'` shows `manage-workspaces-row-workspace`, `manage-workspaces-parent-row-workspace`, `manage-workspaces-child-qa-f03-folder` and `manage-workspaces-child-qa-f03-repo`. `control-openhands browser click 'testid=manage-workspaces-remove-workspace'`; `control-openhands browser text 'testid=confirmation-modal'` reads `Remove "workspace" from your saved workspaces?`. `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'` keeps the row (`browser count 'testid=manage-workspaces-row-workspace'` is `1`); repeat Remove and `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`: the count is `0`. Removing a workspace clears the dialog's selection only when it was the selected one: with `qa-f03-repo` selected, `control-openhands browser click 'testid=manage-workspaces-done'` leaves `browser value 'testid=workspace-dropdown'` at `qa-f03-repo`. After `browser reload` the dropdown lists only the two children, and `control-openhands api GET /api/workspaces` shows `workspaces: []` plus the parent. Cleanup proves Remove parent: `control-openhands browser click 'testid=manage-workspaces-remove-parent-workspace'` reads `Remove "workspace" and its 2 child workspaces?`; Confirm leaves `browser text 'testid=manage-workspaces-list'` at `You don't have any workspaces yet.` and `api GET /api/workspaces` empty; because the selected `qa-f03-repo` belonged to that parent, after `browser click 'testid=manage-workspaces-done'` `browser value 'testid=workspace-dropdown'` is empty and `browser enabled 'testid=workspace-launch-button'` is `false`.++Automations on home (fixtures imported and turned on):++- **Recommended rail (`F03.recommended-automations-rail`).** On `/` after `browser reload`, `control-openhands browser attr 'testid=recommended-automations-rail-fade-left' data-visible` is `false` and `...-fade-right` is `true`; `control-openhands browser scroll 'testid=recommended-automation-rail-card-github-agents-md-maintainer'` turns the left fade `true` (`browser screenshot --feature F03.recommended-automations-rail --name scrolled-end`). `control-openhands browser click 'testid=recommended-automation-rail-card-custom-automation' --expect-url 'automations/new'` lands on `/automations/new/custom-automation` (`github-pr-reviewer`, `github-issue-to-pr` and `news-digest` do the same).+- **Responder choice (`F03.recommended-responder-choice`).** From `/conversations` (`control-openhands browser goto /conversations`; the rail click left `/automations/new/...`), `control-openhands browser click 'testid=recommended-automation-rail-card-github-agents-md-maintainer'`; `control-openhands browser snapshot 'testid=responder-deployment-modal'` shows `Choose how your responder should run`, **Continue with local setup** and **Open OpenHands Cloud integrations** (`slack-channel-monitor` too). `control-openhands browser click 'testid=responder-deployment-continue-local'` saves an `OPENHANDS_URL` secret and opens the GitHub MCP install dialog (`browser snapshot 'role=dialog'`: `dialog "GitHub"`, Personal access token); `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` closes it on `/conversations`. Delete `OPENHANDS_URL` afterwards in Settings → Secrets (F14): `control-openhands browser goto /settings/secrets`, `control-openhands browser click 'testid=secret-item >> has-text=OPENHANDS_URL >> testid=delete-secret-button'`, then `control-openhands browser click 'role=dialog >> role=button[name="Confirm"]'`.+- **Cloud option (`F03.responder-cloud-option`).** From `/conversations` (`control-openhands browser goto /conversations`), `control-openhands browser click 'testid=recommended-automation-rail-card-slack-channel-monitor'`, then `control-openhands browser click 'testid=responder-deployment-open-openhands-cloud'`: `browser count 'testid=responder-deployment-modal'` is `0`, `control-openhands browser tabs` lists a second page `https://app.all-hands.dev/settings/integrations` (it can take a second to appear: rerun `tabs` before concluding) (close it with `control-openhands browser close-tab 1`), and `api GET /api/settings/secrets` has no `OPENHANDS_URL`. Reopen the card and `control-openhands browser click 'testid=responder-deployment-modal-close'`: the dialog is gone and nothing else opens.+- **Missing integration (`F03.recommended-missing-integration`).** `control-openhands browser click 'testid=recommended-automation-rail-card-research-brief-writer'` opens `dialog "Tavily"` (Command `npx -y tavily-mcp`, Tavily API key); Cancel closes it and no conversation is created.+- **Already added (`F03.recommended-hides-added`).** `control-openhands browser count 'testid=recommended-automation-rail-card-news-digest'` is `1`. Import `qa-f03-news.automation.json` (same fixture recipe as Preconditions, with `"name":"Daily news digest"`; it stays disabled), `browser goto /`, `browser wait 'testid=recommended-automation-rail-card-custom-automation'`: the news-digest count is `0`. Delete it on `/automations` (`control-openhands browser goto /automations`, then the Cleanup recipe below with `has-text=Daily news digest`); back on `/` (`control-openhands browser goto /`) the count is `1` again.+- **Activity list (`F03.home-automations-list`, `F03.home-automation-links`).** `control-openhands browser wait '[data-testid^="running-automation-row-"]'`, `control-openhands browser text 'testid=running-automations-list'`: both fixtures with `0 0 1 1 *` and `No activity yet` (`browser screenshot --feature F03.home-automations-list --name list`); no row has a sparkline link yet (the run-bar link is checked after the first run, in the next bullet). `control-openhands browser click '[data-testid^="running-automation-row-"] >> has-text=QA_F03 Beta >> role=link' --expect-url '/automations/[^/?]+'` opens the detail page; after `control-openhands browser goto /`, `control-openhands browser click 'testid=home-automations-manage' --expect-url '/automations$'` opens the dashboard.+- **Row menu, Run now and Cancel (`F03.home-row-menu`, `F03.cancel-in-flight-run`, `F03.home-automation-links`).** Run `control-openhands browser goto /` (the Manage link left the dashboard), then `control-openhands browser click '[data-testid^="running-automation-row-"] >> has-text=QA_F03 Pong >> [data-testid^="running-automation-menu-"]'` and `control-openhands browser snapshot '[data-testid^="running-automation-menu-panel-"]'`: Run now, View, Edit, Turn off, separator, Pin to dashboard. `control-openhands browser click '[data-testid^="running-automation-run-"]' --observe 'role=status'` observes `Automation dispatched`. Reopen the menu: `Run now [disabled]` and **Cancel run**. `control-openhands browser click '[data-testid^="running-automation-cancel-"]'` and `control-openhands browser toasts` reads `Automation run cancelled`; `control-openhands api GET /api/automation/v1/<automation-id>/runs` (id from `browser testids --filter running-automation-row`) shows `CANCELLED`, and after `browser reload` the row reads `Just now · Cancelled`. Pong now has a run: `control-openhands browser click '[data-testid^="running-automation-activity-"] >> role=link' --expect-url '/automations/[^/?]+\?run='` opens it; return with `control-openhands browser goto /`.+- **Tooltip (`F03.home-run-tooltip`).** `control-openhands browser tooltip '[data-testid^="running-automation-row-"] >> has-text=QA_F03 Pong'` returns `QA_F03 Pong`, `Trigger 0 0 1 1 *`, `Status Cancelled`, `Last run Just now`, `Task Cancelled by user`.+- **View and Edit (`F03.home-row-menu`).** From the Beta row menu, `control-openhands browser click '[data-testid^="running-automation-view-"]' --expect-url '/automations/[^/?]+$'` opens the detail page. Back on `/` (`control-openhands browser goto /`), reopen the menu and click `[data-testid^="running-automation-edit-"]`: the **Edit automation** modal shows `browser value 'label=Name'` `QA_F03 Beta`. `control-openhands browser fill 'label=Prompt' 'Reply with the single word: beta2. Do not run any tools.'`, `control-openhands browser click 'testid=edit-automation-save' --observe 'role=status'` (`Automation updated`); `api GET /api/automation/v1/<automation-id>` shows the new prompt. A timeout above 1800 is refused client-side with `Timeout cannot exceed 1800 seconds`.+- **Turn off (`F03.turn-off-confirmation`).** From the Beta row menu click `[data-testid^="running-automation-turn-off-"]`; `control-openhands browser snapshot 'role=dialog'` reads `Turn off "QA_F03 Beta"? It will stop running on its schedule until you turn it back on.` with Cancel and Turn off. `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps it enabled; repeat and `control-openhands browser click 'role=dialog >> role=button[name="Turn off"]'`, `browser reload`: `control-openhands browser count '[data-testid^="running-automation-row-"] >> has-text=QA_F03 Beta'` is `0` and the API shows `enabled: false`. Turn it back on from `/automations` (Preconditions) for the pin checks.+- **Pin (`F03.pinned-automations-grid`).** Run `control-openhands browser goto /` (turning Beta back on left `/automations`); from Pong's row menu click `[data-testid^="running-automation-pin-"]`; `control-openhands browser text 'testid=pinned-automations-dashboard'` shows `Pinned automations`, `QA_F03 Pong`, the prompt, `cron` and the last status; `browser storage --values` holds the id under `oh:home-pinned-automations:<backend>:-`. Pin Beta too; `control-openhands browser eval "[...document.querySelectorAll('[data-testid^=pinned-automation-card-]')].map(e=>e.innerText.split('\n')[0]).join(',')"` is `QA_F03 Pong,QA_F03 Beta`. `control-openhands browser click '[data-testid^="pinned-automation-card-"] >> role=link[name="QA_F03 Pong"]' --expect-url '/automations/[^/?]+$'` opens the detail page.+- **Pinned menu (`F03.pinned-card-menu`).** Run `control-openhands browser goto /` (the Pin bullet ends on Pong's detail page), then `control-openhands browser click '[data-testid^="pinned-automation-card-"] >> has-text=QA_F03 Beta >> [data-testid^="pinned-automation-menu-"]'` lists Run now, View, Edit, Turn off and Unpin from dashboard. `[data-testid^="pinned-automation-run-"]` toasts `Automation dispatched`; reopen and `[data-testid^="pinned-automation-cancel-"]` toasts `Automation run cancelled` (the run is `CANCELLED`). Reopen and click `[data-testid^="unpin-automation-"]`; after `browser reload` only `QA_F03 Pong` is pinned and Beta stays in the list.+- **Pinned links (`F03.pinned-card-links`).** With Pong pinned and run once, `control-openhands browser click '[data-testid^="pinned-automation-card-"] >> has-text=QA_F03 Pong >> [data-testid^="pinned-automation-activity-"] >> role=link' --expect-url '/automations/[^/?]+\?run='` opens the run. Back on `/` (`control-openhands browser goto /`), `control-openhands browser focus '[data-testid^="pinned-automation-card-"] >> role=link[name="QA_F03 Beta"]'`, `control-openhands browser press Enter`, `control-openhands browser wait-url '/automations/[^/?]+$'` opens Beta's detail page (pin Beta again first if it was unpinned).+- **Reorder (`F03.pinned-reorder-drag`).** Run `control-openhands browser goto /` (Pinned links ends on Beta's detail page). With Pong and Beta pinned (order `QA_F03 Pong,QA_F03 Beta`, side by side at desktop), read the Beta handle and Pong card boxes with `control-openhands browser bbox '[data-testid^="pinned-automation-card-"] >> has-text=QA_F03 Beta >> [data-testid^="pinned-automation-drag-"]'` and `control-openhands browser bbox '[data-testid^="pinned-automation-card-"] >> has-text=QA_F03 Pong'`, then drag the handle onto the left fifth of Pong's card: `control-openhands browser drag '[data-testid^="pinned-automation-card-"] >> has-text=QA_F03 Beta >> [data-testid^="pinned-automation-drag-"]' --by -522,0 --steps 20` (at 1440×1000 the handle centre is x≈1065 and Pong's card spans x 486–864). The order eval from the Pin bullet reads `QA_F03 Beta,QA_F03 Pong`, `oh:home-pinned-automations:<backend>:-` lists Beta's id first, and the order survives `browser reload`. Drag Pong's handle the same way to restore. The target form `browser drag <handle> <card> [--position before]` does not reorder (the drop lands before the drag-over position is committed).+- **Backend down (`F03.automations-backend-down`).** `control-openhands service stop automation`, `control-openhands browser reload`, then `browser count` on `testid=running-automations-list`, `testid=pinned-automations-dashboard` and `testid=recommended-automations-rail`: all `0`, no toast, composer usable. `control-openhands restart` and `browser reload` bring them back.++Phone and cleanup:++- **Phone (`F03.phone`).** `control-openhands browser viewport phone`, `control-openhands browser bbox 'testid=pinned-automations-dashboard'` and `... 'testid=running-automations-list'` (358 px wide, `pageHorizontalOverflow` `false`), `browser screenshot --feature F03.phone --name automations` (the banner was checked at phone width in the No-LLM banner bullet). Open Workspace: `control-openhands browser click 'testid=open-workspace-button'`, then `browser bbox 'testid=open-workspace-dialog-body'` is inside the viewport. Folder browser: arrange a long name first with `control-openhands fixture folder --name qa-f03-folder-with-a-name-too-long-for-a-phone` (it lands in `<run>/workspace`), then `control-openhands browser click 'testid=workspace-dropdown'` and `control-openhands browser click 'testid=add-workspaces-button'`; `control-openhands browser eval "(()=>{const b=document.querySelector('[data-testid=folder-browser-entry-workspace] span span.truncate');return b.getBoundingClientRect().width})()"` is greater than `0` (about 67). Run `control-openhands browser click 'testid=folder-browser-up'` twice (now `<run>`) and `control-openhands browser click 'testid=folder-browser-entry-workspace'`, then `control-openhands browser eval "(()=>{const b=document.querySelector('[data-testid=folder-browser-entry-qa-f03-folder-with-a-name-too-long-for-a-phone] span span.truncate');return [b.scrollWidth>b.clientWidth,getComputedStyle(b).textOverflow]})()"`: `[true,"ellipsis"]` (about 109 of 293 px shown). `control-openhands browser screenshot --feature F03.phone --name folder-names` shows each name beside `Folder` under separate `Name` and `Kind` headers, the long one cut to `qa-f03-folder-w…`. Close with `control-openhands browser click 'testid=folder-browser-cancel'` and `control-openhands browser click 'testid=close-open-workspace-dialog'`, then return with `control-openhands browser viewport desktop`.+- **Cleanup (`F03.pinned-automations-grid`).** Delete both fixtures on `/automations` (`control-openhands browser goto /automations`; F21: kebab `role=list >> has-text=Export >> role=button[name="Delete"]`, then `role=heading[name="Delete automation"] >> xpath=.. >> role=button[name="Delete"]`). On `/` (`control-openhands browser goto /`), `browser count 'testid=pinned-automations-dashboard'` is `0` and `browser text 'testid=running-automations-empty-hint'` is `No automations yet. Add one to automate repetitive work.`++## Gotchas++- Once a workspace is confirmed, `open-workspace-button` is not rendered (the preview bar replaces it): a click on it waits the full 30 s. Reopen through `home-git-control-bar-preview`, or reload.+- Folder rows navigate on a single click; there is no path field. The browser starts at the server home, `<run>/private/home`, two levels below `<run>`. After any conversation without a workspace, `<run>/private/home/workspace` exists: it shows as a `workspace` row and, after the next page load, a `workspace` favorite (`folder-browser-sidebar-workspace`), which is not `<run>/workspace`.+- A workspace and its parent can share a name (`workspace`); their test ids differ only by prefix (`manage-workspaces-row-` vs `manage-workspaces-parent-row-`).+- `chat-input` is a contenteditable `div`: it stays editable when the composer is "disabled"; assert the Send button and the absence of a new conversation instead.+- `conversation start` without `--stay` navigates home and loses a picked workspace and plugins; drive the submit button as above.+- Responder **Continue with local setup** writes an `OPENHANDS_URL` secret; delete it so F14 counts stay clean.+- The rail lists about 15 cards (proven ones, then conversation launchers such as `research-brief-writer`); `browser testids` reports only the first few, so check a card with `browser count 'testid=recommended-automation-rail-card-<id>'`. Any automation whose name matches a card (`Daily news digest`) hides that card, so avoid catalog names in fixtures.+- The home draft (`oh:home-prompt-draft`) survives the no-LLM bullets; `browser type` appends to it, so `browser fill 'testid=chat-input' ''` before typing a slash command.+- Imported automations arrive disabled and home lists only enabled ones; turn them on before looking for rows. A run dispatched from home and then cancelled still leaves a `QA_F03 Pong — <date>` conversation in the sidebar.+- With the Agent Server stopped, a reload does not render home at all; trigger the error path before reloading, then `restart`.+- Deleting the last automation leaves its id in the pinned localStorage key (pruning skips an empty list); the grid still hides it.+- Pinned cards reorder only by mouse drag; there is no keyboard or menu alternative. Drive it with `browser drag <handle> --by DX,DY --steps 20`; `browser drag <handle> <target>` reports ok but leaves the order unchanged.+- `VITE_HOME_AUTOMATIONS_DEMO=true` (build-time) swaps the home automation sections for demo data; never verify against such a build.+- Known issue #17936: a failed launch from Home shows three identical error toasts and clears the composer (`F03.create-error-toast`).+- The workspace combobox uses one message for an empty list and for a search with no match: both read `No workspaces yet` (`workspace-dropdown-empty`), with **+ Add Workspace** still below it (#18037).diff --git a/.agents/skills/verify-openhands/references/feature-map/F04-conversation-list.md b/.agents/skills/verify-openhands/references/feature-map/F04-conversation-list.mdnew file mode 100644index 0000000000..fc4a64a39c--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F04-conversation-list.md@@ -0,0 +1,139 @@+# F04 — Conversation list and folders++The expanded sidebar always shows the user's conversations under a+**Conversations** header. Each row opens its conversation and carries a pin and+a ⋮ menu (Rename, Edit tags, Stop, Download, Archive or Unarchive, Delete). The+header has a folder-plus picker that starts a conversation in a chosen+workspace and a **View** menu with layout presets, tag filters, **More+options** (organize, sort, scope, archived, age cutoff, automation filter, row+metadata) and **Delete all**. Grouped by workspace, folders collapse, preview+five rows and start new conversations in place. Preferences, pins, archives and+the workspace each conversation was started in live in this browser's+localStorage.++Source: `src/components/features/sidebar/sidebar-conversation-list.tsx`, `src/components/features/conversation-panel/` (panel, layouts menu, advanced options modal, new-thread picker, folder list/row, pinned section, active filter chips, confirm and tags modals, `conversation-card/`), `src/stores/conversation-panel-preferences-store.ts`, `src/stores/pinned-conversations-store.ts`, `src/stores/archived-conversations-store.ts`, `src/hooks/query/use-paginated-conversations.ts`, `src/hooks/use-download-conversation.ts`, `src/api/conversation-metadata-store.ts`.++## Sub-features++- `F04.empty-state`: with no conversations (By date) the list shows `No conversations found`.+- `F04.view-menu`: the View menu lists the presets By workspace, Recent, Active and Compact (a fresh profile has Recent checked), Filter by tags (`No tags yet` when empty), More options and Delete all (disabled with no conversations); Escape closes it.+- `F04.new-thread-picker`: the folder-plus button lists No workspace, every known workspace, + Add Workspace and Manage Workspaces; picking a row starts a conversation there and opens it.+- `F04.card`: a row shows a status dot, the title and the relative time, links to `/conversations/<id>`, and the open conversation's row is highlighted.+- `F04.card-live-status`: while the agent runs, its row shows the working indicator; once it finishes the row switches to the check mark and the generated title on the next list refresh.+- `F04.list-header`: the header divider appears only while the list is scrolled.+- `F04.organize`: More options → Organize switches between folders (By workspace) and a flat list (By date); the choice survives a reload.+- `F04.grouped-folders`: By workspace shows one folder per known workspace (empty ones included) plus a No workspace folder while any loaded row has no workspace, in any browser.+- `F04.folder-collapse`: a folder heading collapses and expands that folder.+- `F04.collapse-all`: the Conversations header collapses every folder, then expands them all.+- `F04.folder-new-conversation`: a folder's `+` starts a conversation in that workspace and opens it.+- `F04.folder-preview-more`: a folder shows five rows; More shows every loaded row, Less returns to five.+- `F04.folder-reorder`: dragging a folder heading onto another reorders the folders and the order persists.+- `F04.thread-scope`: More options → Threads → Active only hides paused conversations; All threads shows them again.+- `F04.load-more`: 20 conversations load first; Load more fetches the rest and disappears when nothing is left.+- `F04.sort`: Sort by Updated or Created reorders the list.+- `F04.presets`: a preset is checked and survives a reload; Active and Compact hide paused conversations; any manual change reads `More options · Custom`.+- `F04.hide-older`: Hide old conversations offers four cutoffs, persists the choice and hides conversations older than it.+- `F04.automation-filter`: More options → Automations shows all, hides or keeps only automation runs, with its own empty message.+- `F04.tag-filter`: choosing a tag facet narrows the list to rows with that tag (pins exempt) and survives a reload.+- `F04.filter-chips`: active filters show as chips above the list; a chip click removes one, Clear all removes every chip.+- `F04.metadata-toggles`: Repo and branch, Agent / model and Show tags add or remove row chips.+- `F04.hover-preview`: hovering a row for a second shows title, directory, model and creation time, unless Details on hover is off.+- `F04.pin`: the pin moves a row into a Pinned section above the list, survives a reload and unpins from there.+- `F04.pinned-preview-more`: the Pinned section previews five rows; its More shows every pinned row and Less returns to five.+- `F04.card-rename`: ⋮ → Rename edits the title inline; Enter saves, a toast confirms, and the title persists.+- `F04.edit-tags`: ⋮ → Edit tags adds and removes `key: value` tags with validation; Save shows `Tags updated` and the chips persist.+- `F04.edit-tags-remove`: in Edit tags each row's remove button drops that tag; Save persists the removal on the server.+- `F04.tag-overflow`: tags that do not fit on a row collapse into a `+N` chip (aria `Show N more tags`) whose popover lists the hidden tags without opening the conversation; Escape closes it.+- `F04.stop`: ⋮ → Stop Conversation asks for confirmation and pauses the conversation; the item is gone once paused.+- `F04.download`: ⋮ → Download conversation data saves `conversation_<id>.zip`.+- `F04.download-error`: a failed download shows one toast that names the cause and closes the ⋮ menu.+- `F04.archive`: ⋮ → Archive Conversation asks for confirmation, hides and unpins the row, and leaves the conversation if it was open.+- `F04.show-archived-unarchive`: Show archived brings archived rows back with an `Archived` chip; Unarchive restores a row without confirmation.+- `F04.delete`: ⋮ → Delete Conversation asks for confirmation, deletes it on the server and leaves it if it was open.+- `F04.delete-all`: View → Delete all asks for confirmation with a count and deletes every conversation.+- `F04.collapsed-rail`: the collapsed sidebar rail shows no conversation list; expanding brings it back.+- `F04.phone`: at 390 px the list lives in the sidebar drawer, fits the viewport, and picking a row closes the drawer.+- `F04.cloud-picker`: on a Cloud backend the folder-plus picker shows provider tabs and a repository search; a picked repository starts a conversation.+- `F04.start-task-cards`: on a Cloud backend in-progress start tasks show as cards linking to `/conversations/task-<id>`.++## How to get to it (user POV)++- Always visible in the expanded sidebar on every page (`/`, the direct URL `/conversations`, `/conversations/<id>`, settings pages): the **Conversations** section under New Chat / Customize / Automate. At phone width it is inside the drawer opened by `sidebar-mobile-menu-toggle`.+- Header: folder-plus (`conversation-panel-new-thread-picker`, aria "Create thread folder — choose workspace or repository"), **View** (`conversation-layouts-toggle`), and in grouped mode the **Conversations** label itself (`conversations-header-toggle`).+- Row hover: pin (`conversation-pin-toggle-<id>`) and ⋮ (`ellipsis-button`, aria "More options"), which opens `context-menu`. A row with more tags than fit shows a `+N` chip (`conversation-card-tag-overflow`). The Pinned section has its own More/Less (`conversation-panel-pinned-view-more`).+- View → **More options** (`advanced-options-row`) opens `advanced-conversation-options-modal` (Organize, Sort by, Threads `scope-all`/`scope-relevant`, Additional, Automations, Metadata).+- Grouped mode: folder heading (`thread-folder-drag-<suffix>`), folder `+` (aria "Start new conversation in <folder>"), folder **More/Less** (`thread-folder-view-more-<suffix>`).+- No command-menu entry or keyboard shortcut exists for the list.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done), desktop viewport, `deepseek-flash` active for the one prompted conversation.+- `F04.empty-state` and the disabled Delete all are first checked on a run with no conversations (a fresh `launch --new`), and again after `F04.delete-all`.+- Workspaces: `control-openhands fixture git-repo --name qa-f04-repo` and `control-openhands fixture folder --name qa-f04-folder`, then add both through the picker (F03 owns the folder browser): `control-openhands browser click 'testid=conversation-panel-new-thread-picker'`, `control-openhands browser click 'testid=add-workspaces-button'`, `control-openhands browser click 'testid=folder-browser-up'` twice (from `<run>/private/home` to the run directory; check with `browser text 'testid=folder-browser-current-path'`), `control-openhands browser dblclick 'testid=folder-browser-entry-workspace'`, `control-openhands browser click 'testid=folder-browser-add-all-subdirs'`. The picker popover stays open afterwards; `control-openhands browser click 'testid=conversation-panel-new-thread-picker'` closes it.+- A finished conversation, started right after the View menu bullet (the first two bullets need a run with no conversations): `control-openhands conversation start --prompt "Reply with only the word pong. Do not run any tools." --wait --timeout 240`. The model writes the title (`✅ Reply only with pong`, `✅ Reply with pong only`, ...): select its row with `has-text=pong`.+- `F04.load-more` and `F04.folder-preview-more` need more than 20 conversations, at least 6 in one folder. Empty conversations from the folder `+` cost no model call (see `F04.folder-new-conversation`).+- `F04.cloud-picker` and `F04.start-task-cards` are blocked: they need an OpenHands Cloud backend with a connected git provider. The kept rows of `F04.automation-filter` (Only automation runs with real runs) and the hiding effect of `F04.hide-older` need data a fresh run cannot have (an automation-run conversation; a conversation older than one hour).++- **Empty list (`F04.empty-state`).** On a run with no conversations, run `control-openhands browser text 'testid=conversation-panel-empty-state'`. The text is `No conversations found`.+- **View menu (`F04.view-menu`).** Run `control-openhands browser click 'testid=conversation-layouts-toggle'` and `control-openhands browser snapshot 'testid=conversation-layouts-menu'`: radios `By workspace`, `Recent` (`[checked]`), `Active`, `Compact`, items `Filter by tags`, `More options` and `Delete all` (`control-openhands browser attr 'testid=layout-preset-recent-activity' aria-checked` is `true`). With no conversations `control-openhands browser enabled 'testid=delete-all-conversations'` is `false`; after `control-openhands browser click 'testid=tag-filters-section'`, `control-openhands browser text 'testid=tag-filters-empty'` is `No tags yet`. `control-openhands browser press Escape` closes the menu (`browser count 'testid=conversation-layouts-menu'` is `0`).+- **Start in a workspace (`F04.new-thread-picker`).** Run `control-openhands browser goto /`, `control-openhands browser click 'testid=conversation-panel-new-thread-picker'` and `control-openhands browser snapshot 'testid=conversation-panel-new-thread-popover'`: buttons `No workspace`, `qa-f04-folder`, `qa-f04-repo`, `+ Add Workspace`, `Manage Workspaces`. Then `control-openhands browser click 'testid=conversation-panel-new-thread-popover >> testid=launch-workspace >> has-text=qa-f04-repo' --expect-url '/conversations/'` returns `/conversations/<id>`, and `control-openhands conversation list` shows that id with `workspace` ending in `/workspace/qa-f04-repo`. From `/` again, `testid=launch-no-workspace` opens a new conversation whose row sits in the No workspace folder. `control-openhands browser click 'testid=manage-workspaces-button'` opens `testid=manage-workspaces-modal` (F03); Escape closes it.+- **Row opens its conversation (`F04.card`).** From `/` (`control-openhands browser goto /`; the previous bullet's launch left a conversation page, where `--expect-url '/conversations/'` would pass at once) run `control-openhands browser click 'testid=conversation-card >> has-text=pong' --expect-url '/conversations/'`, then `control-openhands browser attr 'testid=conversation-card >> has-text=pong' data-active` (`true`; other rows `false`). `control-openhands browser eval "document.querySelector('[data-testid=conversation-card][data-active=true]').closest('a').getAttribute('href')"` is `/conversations/<id>?backend=default-local`. The finished conversation shows `testid=conversation-status-check`, idle ones `conversation-status-active` (green), paused ones `conversation-status-paused` (grey).+- **Live status (`F04.card-live-status`).** Run `control-openhands conversation start --prompt "Reply with only the word ping. Do not run any tools."` (no `--wait`; one tiny model call), then `control-openhands browser wait 'testid=conversation-panel >> testid=conversation-status-working' --timeout 20000`: the active row (`Conversation <id5>`) shows the working indicator. After `control-openhands conversation wait <id> --timeout 180` reports `finished`, `control-openhands browser wait 'testid=conversation-panel >> [data-testid=conversation-card][data-active=true] >> testid=conversation-status-check' --timeout 60000` succeeds and `control-openhands browser text 'testid=conversation-panel >> [data-testid=conversation-card][data-active=true] >> testid=conversation-card-title'` is the generated title (it varies: `✅ Reply with only ping`, `✅ Reply only ping, no tools`). The row lags the conversation by up to about 40 s (list refresh).+- **Group by workspace (`F04.grouped-folders`).** Run `control-openhands browser click 'testid=conversation-layouts-toggle'`, `control-openhands browser click 'testid=layout-preset-by-workspace'`, then `control-openhands browser snapshot 'testid=conversation-panel'`. Regions `No workspace`, `qa-f04-repo` and `qa-f04-folder` each list their own conversations; a workspace without conversations still gets a folder. Second view in another browser: `control-openhands browser reset`, `control-openhands onboard --skip`, choose By workspace again; the workspace conversations must still be in their folders (currently they all fall into No workspace, a known failure).+- **Collapse one folder (`F04.folder-collapse`).** Run `control-openhands browser click '[data-testid^="thread-folder-drag-ws-"][data-testid$="qa-f04-repo"]'`, `control-openhands browser attr '[data-testid^="thread-folder-drag-ws-"][data-testid$="qa-f04-repo"]' aria-expanded` (`false`) and `control-openhands browser count '[data-testid^="thread-folder-ws-"][data-testid$="qa-f04-repo"] >> testid=conversation-card'` (`0`). Click again: `true` and the cards return.+- **Collapse all (`F04.collapse-all`).** Run `control-openhands browser click 'testid=conversations-header-toggle'`, `control-openhands browser attr 'testid=conversations-header-toggle' aria-expanded` (`false`) and `control-openhands browser count 'testid=conversation-panel-list-scroll >> testid=conversation-card'` (`0`). Click again: `true` and every card is back.+- **New conversation in a folder (`F04.folder-new-conversation`).** Run `control-openhands browser goto /`, then `control-openhands browser click 'role=button[name="Start new conversation in qa-f04-folder"]' --expect-url '/conversations/'` (returns the new `/conversations/<id>`), then `control-openhands browser count '[data-testid^="thread-folder-ws-"][data-testid$="qa-f04-folder"] >> testid=conversation-card'`; it grows by one. Repeating `browser goto /` plus the click for `qa-f04-repo` 18 times arranges the data for the next two bullets.+- **Folder preview (`F04.folder-preview-more`).** With more than five conversations in `qa-f04-repo`, `control-openhands browser count '[data-testid^="thread-folder-ws-"][data-testid$="qa-f04-repo"] >> testid=conversation-card'` is `5` and `control-openhands browser text '[data-testid^="thread-folder-view-more-ws-"][data-testid$="qa-f04-repo"]'` is `More`. Click that button: every loaded row shows and the label is `Less`; click again: `5`.+- **Reorder folders (`F04.folder-reorder`).** In By workspace mode read the order with `control-openhands browser eval "[...document.querySelectorAll('[data-testid^=thread-folder-drag-]')].map(e=>e.textContent.trim())"`, then run `control-openhands browser drag '[data-testid^="thread-folder-drag-ws-"][data-testid$="qa-f04-folder"]' '[data-testid^="thread-folder-drag-ws-"][data-testid$="qa-f04-repo"]' --position before`. The same eval now starts with `qa-f04-folder`, `qa-f04-repo`, also after `browser reload`, and `control-openhands browser eval "JSON.parse(localStorage.getItem('conversation-panel-preferences')).state.groupFolderOrder"` lists the `ws:<path>` keys in that order.+- **Load more (`F04.load-more`).** In By date mode (More options → `testid=organize-chronological`, or the Recent preset) with 22 or more conversations, `control-openhands browser count 'testid=conversation-panel-list-scroll >> testid=conversation-card'` is `20`. Run `control-openhands browser click 'testid=load-more-conversations'` and `control-openhands browser wait 'testid=load-more-conversations' --state detached --timeout 15000`; the count is the total (`23` with 23 conversations). In By workspace mode (`organize-grouped`, then `browser reload`) the same click adds the later rows to their own folders: with the 3 oldest rows in No workspace and none of them loaded, `testid=thread-folder-__none_workspace` appears only after the click and `browser count 'testid=conversation-card'` grows by 3 (6 → 9 with the folder previews). A folder that already shows five rows keeps the extra ones behind its More.+- **Organize (`F04.organize`).** Run `control-openhands browser click 'testid=conversation-layouts-toggle'`, `control-openhands browser click 'testid=advanced-options-row'`, `control-openhands browser snapshot 'testid=advanced-conversation-options-modal'` (sections Organize, Sort by, Threads, Additional, Automations, Metadata), `control-openhands browser click 'testid=organize-chronological'` (`browser attr 'testid=organize-chronological' aria-checked` is `true`), `control-openhands browser click 'testid=advanced-options-close'`, `control-openhands browser reload`, then `control-openhands browser count '[data-testid^=thread-folder-ws-]'`. The count is `0` and the rows form one list; `organize-grouped` brings the folders back.+- **Header divider (`F04.list-header`).** With more rows than fit (By date mode with 20 loaded rows, as Organize leaves it; By workspace mode previews too few rows to scroll), `control-openhands browser eval "document.querySelector('[data-testid=older-conversations-summary]').parentElement.classList.contains('border-border')"` is `false`; after `control-openhands browser scroll 'testid=conversation-panel-list-scroll' --by 300` it is `true`, and `false` again after `--by -300`.+- **Rename (`F04.card-rename`).** Pick the oldest untitled conversation (`b8d99...` from the picker step; the sort check below needs an old one). It is beyond the first 20 rows after a reload, so first run `control-openhands browser click 'testid=load-more-conversations'` and `control-openhands browser wait 'testid=load-more-conversations' --state detached --timeout 15000`. Then run `control-openhands browser scroll 'testid=conversation-card >> has-text=Conversation <id5>'` (the first five characters of its id), `control-openhands browser hover 'testid=conversation-card >> has-text=Conversation <id5>'`, `control-openhands browser click 'testid=conversation-card >> has-text=Conversation <id5> >> testid=ellipsis-button'`, `control-openhands browser click 'testid=context-menu >> testid=edit-button'`, `control-openhands browser fill 'input[data-testid=conversation-card-title]' 'QA_F04 renamed'`, `control-openhands browser press Enter`, then `control-openhands browser toasts` (`Conversation title updated successfully`), `control-openhands browser reload` and `control-openhands browser count 'testid=conversation-card-title >> has-text=QA_F04 renamed'` (`1`).+- **Sort (`F04.sort`).** Under Sort by Updated (default) the just-renamed old conversation is first. Sorting applies to the loaded rows only: after a reload the first page is the 20 most recently updated. In More options run `control-openhands browser click 'testid=sort-created'` and `control-openhands browser click 'testid=advanced-options-close'`; `control-openhands browser eval "[...document.querySelectorAll('[data-testid=conversation-panel-list-scroll] [data-testid=conversation-card-title]')].map(e=>e.textContent)"` now ends with `QA_F04 renamed` (with every page loaded, the older `pong` row comes after it), and the View menu row reads `More options · Custom`. Restore with `testid=layout-preset-recent-activity`.+- **Stop (`F04.stop`).** On an idle row open ⋮ and run `control-openhands browser click 'testid=context-menu >> testid=stop-button'`; `control-openhands browser snapshot 'role=dialog'` reads `Confirm Stop Conversation`, `Are you sure you want to stop this conversation?`. `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps it idle (`control-openhands conversation status <id>`). Repeat and click `'role=dialog >> role=button[name="Confirm Close"]'`; `control-openhands conversation wait <id> --until paused --timeout 30` reaches `paused`, `control-openhands browser wait 'testid=conversation-card >> has-text=Conversation <id5> >> testid=conversation-status-paused'` succeeds, and the reopened ⋮ menu has no Stop item. `control-openhands browser press Escape` closes it (`browser count 'testid=context-menu'` is `0`) and puts focus back on the row's ⋮ (`control-openhands browser eval "document.activeElement.dataset.testid"` is `ellipsis-button`).+- **Presets (`F04.presets`).** Run `control-openhands browser click 'testid=conversation-layouts-toggle'`, `control-openhands browser click 'testid=layout-preset-recent-activity'`, `control-openhands browser reload`, reopen the menu, then `control-openhands browser attr 'testid=layout-preset-recent-activity' aria-checked` (`true`) and `control-openhands browser text 'testid=advanced-options-row'` (`More options`). With the paused conversation from Stop (above), `testid=layout-preset-focused` (Active) and `testid=layout-preset-minimal` (Compact) make `control-openhands browser count 'testid=conversation-card >> has-text=Conversation <id5>'` `0`; Recent shows it again.+- **Threads scope (`F04.thread-scope`).** With the paused conversation from Stop and the Recent preset, open More options and run `control-openhands browser click 'testid=scope-relevant'` (`browser attr 'testid=scope-relevant' aria-checked` is `true`) and `control-openhands browser click 'testid=advanced-options-close'`: `control-openhands browser count 'testid=conversation-card >> has-text=Conversation <id5>'` is `0`, also after `browser reload`, and the View menu now checks no preset and reads `More options · Custom` (Recent shows old conversations; the Active preset also hides them). `testid=scope-all` brings the row back (`1`) and Recent is checked again.+- **Hide older (`F04.hide-older`).** In More options, `control-openhands browser attr 'testid=toggle-older-conversations' aria-checked` is `false` (Recent shows conversations of every age) and `control-openhands browser text 'testid=older-conversation-cutoff'` is `Over 1 week`. Run `control-openhands browser click 'testid=older-conversation-cutoff'` (radios Over 1 hour, Over 1 day, Over 1 week, Over 30 days), `control-openhands browser click 'role=menuitemradio[name="Over 1 hour"]'`, then `control-openhands browser click 'testid=toggle-older-conversations >> text=Hide old conversations'` (`aria-checked` turns `true`; a click on the row's center lands on the cutoff dropdown instead), `control-openhands browser click 'testid=advanced-options-close'`, `control-openhands browser reload`, then `control-openhands browser storage --values`: `conversation-panel-preferences` holds `"showOlderConversations":false` and `"olderConversationCutoff":"1h"`, and the View menu reads `More options · Custom`. Restore with `testid=layout-preset-recent-activity` (it turns hiding off but keeps the cutoff) and the cutoff `Over 1 week`. Hiding itself needs a conversation last updated before the cutoff (not reachable on a fresh run).+- **Automation filter (`F04.automation-filter`).** In More options run `control-openhands browser click 'testid=automation-filter-only'` and `control-openhands browser click 'testid=advanced-options-close'`; with no automation runs `control-openhands browser text 'testid=conversation-panel-empty-state'` is `No conversations match the automation filter` (Load more stays). `testid=automation-filter-hide` keeps every manual conversation; `testid=automation-filter-all` restores the default. Unpin everything first: a pinned row suppresses the empty state.+- **Row metadata (`F04.metadata-toggles`).** In More options click `testid=toggle-repo-branch-metadata`, `testid=toggle-llm-profiles` and `testid=toggle-tags-metadata`, then `testid=advanced-options-close`. `control-openhands browser testids 'testid=conversation-card >> has-text=Conversation <id5>'` lists `conversation-card-workspace-folder` (`qa-f04-repo`) and `conversation-card-agent-chip` (`deepseek-flash`) and no `conversation-card-tag-chip`. Restore with `testid=layout-preset-recent-activity` (presets reset all metadata toggles).+- **Hover preview (`F04.hover-preview`).** Run `control-openhands browser mouse-click 900 900`, then `control-openhands browser tooltip 'testid=conversation-card >> has-text=Conversation <id5>'`. The text is the title, `Directory` with the workspace path, `Model` `deepseek/deepseek-flash` and `Created` with a date. After `testid=toggle-hover-metadata` is off (`aria-checked` `false`), `control-openhands browser tooltip ... --timeout 5000` finds no tooltip.+- **Pin (`F04.pin`).** Run `control-openhands browser hover 'testid=conversation-card >> has-text=QA_F04 renamed'`, `control-openhands browser click 'testid=conversation-card >> has-text=QA_F04 renamed >> [data-testid^=conversation-pin-toggle-]'`, then `control-openhands browser text 'testid=conversation-panel-pinned-section'` (`Pinned` and the row), `control-openhands browser count 'testid=conversation-card >> has-text=QA_F04 renamed'` (`1`: not duplicated) and, after `browser reload`, `control-openhands browser attr 'testid=conversation-panel-pinned-section >> [data-testid^=conversation-pin-toggle-]' aria-pressed` (`true`). Unpin with `browser hover` and `browser click` on `testid=conversation-panel-pinned-section >> testid=conversation-card` and its `[data-testid^=conversation-pin-toggle-]`; after a reload `browser count 'testid=conversation-panel-pinned-section'` is `0`.+- **Pinned preview (`F04.pinned-preview-more`).** Pin six rows (`browser scroll`, `browser hover`, then click each row's `[data-testid^=conversation-pin-toggle-]`). `control-openhands browser count 'testid=conversation-panel-pinned-section >> testid=conversation-card'` is `5` and `control-openhands browser text 'testid=conversation-panel-pinned-view-more'` is `More`; `control-openhands browser click 'testid=conversation-panel-pinned-view-more'` makes the count `6` and the label `Less`; click again: `5`. Unpin all six with `browser hover` and a pin click on `'testid=conversation-panel-pinned-section >> testid=conversation-card >> nth=0'`, repeated.+- **Edit tags (`F04.edit-tags`).** Open ⋮ on a row (hover, `testid=ellipsis-button`) and run `control-openhands browser click 'testid=context-menu >> testid=edit-tags-button'`. Then: `control-openhands browser fill 'testid=new-tag-key-input' 'Bad Key'` and `control-openhands browser press Enter --selector 'testid=new-tag-key-input'` → `control-openhands browser text 'testid=edit-tags-error'` is `Tag names may only contain lowercase letters and numbers`; key `title` with `testid=add-tag-button` → `This tag name is reserved`; key `qaenv`, `browser fill 'testid=new-tag-value-input' one`, Enter → `browser count 'testid=edit-tag-row-qaenv'` is `1`; key `qaenv` again → `This tag name is already in use`; key `qalong` with a 257-character value → `Tag values must be 256 characters or fewer`; key `qabare` with an empty value left in the inputs, then `control-openhands browser click 'testid=edit-conversation-tags-modal >> testid=confirm-button'`. `control-openhands browser toasts` shows `Tags updated`; after `browser reload` the row shows chips `Qabare` and `Qaenv: one` (`conversation-card-tag-chip`), and `control-openhands api GET '/api/conversations/search?limit=3'` has tags `qaenv: one`, `qabare: ""`.+- **Tag overflow (`F04.tag-overflow`).** On the tagged row add three more tags in Edit tags (keys `qaregion`, `qastage`, `qaowner`, values `value-for-<key>`, Enter after each) and save. After `browser reload` the row shows `Qabare` and `Qaenv: one` plus `control-openhands browser text 'testid=conversation-card >> has-text=Conversation <id5> >> testid=conversation-card-tag-overflow'` `+3` (aria-label `Show 3 more tags`). Clicking it keeps the URL, sets `aria-expanded` `true`, and `control-openhands browser text 'testid=conversation-card-tag-overflow-popover'` lists `Qaowner value-for-qaowner`, `Qaregion …`, `Qastage …` (3 `conversation-card-tag-overflow-row`); `control-openhands browser press Escape` closes it (count `0`).+- **Remove tags (`F04.edit-tags-remove`).** Reopen Edit tags on that row and run `control-openhands browser click 'testid=remove-tag-qaregion'` (likewise `remove-tag-qastage`, `remove-tag-qaowner`); `control-openhands browser count 'testid=edit-tags-rows >> [data-testid^=edit-tag-row-]'` is `2`. Save with `testid=edit-conversation-tags-modal >> testid=confirm-button` (`Tags updated`); after `browser reload` the `+3` chip is gone and `control-openhands api GET '/api/conversations/search?limit=1' --pick items.0.tags` is `clientsource`, `qabare`, `qaenv` only.+- **Tag filter (`F04.tag-filter`).** After Edit tags (above) gave one row `qaenv=one`, run `control-openhands browser click 'testid=conversation-layouts-toggle'`, `control-openhands browser click 'testid=tag-filters-section'`, `control-openhands browser click 'testid=tag-facet-row-qaenv=one'` (`aria-checked` `true`; the menu stays open), `control-openhands browser press Escape`, then `control-openhands browser count 'testid=conversation-panel-list-scroll >> testid=conversation-card'`: only the tagged row plus pinned rows. The count is the same after `browser reload`.+- **Filter chips (`F04.filter-chips`).** With the facet active, `control-openhands browser text 'testid=conversation-active-tag-filters'` is `qaenv=one` and `Clear all`. `control-openhands browser click 'testid=active-tag-filter-qaenv=one'` removes it (`browser count 'testid=conversation-active-tag-filters'` is `0`). Select `tag-facet-row-qaenv=one` and `tag-facet-row-qabare=` again, then `control-openhands browser click 'testid=clear-tag-filters'`: the strip disappears and the full list returns.+- **Download (`F04.download`).** Open ⋮ and run `control-openhands browser click 'testid=context-menu >> testid=download-trajectory-button'`, then `control-openhands browser downloads`. A file `…-conversation_<id>.zip` lands in `<run>/private/downloads`; `control-openhands browser downloads --last 1 --inspect` lists `<id-hex>/base_state.json` and `meta.json` for any row, plus event folders such as `bash_events/` for a conversation that ran (the `pong` row; it is the oldest, so Load more first).+- **Download failure (`F04.download-error`).** With ⋮ already open on a row, run `control-openhands browser errors --clear` and `control-openhands service stop agent-server`, click `testid=context-menu >> testid=download-trajectory-button`, then `control-openhands browser toasts --history` and `control-openhands browser count 'testid=context-menu'`. There is exactly one toast, `Couldn't download the conversation data: <cause>` (with the server down the cause is the transport text `HTTP request failed (502 Bad Gateway): "Bad Gateway: connect ECONNREFUSED 127.0.0.1:<port>"`), and the menu is closed (`0`). `control-openhands browser errors --app-only` has `pageErrors` `0`; its 502 request and console error are the outage itself. Run `control-openhands restart` and `control-openhands doctor` afterwards.+- **Archive (`F04.archive`).** Open a conversation from its row, open ⋮ and run `control-openhands browser click 'testid=context-menu >> testid=archive-button'`; `control-openhands browser snapshot 'role=dialog'` reads `Archive conversation` and `Archive "<title>"? The conversation stays available with its full history and can be restored from Show archived.` `control-openhands browser click 'role=dialog >> testid=cancel-button'` keeps the row. Repeat and `control-openhands browser click 'role=dialog >> testid=confirm-button' --expect-url '/conversations(\?|$)'`; the row count is `0`, also after `browser reload`. Archiving a pinned row removes the Pinned section.+- **Show archived and Unarchive (`F04.show-archived-unarchive`).** In More options click `testid=toggle-show-archived` (`aria-checked` `true`) and `testid=advanced-options-close`; `control-openhands browser count 'testid=conversation-card >> has-text=Conversation <id5> >> testid=conversation-card-archived-chip'` is `1` and the ⋮ menu offers `Unarchive Conversation`. `control-openhands browser click 'testid=context-menu >> testid=unarchive-button'` opens no dialog (`browser count 'role=dialog'` `0`) and the chip count drops to `0`. Turn Show archived off again.+- **Delete (`F04.delete`).** Open a conversation from its row, open ⋮ and run `control-openhands browser click 'testid=context-menu >> testid=delete-button'`; the dialog reads `Confirm Delete` and `Are you sure you want to delete the "<title>" conversation? This action cannot be undone.` `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps the row. Repeat and `control-openhands browser click 'role=dialog >> role=button[name="Confirm Delete"]' --expect-url '/conversations(\?|$)'`; after `browser reload` the row count is `0` and `control-openhands api GET /api/conversations/<id>` is `404`.+- **Phone (`F04.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /`, `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'`, then `control-openhands browser bbox 'testid=sidebar-mobile-drawer >> testid=conversation-panel'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F04.phone --name drawer`. Hover a row in the drawer and click its `testid=ellipsis-button`; `control-openhands browser bbox 'testid=context-menu'` is inside the viewport. `control-openhands browser mouse-click 380 20` closes the menu (`browser count 'testid=context-menu'` `0`) and the drawer (`control-openhands browser wait 'testid=sidebar-mobile-drawer' --state hidden --timeout 5000`; an immediate `visible` still reads `true` during the slide-out). Reopen the drawer and `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=conversation-card >> has-text=QA_F04 renamed' --expect-url '/conversations/'`; `control-openhands browser wait 'testid=sidebar-mobile-drawer' --state hidden --timeout 5000` succeeds. Return with `control-openhands browser viewport desktop`.+- **Delete all (`F04.delete-all`).** Run `control-openhands browser click 'testid=conversation-layouts-toggle'`, `control-openhands browser click 'testid=delete-all-conversations'` and `control-openhands browser snapshot 'role=dialog'`: `Delete all conversations`, `Are you sure you want to delete N conversations?`. Cancel keeps every row. Confirm with `control-openhands browser click 'role=dialog >> role=button[name="Confirm Delete"]'` and `control-openhands browser wait 'role=dialog' --state detached --timeout 30000`; `control-openhands api GET '/api/conversations/search?limit=100'` has no items, Delete all is disabled again, and in By date mode the empty state returns. Expected for every conversation; today N and the deletion cover only the loaded pages (22 conversations, 20 loaded: 2 remain).+- **Collapsed rail (`F04.collapsed-rail`).** Run `control-openhands browser click 'testid=sidebar-collapse-toggle'`, then `control-openhands browser count 'testid=conversation-panel'` (`0`). Expand with `control-openhands browser click 'aside[data-collapsed]'` (see F02); the count is `1`.+- **Cloud picker and start tasks (`F04.cloud-picker`, `F04.start-task-cards`).** Blocked without an OpenHands Cloud backend and git provider. On Cloud, the same `conversation-panel-new-thread-picker` opens `cloud-provider-tabs`, `cloud-repo-search-input` (`Search repositories`) and `launch-repository` rows; start tasks render `testid=start-task-card` linking to `/conversations/task-<id>`.+- **Cleanup.** View → Delete all twice (the second pass removes the rows the first left behind), until `api GET '/api/conversations/search?limit=100'` is empty; re-apply the Recent preset. Fixture folders and the workspace registry vanish with the run.++## Gotchas++- A plain `--expect-url '/conversations/'` returns at once when the browser is already on a conversation page. Start creation clicks from `/` (`browser goto /`), and never navigate away before the click returns: leaving early skips the client-side metadata write, so the new conversation lands in **No workspace** although the server has its working directory.+- Workspace grouping, pins, archives and preferences live in this browser's localStorage (`openhands-agent-server-conversation-metadata`, `pinned-conversations`, `archived-conversations`, `conversation-panel-preferences`). `browser reset` loses them: archived rows reappear and every conversation moves to No workspace.+- Folder test ids embed the sanitized absolute workspace path (`thread-folder-ws--tmp-...-qa-f04-repo`). Select with `[data-testid^="thread-folder-ws-"][data-testid$="<folder>"]` or by the `+` button's accessible name.+- Row links carry `?backend=default-local`; anchor URL regexes without `$`.+- Hover and ⋮ need the row on screen: `browser scroll '<row>'` first, and `browser hover` before clicking `ellipsis-button` or the pin.+- Escape closes the ⋮ menu and returns focus to its ⋮ button (#18044); an outside `browser mouse-click` closes it too. If Tab has moved focus to the next row's link, that row's preview tooltip opens and takes the first Escape, so press Escape twice. Inside the phone drawer the first Escape closes the menu and the next one the drawer.+- The Stop, Delete and Delete all dialogs have no test ids on their buttons (`data-testid` is dropped by `BrandButton`) (#17915); use `role=dialog >> role=button[name="..."]`. The Archive and Edit tags dialogs do have `cancel-button` and `confirm-button`.+- With the drawer open at phone width there are two `conversation-panel` elements; scope with `testid=sidebar-mobile-drawer >> ...`.+- Recent is exactly the fresh default layout (By date, Updated, all threads, old conversations shown), so a new user sees Recent checked. Active and Compact also turn on Hide old conversations: Recent plus a manual Threads → Active only reads `More options · Custom`, not Active. Presets never change the hide-older cutoff.+- In By workspace mode Load more often adds no visible row: later rows join existing folders behind their More button.+- By workspace never shows `No conversations found` while any workspace is registered: empty workspace folders stay.+- Pinned rows bypass tag and automation filters and suppress the filtered empty states; unpin before asserting them.+- The page size is 20; filters, Active scope and archives apply only to loaded pages.+- The ⋮ menu offers Stop for idle and finished conversations too (they count as active); it disappears only once paused.+- `service stop agent-server` needs `control-openhands restart` and a `browser reload` before anything else works.+- The list refreshes on an interval: a row keeps `conversation-status-working` and `Conversation <id5>` for up to about 40 s after the conversation finished. Use `browser wait ... --timeout 60000`, not an immediate `count`.+- Model-written titles vary from run to run; match finished conversations on a word from the prompt (`has-text=pong`), never on the whole title.+- Known issue #17919: Delete all deletes only the loaded pages, and its dialog states that smaller count (`F04.delete-all`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F05-composer.md b/.agents/skills/verify-openhands/references/feature-map/F05-composer.mdnew file mode 100644index 0000000000..1432a53c0b--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F05-composer.md@@ -0,0 +1,98 @@+# F05 — Composer, slash commands and plan mode++The composer is the input box at the bottom of the home page and of every+conversation. A user types a message (Enter sends, Shift+Enter adds a line),+attaches files and images, picks the LLM profile for the running conversation,+watches and compacts the context window, stops and resumes the agent, and types+`/` for built-in commands (`/btw`, `/model`, `/goal`, `/plan`, `/code`) and+skills. `/plan` hands the next message to a planning agent whose PLAN.md card+can be viewed and built; Ctrl/Cmd+Enter builds it.++Source: `src/components/features/chat/`, `src/components/features/controls/tools-context-menu.tsx`, `src/components/features/controls/agent-status.tsx`, `src/hooks/chat/`, `src/utils/constants.ts`.++## Sub-features++- `F05.send-message`: Send is disabled while the field is empty; Shift+Enter inserts a newline; Enter sends, clears the field and the message persists after reload.+- `F05.draft-persistence`: unsent text is restored per conversation (after navigation and reload) and on the home composer.+- `F05.composer-resize`: the field grows with its content and shrinks when cleared; a top-edge grip lets the user drag the height.+- `F05.plus-menu`: `+` opens a tools menu (Macros, Show skills/hooks/agent tools, Add Files and Images; Git tools in a repository); a macro fills the composer without sending.+- `F05.agent-profile-switch`: before a conversation starts, `+` > Switch agent profile lists agent profiles and links to Manage agent profiles; it is absent in a started conversation.+- `F05.attach-files`: picked files show as chips and images as thumbnails (with an Upload-as-file toggle), each removable; sent files land in the workspace and are named in the message.+- `F05.attach-size-limit`: a file over 3 MB, or a selection over 3 MB in total, is refused with an error toast.+- `F05.paste`: pasted clipboard text is inserted as plain text; pasted images and dropped files attach.+- `F05.dictation`: the mic button dictates into the composer; without a microphone it toasts a failure and resets.+- `F05.llm-profile-picker`: the model pill switches the running conversation's LLM profile; the next reply uses the new model.+- `F05.overflow-menu`: at very narrow widths the model pill collapses into a "More input actions" menu whose Model submenu fits the viewport and switches the profile.+- `F05.context-window-meter`: the ring shows context use; its popover opens the Usage tab and compacts the context.+- `F05.stop-resume`: Stop pauses a running agent (status `Stopped`, Play button); Play resumes it.+- `F05.queued-message`: a follow-up typed while the agent runs is accepted and answered.+- `F05.slash-menu`: `/` opens a filtered command list (built-ins and skills) with arrow, Tab/Enter and Escape handling.+- `F05.slash-model`: `/model` lists saved profiles; `/model <name>` switches profile.+- `F05.slash-btw`: `/btw <question>` answers a side question in a dismissible card without adding to the main stream; a bare `/btw` toasts that a question is needed.+- `F05.slash-goal`: `/goal [--max N] <objective>` runs a judged goal loop with a status banner, Stop and Resume; only the newest goal status offers Resume.+- `F05.slash-plan-code`: `/plan` switches to plan mode (a planner sub-conversation), `/code` switches back.+- `F05.slash-plan-code-task`: `/code <task>` switches to code mode and sends `<task>` to the code agent at once; `/plan <task>` switches to plan mode and sends `<task>` to the existing planner.+- `F05.plan-preview`: the planner's Plan.md card shows the plan with Read more, View (Planner tab) and Build.+- `F05.build-plan-shortcut`: Ctrl/Cmd+Enter in plan mode builds the plan with the code agent.+- `F05.phone`: the composer fits a 390 px viewport with every control inline.++## How to get to it (user POV)++- Home page composer (`/`) and the composer of any conversation (`/conversations/<id>`, reached from the sidebar conversation list or by URL).+- `+` (More actions, `chat-plus-button`) inside the composer opens the tools menu; its last item **Add Files and Images** opens the native file picker (`upload-image-input`).+- Model pill (`chat-input-llm-profile`) next to `+`; at 320 px it moves into the vertical-dots **More input actions** button.+- Right side of the composer: status text with Stop/Play, context ring (`context-window-meter`), mic (`chat-dictation-button`), Send (`submit-button`).+- Typing `/` at the start of a word opens the slash menu (`slash-command-menu`); `/plan` and `/code` are the only mode switches on the local backend (the Code/Plan pill is Cloud only).+- Keyboard: Enter sends, Shift+Enter newline, Ctrl+Enter / Cmd+Enter builds a plan; Escape closes the slash menu.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` (profiles `deepseek-flash` active and `deepseek-pro`). Every recipe except `F05.agent-profile-switch` and the home draft needs a model.+- A conversation to type into: `control-openhands conversation start --prompt "Reply with only: ok" --wait --timeout 240` prints `id` (`<id>` below) and leaves the browser on `/conversations/<id>`.+- Attachment fixtures: `control-openhands fixture image --name qa-image` and `control-openhands fixture file --name qa-note.txt --content "QA attachment 7731"` (both land in `$OH_VERIFY_RUN/evidence/_fixtures/`).+- Desktop viewport unless a bullet says otherwise. Microphone dictation is blocked in the sandbox browser (no microphone); `+` > Git tools needs a conversation on a git workspace (not driven here).++- **Type and send (`F05.send-message`).** On `/conversations/<id>` run `control-openhands browser attr 'testid=submit-button' aria-label` (`Send message`), `control-openhands browser enabled 'testid=submit-button'` (`false`), `control-openhands browser type 'testid=chat-input' 'Reply with only:'`, `control-openhands browser enabled 'testid=submit-button'` (`true`), `control-openhands browser press Shift+Enter`, `control-openhands browser type 'testid=chat-input' 'ok2'` and `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerText"`: `Reply with only:\nok2`. Run `control-openhands browser press Enter --selector 'testid=chat-input'`; the field is empty and `control-openhands browser count 'testid=stop-button'` is `1` while the agent runs. Then `control-openhands conversation wait <id> --fresh --timeout 180` (a fast model can finish before a separate `--until running` wait starts, which then times out on `finished`), `control-openhands browser reload` and `control-openhands browser count 'testid=user-message >> has-text=ok2'`: `1`; `control-openhands browser text 'testid=agent-message >> nth=-1'` is `ok2`.+- **Draft survives navigation (`F05.draft-persistence`).** Run `control-openhands browser type 'testid=chat-input' 'QA draft text'` and wait out the 500 ms save: `control-openhands browser eval "new Promise(r=>setTimeout(()=>r(JSON.parse(localStorage.getItem('conversation-state-<id>')).draftMessage),1500))"` returns `QA draft text`. Then `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url settings`, `control-openhands browser back` and the `innerText` eval above: `QA draft text`. `control-openhands browser reload` restores it again. Clear with `control-openhands browser fill 'testid=chat-input' ''` and wait a second before navigating.+- **Home draft (`F05.draft-persistence`).** Run `control-openhands browser goto /`, `control-openhands browser type 'testid=chat-input' 'QA home draft'`, `control-openhands browser goto /settings/secrets`, `control-openhands browser goto /`, then the `innerText` eval: `QA home draft`; `control-openhands browser storage --session` lists `oh:home-prompt-draft`. Clear with `control-openhands browser fill 'testid=chat-input' ''`.+- **Auto-resize (`F05.composer-resize`).** On `/conversations/<id>` (`control-openhands browser goto /conversations/<id>`; Home draft left `/`) type `line`, then eight times `control-openhands browser press Shift+Enter` and `control-openhands browser type 'testid=chat-input' 'lineN'` (`line2`…`line9`): `control-openhands browser bbox 'testid=chat-input'` grows by 20 px per line, from `height` `20` to `180`; after `control-openhands browser fill 'testid=chat-input' ''` it is `20`. `control-openhands browser count '#resize-grip'` is `1`. `control-openhands browser drag '#resize-grip' --by 0,-200` makes the empty field `220` high and `control-openhands browser drag '#resize-grip' --by 0,150` brings it to `70`; after `control-openhands browser reload` it is `20` again (the dragged height is not kept).+- **Tools menu and macros (`F05.plus-menu`).** On `/conversations/<id>` run `control-openhands browser click 'testid=chat-plus-button'` and `control-openhands browser testids 'testid=tools-context-menu'`: `macros-button`, `show-skills-button`, `show-hooks-button`, `show-agent-tools-button`, `add-files-and-images-button` (no `git-tools-button` outside a repository). `control-openhands browser hover 'testid=macros-button'` shows `macros-submenu` with `increase-test-coverage-button`, `fix-readme-button`, `auto-merge-prs-button`, `clean-dependencies-button`. `control-openhands browser click 'testid=fix-readme-button'` closes the menu and fills the composer with `Please look at the README and make the following improvements…`; the `testid=user-message` count is unchanged. Clear with `control-openhands browser fill 'testid=chat-input' ''`.+- **Show dialogs (`F05.plus-menu`).** For each of `show-skills-button`, `show-hooks-button`, `show-agent-tools-button`: `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser click 'testid=show-hooks-button'` (etc.), `control-openhands browser text 'role=dialog'` (starts `Available Skills`, `Available Hooks`, `Agent Tools & Metadata`), then `control-openhands browser press Escape` and `control-openhands browser count 'role=dialog'`: `0`.+- **Agent profile before start (`F05.agent-profile-switch`).** Run `control-openhands browser goto /`, `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser hover 'testid=switch-agent-profile-button'` and `control-openhands browser text 'testid=agent-profile-submenu'`: `AVAILABLE PROFILES`, `default` (checked; `chat-input-agent-profile-option-default`), `Manage agent profiles`. `control-openhands browser click 'testid=agent-profile-submenu >> text=Manage agent profiles' --expect-url 'settings/agents'` lands on `/settings/agents`. In a started conversation (`control-openhands browser goto /conversations/<id>`) `control-openhands browser click 'testid=chat-plus-button'` then `control-openhands browser count 'testid=switch-agent-profile-button'` is `0`.+- **Attach a file and an image (`F05.attach-files`).** On `/conversations/<id>` run `control-openhands browser upload 'testid=upload-image-input' "$OH_VERIFY_RUN/evidence/_fixtures/qa-image.png" "$OH_VERIFY_RUN/evidence/_fixtures/qa-note.txt"` and `control-openhands browser screenshot 'testid=interactive-chat-box' --feature F05.attach-files --name attached`: a `qa-note.txt TXT` chip and a thumbnail. `control-openhands browser count 'testid=interactive-chat-box >> alt=qa-image.png'` is `1`. `control-openhands browser click 'role=button[name="Upload as file"]'` turns the image toggle into `Do not upload as file` (`control-openhands browser attr 'role=button[name="Do not upload as file"]' aria-pressed` is `true`); click it again to restore. The remove buttons are named: `control-openhands browser snapshot 'testid=interactive-chat-box'` lists `button "Remove qa-note.txt"` and `button "Remove image"`. Remove the image with `control-openhands browser click 'testid=interactive-chat-box >> role=button[name="Remove image"]'`; the `alt=qa-image.png` count is `0`. Then `control-openhands browser type 'testid=chat-input' 'Reply with only the content of the attached file.'`, `control-openhands browser press Enter --selector 'testid=chat-input'`, wait as in Type and send, and `control-openhands browser text 'testid=user-message >> nth=-1'`: it ends `NEW FILES ADDED: qa-note.txt`. `control-openhands conversation events <id> --kinds MessageEvent --last 3` shows the reply `QA attachment 7731`, and `qa-note.txt` sits in the conversation `workspace` printed by `control-openhands conversation status <id>`.+- **Size limit (`F05.attach-size-limit`).** Arrange `head -c 4194304 /dev/zero > "$OH_VERIFY_RUN/evidence/_fixtures/qa-big.bin"` (and `qa-two-a.bin`, `qa-two-b.bin` with `head -c 2097152`). Run `control-openhands browser upload 'testid=upload-image-input' "$OH_VERIFY_RUN/evidence/_fixtures/qa-big.bin"` and `control-openhands browser toasts`: `Error: Files exceeding 3MB are not allowed: qa-big.bin`. Uploading `qa-two-a.bin` and `qa-two-b.bin` together toasts `Error: Total file size would be 4.0MB, exceeding the 3MB limit. Please select fewer or smaller files.` `control-openhands browser count 'testid=interactive-chat-box >> text=qa-big.bin'` is `0`.+- **Paste text (`F05.paste`).** Run `control-openhands browser type 'testid=chat-input' 'QA paste text'`, `control-openhands browser press Control+a`, `control-openhands browser press Control+c`, `control-openhands browser press Delete`, `control-openhands browser press Control+v`, then `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerHTML"`: `QA paste text`, no markup. On a cleared field `control-openhands browser paste 'testid=chat-input' --file "$OH_VERIFY_RUN/evidence/_fixtures/qa-image.png"` attaches the image (`control-openhands browser count 'testid=interactive-chat-box >> alt=qa-image.png'` is `1`, with an `Upload as file` toggle) and `control-openhands browser paste 'testid=chat-input' --text 'QA pasted plain'` inserts plain text (`innerHTML` is `QA pasted plain`). `control-openhands browser drop-files 'testid=chat-input' "$OH_VERIFY_RUN/evidence/_fixtures/qa-note.txt" --stage over` makes `control-openhands browser text 'testid=interactive-chat-box'` start `Drop your files here`; the same command without `--stage` drops it: a `qa-note.txt` `TXT` chip appears. Remove the chip with `control-openhands browser click 'testid=interactive-chat-box >> role=button[name="Remove qa-note.txt"]'` and the image as in Attach; clear the field.+- **Dictation failure (`F05.dictation`).** Run `control-openhands browser click 'testid=chat-dictation-button' --observe '[role=status]' --observe-ms 3000`: the observed toasts include `Dictation failed. Check microphone access and your voice input settings.` and `control-openhands browser attr 'testid=chat-dictation-button' aria-label` is back to `Start dictation`. Real dictation is blocked without a microphone.+- **Switch LLM profile (`F05.llm-profile-picker`).** Run `control-openhands browser click 'testid=chat-input-llm-profile'` and `control-openhands browser text 'testid=chat-input-llm-profile-popover'`: `AVAILABLE PROFILES`, `deepseek-flash` / `deepseek/deepseek-flash`, `deepseek-pro` / `deepseek/deepseek-v4-pro`, `LLM Profiles`. Run `control-openhands browser click 'testid=chat-input-llm-profile-option-deepseek-pro'`, `control-openhands browser wait-text 'Switched to profile' --timeout 15000`, `control-openhands browser text 'testid=chat-input-llm-profile'` (`deepseek-pro`) and `control-openhands conversation status <id>` (`model` is `deepseek/deepseek-v4-pro`). Send `Reply with only: pro-ok` as in Type and send; the reply is `pro-ok`. After `control-openhands browser reload` the pill still reads `deepseek-pro`. Switch back with `control-openhands browser click 'testid=chat-input-llm-profile'` and `control-openhands browser click 'testid=chat-input-llm-profile-option-deepseek-flash'`.+- **Overflow menu (`F05.overflow-menu`).** Run `control-openhands browser viewport narrow` and `control-openhands browser snapshot 'testid=interactive-chat-box'`: the model pill is gone and `button "More input actions"` appears (at `phone` and `350x800` the pill stays inline). `control-openhands browser click 'role=button[name="More input actions"]' --observe '[data-testid=chat-input-overflow-menu]' --observe-ms 1000`: `observed` goes from `<absent>` to `Model` (the menu appears in the observed sequence; its delay varies from run to run, so do not assert a time) and has no later `<absent>`. `control-openhands browser count 'testid=chat-input-overflow-menu'` is `1` and `control-openhands browser attr 'role=button[name="More input actions"]' aria-expanded` is `true`. Run `control-openhands browser click 'testid=overflow-model-button'`; `control-openhands browser text 'testid=chat-input-overflow-menu'` reads `Model`, `AVAILABLE PROFILES`, `deepseek-flash` / `deepseek/deepseek-flash`, `deepseek-pro` / `deepseek/deepseek-v4-pro`, `LLM Profiles`. Run `control-openhands browser bbox 'testid=chat-input-llm-profile-option-deepseek-flash'` and `control-openhands browser bbox 'role=link[name="LLM Profiles"]'`. Expected: both `insideViewport` `true`. Known failure (#18063): the submenu opens to the right of the menu, so the profile row starts at x about 270 with width 210 and the `LLM Profiles` link sits at y about 725, below the 700 px viewport (both `insideViewport` `false`); the profile clicks below still work because the first two rows keep a strip of about 50 px on screen (from x about 270 to the 320 px edge), while a click on the `LLM Profiles` link times out (`browser screenshot --feature F05.overflow-menu --name model-submenu-narrow`). `control-openhands browser click 'testid=chat-input-llm-profile-option-deepseek-pro'` and `control-openhands browser wait-text 'Switched to profile' --timeout 15000` close the menu (count `0`), and `control-openhands conversation status <id>` shows `deepseek/deepseek-v4-pro`. Switch back the same way: the trigger, `testid=overflow-model-button`, then `testid=chat-input-llm-profile-option-deepseek-flash` (`conversation status <id>` shows `deepseek/deepseek-flash`). Open the menu once more; a second click on the trigger closes it (`aria-expanded` `false`). Return with `control-openhands browser viewport desktop`.+- **Context window (`F05.context-window-meter`).** Run `control-openhands browser attr 'testid=context-window-meter' aria-label` (`Context window usage: 1% used (99% left)`), `control-openhands browser click 'testid=context-window-meter'` and `control-openhands browser text 'testid=context-window-meter-popover'` (`Context Window`, the percentage, `Compact context`, tokens such as `11.7k / 1.0M`, `Usage`). `control-openhands browser click 'testid=context-window-meter-bar-button'` (the progress bar) closes the popover and opens the Usage tab (`control-openhands browser testids --filter usage` lists `conversation-tab-usage`, `usage-panel`). The popover's `Usage` row does the same: from another tab (`control-openhands browser click 'testid=conversation-tab-files'`), reopen the ring, `control-openhands browser click 'testid=context-window-plan-usage'` and `control-openhands browser wait 'testid=usage-panel'` (the panel mounts a moment later; an immediate `count` is `0`). Reopen the ring, then `control-openhands browser click 'testid=context-window-compact-button' --observe '[role=status]' --observe-ms 25000`: `Context compaction started`, then `Context compacted`; `control-openhands conversation events <id> --kinds CondensationRequest,Condensation --last 5` lists both kinds.+- **Stop and resume (`F05.stop-resume`) with a queued follow-up (`F05.queued-message`).** Send `Run this shell command: sleep 25 && echo slept. Then reply with only: done` (type + Enter as above), `control-openhands conversation wait <id> --until running --timeout 30` and `control-openhands browser wait 'testid=stop-button'`; `control-openhands browser attr 'testid=stop-button' aria-label` is `Stop`. While it runs, `control-openhands browser enabled 'testid=submit-button'` is `false` with an empty field; type `Also reply with: queued-ok` (enabled turns `true`) and press Enter. Run `control-openhands browser click 'testid=stop-button'` and `control-openhands browser wait 'testid=play-button' --timeout 30000`; `control-openhands browser text 'testid=interactive-chat-box'` ends `Stopped`, `control-openhands browser attr 'testid=play-button' aria-label` is `Resume the agent task` and `control-openhands conversation status <id>` is `paused`. Run `control-openhands browser click 'testid=play-button'`, wait for `running` then the terminal state: the last agent message is `done queued-ok` and `testid=user-message >> has-text=queued-ok` counts `1`.+- **Slash menu (`F05.slash-menu`).** On a cleared composer run `control-openhands browser type 'testid=chat-input' '/'`, `control-openhands browser count 'testid=slash-command-menu >> role=option'` (37 with the bundled skills) and `control-openhands browser text 'testid=slash-command-menu'`: `Commands`, then `/btw`, `/model`, `/goal`, `/plan`, `/code` with descriptions, then skills (`/agent-creator`, …); no `/new` on the local backend. Type `mo`: the count drops (descriptions match too). `control-openhands browser attr 'testid=slash-command-menu >> role=option >> nth=0' aria-selected` is `true`; after `control-openhands browser press ArrowDown` the selected option is `/plan` (read it with `control-openhands browser text 'testid=slash-command-menu >> [aria-selected=true]'`). `control-openhands browser press Escape` closes the menu and keeps `/mo`. On `/btw`, `control-openhands browser press Tab` leaves `/btw ` in the field; on `/model ` (trailing space) the menu lists `/model deepseek-flash` and `/model deepseek-pro`, and `control-openhands browser press Enter` inserts `/model deepseek-flash ` instead of sending.+- **`/model` (`F05.slash-model`).** Type `/model deepseek-pro`, `control-openhands browser press Escape` (close the menu), `control-openhands browser press Enter --selector 'testid=chat-input'`: `Switched to profile` appears, the pill reads `deepseek-pro` and `conversation status <id>` shows `deepseek/deepseek-v4-pro`. Bare `/model` (Escape, Enter) adds `Available profiles (2)` to `testid=model-messages`; `control-openhands browser click 'testid=model-messages >> role=button[name="Expand"]'` and `control-openhands browser click 'role=button[name="Toggle details for deepseek-pro"]'` show `model: deepseek/deepseek-v4-pro`, `base_url: —`, `api_key: set`. `/model qa-nope` (Escape, Enter) toasts `Profile 'qa-nope' not found` (`control-openhands browser toasts`) and the pill keeps `deepseek-pro`. Restore with `/model deepseek-flash`.+- **`/btw` (`F05.slash-btw`).** Note `control-openhands conversation events <id> --kinds MessageEvent` count, type `/btw Reply with only: side-ok`, Escape, Enter. `control-openhands browser text 'testid=btw-messages'` is `BTW:` + the question and `testid=btw-spinner` counts `1`; after the answer the card shows `Got it`. `control-openhands browser click 'testid=btw-messages >> role=button[name="Expand"]'` reveals `side-ok`; `control-openhands browser click 'testid=btw-messages >> role=button[name="Got it"]'` removes the card (count `0`). The MessageEvent count is unchanged. Bare `/btw` (Escape, Enter) clears the field and `control-openhands browser toasts` shows `Please provide a question — e.g. /btw <question>`; `control-openhands browser count 'testid=btw-messages'` stays `0`.+- **`/goal` (`F05.slash-goal`).** Bare `/goal` + Enter: `control-openhands browser toasts` shows `Please provide an objective — e.g. /goal <objective>`. Send `/goal --max 1 Reply with only: goal-ok`: `control-openhands browser text 'testid=goal-status'` reads `Goal: … Round 0/1 running Stop`; `control-openhands browser wait 'testid=goal-done' --timeout 150000`, then `Round 1/1 complete score 100%`. Send `/goal --max 2 Reply with only: goal-two` and at once `control-openhands browser click 'testid=goal-status >> nth=-1 >> testid=goal-stop'`; `control-openhands browser wait 'testid=goal-resume'` and the banner reads `Round 0/2 interrupted Resume`. `control-openhands browser click 'testid=goal-resume'` sets it `running`; poll `control-openhands browser text 'testid=goal-status >> nth=-1'` until a new row ends `Round 1/2 complete score 100%`. The old `Round 0/2 interrupted` row no longer offers Resume: `control-openhands browser count 'testid=goal-resume'` is `0`. After `control-openhands browser reload`, `control-openhands browser count 'testid=goal-status'` is `3` and the `goal-resume` count is still `0`.+- **`/plan` and `/code` (`F05.slash-plan-code`).** Send bare `/plan` (Escape, Enter): `control-openhands browser attr 'testid=chat-input' data-placeholder` turns `Let’s work on a plan`; `control-openhands conversation list` gains a planner conversation (title `null` at first, `<planner-id>`). Bare `/code` turns it back to `What do you want to build?`. `control-openhands browser count 'role=button[name="Code"]'` is `0` on local (the pill is Cloud only). `/plan` sent while the agent runs should be refused with feedback; today it is dropped silently: the field clears, no toast, the placeholder stays `What do you want to build?` (fail row; `use-plan-mode-interceptor.ts` swallows it by design but tells the user nothing).+- **Plan card (`F05.plan-preview`).** In plan mode send `Plan creating a file hello.txt containing hi. Keep the plan to three short steps.`, then `control-openhands conversation wait <planner-id> --until running --timeout 60`, `control-openhands conversation wait <planner-id> --timeout 240` and `control-openhands browser wait 'testid=plan-preview-content' --timeout 60000`. `control-openhands browser text 'testid=plan-preview-content'` starts `1. OBJECTIVE` and ends `Read more`; `control-openhands browser enabled 'testid=plan-preview-build-button'` is `true`. Use `--fresh` instead of the `--until running` wait if the planner is fast. `control-openhands browser click 'testid=plan-preview-view-button'` (Read more does the same) opens the Planner tab: `control-openhands browser testids --filter planner` lists `conversation-tab-planner` and `planner-tab-build-button` (`Build ⌘↩`).+- **Build shortcut (`F05.build-plan-shortcut`).** With the plan card shown and the agent idle, `control-openhands browser press Control+Enter`: the placeholder returns to `What do you want to build?`, `control-openhands conversation wait <id> --until running --timeout 60` then `--timeout 240` finishes, `control-openhands browser text 'testid=user-message >> nth=-1'` is `Execute the plan based on the .agents_tmp/PLAN.md file.` (the agent's reply wording varies, e.g. `Executed the plan in .agents_tmp/PLAN.md`), and `hello.txt` exists in the `workspace` from `control-openhands conversation status <id>`.+- **`/plan <task>` and `/code <task>` (`F05.slash-plan-code-task`).** With the agent idle, send bare `/plan`, then `/code Reply with only: code-ok` (Escape, Enter): the placeholder turns `What do you want to build?` at once, `control-openhands conversation wait <id> --fresh --timeout 180`, `control-openhands browser text 'testid=user-message >> nth=-1'` is `Reply with only: code-ok` (no `/code` prefix) and the last agent message is `code-ok`. Then send `/plan Plan writing bye.txt containing bye. One step only.`: the placeholder turns `Let’s work on a plan`, `control-openhands conversation wait <planner-id> --fresh --timeout 240`, `control-openhands conversation events <planner-id> --kinds MessageEvent --last 100` ends with the user text `Plan writing bye.txt containing bye. One step only.` and a planner reply, and `control-openhands conversation list` still has only the two conversations (the existing planner is reused).+- **Build button (`F05.plan-preview`).** With the newer plan card from `/plan Plan writing bye.txt containing bye. One step only.` (above) shown and the agent idle, `control-openhands browser click 'testid=plan-preview-build-button >> nth=-1'` does the same as the shortcut: placeholder `What do you want to build?`, `control-openhands conversation wait <id> --fresh --timeout 240`, the same last user message, and `bye.txt` (content `bye`) in the workspace.+- **Phone (`F05.phone`).** On `/conversations/<id>` run `control-openhands browser viewport phone`, `control-openhands browser bbox 'testid=interactive-chat-box'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F05.phone --name composer` (`+`, model pill, ring, mic and Send on one row). Return with `control-openhands browser viewport desktop`.++## Gotchas++- Always export your own `OH_VERIFY_RUN`. `launch --new` repoints the shared `current` symlink, and another agent relying on `current` drove and then stopped this family's stack mid-run. If the URL jumps to a page you never opened or `fetch failed` appears, run `control-openhands status` before blaming the product.+- `conversation wait <id>` right after sending returns at once with the previous `finished` status. Use `conversation wait <id> --fresh`; `--until running` then a terminal wait only works for turns longer than the poll interval (a `Reply with only` turn on deepseek-flash can finish first, and `--until running` then times out).+- The slash menu stays open while you type a command; press Escape before Enter or Enter selects the highlighted option instead of sending.+- Conversation drafts are saved 500 ms after the last keystroke and not flushed on unmount (the home draft is): navigating sooner restores the older draft (fail row) (#17926). Wait a second before navigating when testing restoration.+- Escape should close the `+` tools menu. Known failure (reproduced 2026-10-06): `testid=tools-context-menu` stays open and focus stays on `chat-plus-button`; #18044 fixed Escape for other popups (#17933, closed) and left this menu as a follow-up; its repro is in [this #17933 comment](https://github.com/OpenHands/OpenHands/issues/17933#issuecomment-5987090872). Repro candidate, not yet filed. Click `chat-plus-button` again or choose an item. A menu left open covers attachments in screenshots. The narrow-width "More input actions" overflow menu ignores Escape too (reproduced 2026-10-06; a follow-up noted in the fix PR #18015, not filed yet): close it with its trigger or an outside click (`browser mouse-click 160 100` at `narrow`).+- After a client-side switch between conversations (a sidebar row, or a user-message branch in `F06.branch-from-here`) Send keeps the previous conversation's state (repro candidate, not filed yet). Switching from an empty composer to one with a saved draft restores the text next to a disabled Send; this is a race (Send came up enabled in 1 of 7 tries), so one enabled reading does not show the bug is gone. Switching from a composer with text to an empty one leaves Send enabled, and clicking it does nothing. Typing or `browser reload` fixes it, and Enter in the field sends the restored text anyway. Read `browser enabled 'testid=submit-button'` after a reload, or after typing.+- Uploaded chips and thumbnails have no test ids. Their remove buttons are named `Remove <file name>` (file chip) and `Remove image` (thumbnail), and Send, Stop and Play read `Send message`, `Stop` and `Resume the agent task` (#18033); select by those names, or by text/alt.+- `browser upload` feeds the hidden input directly. To drive the real path, `+` > Add Files and Images, use `control-openhands browser upload-via 'testid=add-files-and-images-button' <file>`, which answers the native file chooser.+- The `Switched to profile` notes are client-side and gone after reload; assert the pill and `conversation status`.+- `/plan` messages go to a separate planner conversation; the browser stays on the parent `/conversations/<id>`, so wait on the planner id from `conversation list`.+- Only the newest goal status offers `Resume` (#18036): once a resumed goal has posted a newer status, the old `interrupted` row shows no button, also after a reload. Count `testid=goal-resume` after the resumed goal ends; while it runs the count is `0` anyway.+- Opening the context popover logs a 404 for `/api/llm/balance` on the local backend in `browser errors --app-only`; it does not break the popover.+- `--observe` takes CSS selectors (`'[role=status]'`), not `role=` selector syntax.+- At `narrow` (320 px) the overflow menu's Model submenu opens to the right of the menu and runs off screen: each profile row starts at x about 270 with width 210 (`browser bbox 'testid=chat-input-llm-profile-option-deepseek-flash'`, `insideViewport` `false`), so both names read `deepse…`. Pick profiles by test id: the click lands on the strip of about 50 px that stays on screen. Known issue: #18063 (filed from the follow-up noted in #18015; the submenu also runs past the bottom edge, so the LLM Profiles link cannot be clicked at `narrow`) (`F05.overflow-menu`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F06-agent-activity.md b/.agents/skills/verify-openhands/references/feature-map/F06-agent-activity.mdnew file mode 100644index 0000000000..3a0b913db3--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F06-agent-activity.md@@ -0,0 +1,119 @@+# F06 — Agent activity: messages, events and lifecycle++Inside a conversation the user watches the agent work: their own messages appear+at once (optimistically), the agent's replies render as markdown, tool calls are+grouped into collapsible "N actions completed" blocks whose cards show commands,+outputs, diffs and task lists, and a live chip says what the agent is doing right+now. Around the transcript sit lifecycle controls and states: the starting pill,+stop and resume, the confirmation prompt when confirmation mode is on, error and+reconnect banners, the no-LLM banner and the skill-installed banner. History+pages in from the server, survives reloads and backend restarts, and any message+can be branched into a new conversation.++Source: `src/components/features/chat/chat-interface.tsx`, `src/components/conversation-events/chat/`, `src/components/features/chat/` (messages, banners, `tool-visualizers/`, `task-tracking/`), `src/components/features/markdown/`, `src/components/features/images/`, `src/components/features/suggestions/`, `src/components/shared/buttons/conversation-confirmation-buttons.tsx`, `src/components/features/controls/agent-status.tsx`, `src/hooks/use-load-older-events.ts`, `src/hooks/mutation/use-fork-conversation.ts`.++## Sub-features++- `F06.empty-state-suggestions`: an empty conversation shows "Let's start building!" with four suggestion chips; a chip fills the composer with its prompt.+- `F06.user-and-agent-messages`: user and agent bubbles; a long user message is clipped with a gradient and expands on click ("View More").+- `F06.message-copy`: hovering a bubble shows Copy to clipboard; it copies the message's markdown source and the label flips to Copied to clipboard for 2 s.+- `F06.code-block-copy`: hovering a fenced code block in an agent reply shows its own Copy button, which copies only the code.+- `F06.timestamps`: hovering a bubble or tool title shows the event's local date and time.+- `F06.pending-messages`: a sent message shows "Sending..." until the server echoes it; a failed send shows Failed to send with Retry and Dismiss; Retry delivers it exactly once.+- `F06.markdown-rendering`: agent replies render markdown: tables inside a horizontal scroller with edge fades, fenced code, inline code.+- `F06.workspace-path-links`: a workspace file path in an agent reply, and the path chip of a file-editor card, open that file in the Files tab.+- `F06.thinking`: model reasoning appears as a collapsed "Thinking" row that expands.+- `F06.event-groups`: consecutive tool calls collapse into "N actions completed" (or "k/N actions completed" with a spinner while one is pending); expanding lists one titled row per action.+- `F06.tool-visualizers`: expanding a tool row shows a rich body: terminal command and output (non-zero exit badge `exit N`), file-editor path chip and content.+- `F06.markdown-file-preview`: when the agent creates a Markdown file, its row stays expanded and ungrouped and shows a rendered, height-limited preview card with the file name and View, which opens the file in the Files tab.+- `F06.task-list`: task-tracker calls render a "Tasks" card with done / todo icons.+- `F06.events-match`: the stream shows one bubble per message event and one row per action, with no duplicates (compare with `conversation events`).+- `F06.load-older-history`: only the newest 50 events load first; older pages are fetched (automatically when the content is short) so the first prompt and all actions appear.+- `F06.scroll-to-bottom`: scrolling up shows a scroll-to-bottom button; clicking it returns to the bottom and hides it.+- `F06.live-activity`: while the agent runs, a chip above the composer names the current action ("Thinking", then the action title) and the composer status reads Running.+- `F06.status-indicator`: while a new conversation starts, a "Starting" pill shows above the composer.+- `F06.stop-resume`: Stop in the composer interrupts the agent, including a running tool call (status Stopped, play button, an Agent error row for the interrupted call); Play resumes it to completion.+- `F06.reload-mid-run`: reloading while the agent runs reattaches to the live run; it finishes without duplicated events.+- `F06.reconnect`: when the Agent Server goes away the composer shows Disconnected; after it returns the page reconnects without a reload.+- `F06.error-banner`: losing the server shows "Unable to connect to server" with Retry, Copy and Close; Retry reconnects once the server is back.+- `F06.error-events`: a conversation error (ConversationErrorEvent) surfaces as a warning banner and the composer status Error.+- `F06.confirmation-mode`: with confirmation mode on, a lock chip sits above the composer and each action waits for "Do you want to continue with this action?" with Cancel (⇧⌘⌫) and Continue (⌘↩).+- `F06.confirmation-shortcuts`: Cmd+Enter continues and Shift+Cmd+Backspace cancels a pending action.+- `F06.branch-from-here`: hovering a message shows Branch from here; on an agent message it forks inclusively; on a user message it forks without that message and pre-fills its text in the new composer, ready to send. The branch is titled "<title> (branch)" and keeps working.+- `F06.image-attachments`: images sent with a message show as thumbnails in the bubble; expand opens a lightbox that closes with X or Escape.+- `F06.skill-install-banner`: after the agent installs a skill into the workspace, a banner offers "Start new conversation with this skill" (same workspace) and Close.+- `F06.llm-not-configured-banner`: with no usable LLM, a conversation shows "Your LLM isn't set up yet..." with Set up LLM; suggestions are hidden and sending is disabled.+- `F06.critic-result`: with the critic enabled, agent messages carry a critic result (success likelihood, issue categories).+- `F06.hook-events`: hook executions render as their own rows in the stream.+- `F06.corrective-nudge`: when the model answers with neither a message nor a tool call, the SDK's nudge (`Your last response did not include a function call or a message. …`) shows as a muted, italic `role=note` line with an info icon (`corrective-nudge-message`), not as a user bubble (#17864).+- `F06.phone`: at 390 px the transcript fits the viewport; wide tables scroll inside their own container.++## How to get to it (user POV)++- Open any conversation: a sidebar conversation card, or the direct URL `/conversations/<id>`.+- Start one from the home composer (**New Chat**, `/`): type and press Send. `control-openhands conversation start` drives exactly this path.+- An empty conversation: the sidebar's create-thread button (`conversation-panel-new-thread-picker`), then **No workspace** (or a workspace).+- Composer status control (right side of the composer): Stop while running, Play while stopped.+- Hover a bubble: Branch from here and Copy to clipboard icons; hover a tool title for its timestamp.+- Confirmation mode and the critic are switched on under Settings → Verification (`/settings/verification`; the page itself belongs to the settings families).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` (deepseek-flash active). Every prompt below is tiny and stays in the conversation's own workspace.+- Conversation ids are printed as `"id"` by `control-openhands conversation start`, or read from `control-openhands browser url` (`/conversations/<id>`). `<id>` below is always the conversation the step just created or opened.+- `F06.llm-not-configured-banner` needs a second, fresh `control-openhands launch --new --build never` with no `llm preset` (export its run dir as `OH_VERIFY_RUN` for those commands, then `control-openhands stop` it).+- `F06.critic-result` is blocked: it needs an OpenHands Cloud critic API key (Settings → Verification → Critic API Key). `F06.hook-events` needs a configured hook; none is set in a fresh run. `F06.corrective-nudge` is blocked: the nudge needs a model turn with neither text nor a tool call, which a normal prompt to deepseek-flash does not produce. When one happens, `control-openhands browser count 'testid=corrective-nudge-message'` is `1` and `browser count 'testid=user-message >> has-text=Your last response did not include'` is `0`.+- The harness browser grants clipboard access: `control-openhands browser clipboard` reads what a Copy button wrote and `browser clipboard --write qa-empty` resets it first.+- A terminal call can come back as "The terminal session was reset..." after this run's agent server restarts; the model reruns it, which turns one action into a group of two (see Gotchas).++- **One run that exercises the stream (`F06.markdown-rendering`, `F06.event-groups`, `F06.thinking`, `F06.events-match`).** Run `control-openhands conversation start --prompt "Run the terminal command 'echo qa-f06-hello', then create a file qa_f06.txt containing the word hi. Finally reply with a markdown table with columns Step and Result (two rows) followed by a python code block that prints 1." --wait --timeout 300`, then `control-openhands browser testids 'testid=chat-interface'` and `control-openhands browser snapshot 'testid=agent-message'`. The testids include `user-message`, `event-group` ("3 actions completed"), `agent-message`, `markdown-table-scroll` with `markdown-table-scroll-fade-left`/`-right`; the snapshot shows a `table` with column headers Step and Result and a `code` block `print(1)`. Compare with `control-openhands conversation events <id>`: one user and one agent `MessageEvent`, three `ActionEvent`s (`terminal`, `file_editor`, `canvas_ui_control`), matching one `user-message`, one group of three rows and one `agent-message`. The thinking row (`collapsible-thinking`) lives inside the group, so it is listed only after the next bullet expands it.+- **Expand a group and its rows (`F06.event-groups`, `F06.thinking`, `F06.tool-visualizers`).** Run `control-openhands browser click 'testid=event-group-toggle'` (label becomes Collapse actions), `control-openhands browser text 'testid=event-group'` (three titles, e.g. "Echo test string in terminal", "Create qa_f06.txt containing hi"; titles are model-written), then `control-openhands browser click 'testid=event-group-content >> role=button[name="Expand"][exact] >> nth=0'` twice (each click expands the next collapsed row). The group text now contains `echo qa-f06-hello` and its output `qa-f06-hello`, the file path chip (`testid=file-path-chip`) and the content `hi`. `control-openhands browser click 'testid=collapsible-thinking-toggle >> nth=0'` reveals `collapsible-thinking-content`. Take `control-openhands browser screenshot 'testid=chat-interface' --feature F06.tool-visualizers --name bash-and-file`.+- **Open files from the stream (`F06.workspace-path-links`).** On the same page the agent may already have opened the file; run `control-openhands browser click 'testid=file-quick-row-close-qa_f06.txt'` and check `control-openhands browser count 'testid=file-quick-row-item-qa_f06.txt'` is `0`. Run `control-openhands browser click 'testid=agent-message >> testid=markdown-file-path-link'`: the count is `1` and `control-openhands browser text 'testid=file-content-viewer-plain'` is `hi`. Close it again and `control-openhands browser click 'testid=file-path-chip'` (inside the expanded file-editor row): the count is `1` again.+- **Markdown file preview (`F06.markdown-file-preview`).** Run `control-openhands conversation start --prompt "Use the file_editor tool to create the file qa_notes.md containing a heading '# QA Notes' and one bullet '- first'. Do nothing else and reply DONE." --wait --timeout 150`. Without any click, `control-openhands browser text 'testid=markdown-file-preview'` reads `QA Notes first qa_notes.md View` (rendered heading and bullet, then the file name) and `count 'testid=event-group'` is `0`. `control-openhands browser count 'testid=file-quick-row-item-qa_notes.md'` is `0`; `control-openhands browser click 'testid=markdown-file-preview-view'` makes it `1` and `control-openhands browser text 'testid=file-content-viewer-markdown'` reads `QA Notes first`. Then `control-openhands browser goto /conversations/<stream id>` to return to the stream conversation for the next bullets.+- **Timestamps (`F06.timestamps`).** Run `control-openhands browser tooltip 'testid=user-message'` and `control-openhands browser tooltip 'testid=event-group-toggle'`. Both return the local date and time, e.g. `Oct 4, 2026, 11:08 PM`.+- **Copy a message and a code block (`F06.message-copy`, `F06.code-block-copy`).** On the same page run `control-openhands browser clipboard --write qa-empty`, `control-openhands browser hover 'testid=agent-message >> nth=0'` and `control-openhands browser click 'testid=agent-message >> nth=0 >> testid=copy-to-clipboard >> nth=0'` (the bubble's button; the code block has a second, hidden `copy-to-clipboard`). `control-openhands browser attr 'testid=agent-message >> nth=0 >> testid=copy-to-clipboard >> nth=0' aria-label` is `Copied to clipboard`, and `Copy to clipboard` again about 2 s later; `control-openhands browser clipboard` starts with `| Step | Result |` and ends with the fenced `print(1)` block. Then `control-openhands browser hover 'testid=agent-message >> pre'`, `control-openhands browser click 'testid=agent-message >> pre >> testid=copy-to-clipboard'` and `control-openhands browser clipboard` is exactly `print(1)`.+- **Non-zero exit badge (`F06.tool-visualizers`).** In an open conversation run `control-openhands browser fill 'testid=chat-input' "Run exactly this terminal command, verbatim, with nothing appended: ls /qa_missing_dir2 . Then reply OK."`, `control-openhands browser click 'testid=submit-button'` and `control-openhands conversation wait <id> --fresh --timeout 150` (without `--fresh` it returns the previous run's `finished` at once). If the reply's actions render as a single row, run `control-openhands browser click 'testid=chat-scroll-container >> role=button[name="Expand"][exact] >> nth=-1'`; if they render as a group (`browser count 'testid=event-group'` grew, e.g. `2 actions completed` after a terminal reset and rerun), run `control-openhands browser click 'testid=event-group-toggle >> nth=-1'` and `control-openhands browser click 'testid=event-group-content >> nth=-1 >> role=button[name="Expand"][exact] >> nth=-1'`. Then `control-openhands browser count 'testid=chat-scroll-container >> text="exit 2"'` is `1`; the badge sits above the `No such file or directory` output (`browser screenshot 'testid=event-group >> nth=-1' --feature F06.tool-visualizers --name exit-code`). Repeating the check in the same conversation needs a new directory name and a count that grows, because an earlier expanded badge stays on the page.+- **Task list (`F06.task-list`, `F06.status-indicator`).** From `/` run `control-openhands browser goto /`, `control-openhands browser fill 'testid=chat-input' "Use your task_tracker tool to plan exactly two tasks titled 'qa step one' and 'qa step two'; mark 'qa step one' done and 'qa step two' todo. Do nothing else and reply DONE."` and `control-openhands browser click 'testid=submit-button' --expect-url '/conversations/' --observe '[data-testid=chat-status-indicator]' --observe-ms 8000`. `observed` contains `Starting` for a moment (the pill). Then `control-openhands conversation wait <id> --timeout 150` and `control-openhands browser text 'testid=chat-scroll-container'`: it contains `Tasks`, `qa step one`, `qa step two`; the screenshot shows a check icon and muted text for the done task, an empty circle for the todo one.+- **Empty state (`F06.empty-state-suggestions`).** Run `control-openhands browser click 'testid=conversation-panel-new-thread-picker'`, `control-openhands browser click 'testid=launch-no-workspace' --expect-url '/conversations/'`, then `control-openhands browser text 'testid=chat-suggestions'`: `Let's start building!` plus `Increase test coverage`, `Auto-merge PRs`, `Fix README`, `Clean dependencies`. Run `control-openhands browser click 'testid=chat-suggestions >> text=Fix README'` and `control-openhands browser text 'testid=chat-input'`: the composer holds the README-improvement prompt.+- **Pending bubble and long messages (`F06.pending-messages`, `F06.user-and-agent-messages`).** Write a 25-line message to a file (first line `Reply with only the word OK. Ignore the filler lines below.`, then `filler line 1`…`filler line 24`), run `control-openhands browser fill 'testid=chat-input' x --value-file <file>` and `control-openhands browser click 'testid=submit-button' --observe '[data-testid=chat-message-sending]' --observe-ms 3000`. `observed` shows `Sending...` then `<absent>` once the server echoes it. After `control-openhands conversation wait <id> --timeout 120`, `control-openhands browser testids 'testid=chat-scroll-container'` lists `chat-message-truncation-gradient` and `chat-message-expand` ("View More"); `control-openhands browser click 'testid=chat-message-expand'` removes both and the whole text shows. `testid=agent-message` reads `OK`.+- **Server lost: banner, failed send, reconnect (`F06.error-banner`, `F06.pending-messages`, `F06.reconnect`).** With a conversation open run `control-openhands service stop agent-server` and `control-openhands browser wait 'testid=error-message-banner' --timeout 20000`: the banner reads `Unable to connect to server` with `error-message-banner-retry`, `-copy` and `-dismiss`; the composer shows `Disconnected`. Run `control-openhands browser fill 'testid=chat-input' 'Reply with only the word PONG.'` and `control-openhands browser click 'testid=submit-button' --observe '[data-testid=chat-message-sending],[data-testid=chat-message-error]' --observe-ms 8000`: `Sending...` turns into `Failed to send Retry Dismiss`. `control-openhands browser click 'testid=chat-message-retry'` while down fails again; `control-openhands browser click 'testid=chat-message-dismiss'` removes the bubble (`count 'testid=chat-message-error'` is `0`). Send the same message again so one failed bubble remains, `control-openhands browser click 'testid=error-message-banner-dismiss'` (banner count `0`), then `control-openhands restart`. Poll `control-openhands browser text 'testid=interactive-chat-box'` every 10 s: within about a minute after `restart` returns it no longer contains `Disconnected` (reconnected without reload). `control-openhands browser click 'testid=chat-message-retry'`, `control-openhands conversation wait <id> --timeout 120`, then `control-openhands conversation events <id> --kinds MessageEvent`: `Reply with only the word PONG.` appears once and the last `agent-message` is `PONG`.+- **Banner Retry (`F06.error-banner`).** Run `control-openhands service stop agent-server`, wait for `testid=error-message-banner` as above, `control-openhands restart`, then `control-openhands browser click 'testid=error-message-banner-retry'`. `control-openhands browser count 'testid=error-message-banner'` is `0` and the composer is no longer Disconnected. Take `browser screenshot 'testid=chat-interface' --feature F06.error-banner --name disconnected` while the banner is up.+- **Live chip, stop and resume (`F06.live-activity`, `F06.stop-resume`).** Run `control-openhands conversation start --prompt "Run exactly one terminal command: sleep 25 && echo qa-slept. Then reply with only its output."` (no `--wait`), `control-openhands browser wait 'testid=live-activity-chip' --timeout 30000` and `control-openhands browser text 'testid=live-activity-chip'`: first `Thinking`, then the action title (e.g. `Run sleep 25 then echo qa-slept`); `browser text 'testid=interactive-chat-box'` contains `Running`. Run `control-openhands browser click 'testid=stop-button'`: `control-openhands conversation status <id>` is `paused`, the composer reads `Stopped`, `count 'testid=play-button'` is `1` and the chip is gone. Stop interrupts the running `sleep` too: `control-openhands conversation events <id>` shows an `AgentErrorEvent` (`Tool call interrupted before completion. The conversation was paused.`) followed by an `InterruptEvent`, and `browser text 'testid=chat-scroll-container'` shows an `Agent error` row under the action title. Run `control-openhands browser click 'testid=play-button'`: status `running`, then `control-openhands conversation wait <id> --timeout 120` ends `finished` with a new agent `MessageEvent` (the model reports that the command was interrupted; `qa-slept` never prints).+- **Reload mid-run (`F06.reload-mid-run`).** Run `control-openhands conversation start --prompt "Run exactly one terminal command: sleep 15 && echo qa-reloaded. Then reply with only its output."`, wait for `testid=live-activity-chip`, then `control-openhands browser reload`. The composer still reads `Running` and the chip is back. After `control-openhands conversation wait <id> --timeout 120`: `testid=agent-message` is `qa-reloaded`, `count 'testid=user-message'` is `1`, `control-openhands browser eval "document.querySelectorAll('[data-testid=chat-scroll-container] [data-testid=generic-event-message-title]').length"` is `1`.+- **Older history (`F06.load-older-history`).** Run `control-openhands conversation start --prompt "Run these 16 terminal commands strictly one per tool call, sequentially (never combine them): echo qa1, echo qa2, echo qa3, echo qa4, echo qa5, echo qa6, echo qa7, echo qa8, echo qa9, echo qa10, echo qa11, echo qa12, echo qa13, echo qa14, echo qa15, echo qa16. Then reply DONE." --wait --timeout 400`; `control-openhands conversation events <id> --last 500` reports a count above 50. Run `control-openhands browser network --clear`, `control-openhands browser reload`, then `control-openhands browser network --last 300`: two `GET /api/conversations/<id>/events/search` requests (newest page, then the older page). `control-openhands browser text 'testid=chat-scroll-container'` starts with the prompt and shows `16 actions completed` and `DONE`.+- **Scroll to bottom (`F06.scroll-to-bottom`).** On the 16-command conversation, `control-openhands browser click 'testid=event-group-toggle'` makes the transcript taller than the viewport while the view stays where it was. Run `control-openhands browser scroll 'testid=chat-scroll-container' --by 2000` first (the button only reacts to scroll events, so a page that is already at the top never shows it): `count 'testid=scroll-to-bottom'` is `0`. Run `control-openhands browser scroll 'testid=chat-scroll-container' --by -2000`; the count is `1`. `control-openhands browser click 'testid=scroll-to-bottom'`, then the count is `0` and `control-openhands browser eval "(()=>{const e=document.querySelector('[data-testid=chat-scroll-container]');return Math.round(e.scrollHeight-e.scrollTop-e.clientHeight)})()"` is `0`.+- **Confirmation mode on (`F06.confirmation-mode`).** Arrange through the settings UI, in this order (the Security Analyzer field appears only once Confirmation Mode is on): `control-openhands browser goto /settings/verification`, `control-openhands browser click 'testid=verification-settings-screen >> text=Confirmation Mode'`, `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser click 'testid=verification-settings-screen >> role=button[name="Show suggestions"]'`, `control-openhands browser click 'role=listbox >> role=option[name="None"]'`, `control-openhands browser value 'testid=verification-settings-screen >> role=combobox[name="Security Analyzer"]'` (`None`), `control-openhands browser click 'testid=verification-settings-screen >> testid=save-button'`; `control-openhands api GET /api/settings` shows `"confirmation_mode": true` and `"security_analyzer": "none"` (None means every action is confirmed; the default LLM analyzer only stops HIGH-risk actions, so `echo` would run unprompted). Run `control-openhands conversation start --prompt "Run the terminal command 'echo qa-confirm-ok' and reply with its output." --wait --timeout 180`: it returns `"status": "waiting_for_confirmation"`. `control-openhands browser text 'testid=chat-scroll-container'` ends `Do you want to continue with this action? Cancel ⇧⌘⌫ Continue ⌘↩`, `control-openhands browser tooltip 'testid=action-confirm-button'` is `Confirm the requested action`, and a lock icon sits above the composer (screenshot). Run `control-openhands browser click 'testid=action-reject-button'`: status `idle`, the buttons are gone and `conversation events <id> --last 6` ends with `UserRejectObservation`. Send `Run the terminal command 'echo qa-confirm-two' and reply with its output.` through `testid=chat-input` / `testid=submit-button`, `control-openhands browser wait 'testid=action-confirm-button' --timeout 20000`, `control-openhands browser click 'testid=action-confirm-button'`; about 15 s later the status is `finished` and the events contain the observation `qa-confirm-two`. Expected after a Cancel: the rejected row is shown as resolved and the group stops spinning (currently fails, see Gotchas).+- **Confirmation shortcuts (`F06.confirmation-shortcuts`).** The previous bullet resolved its action, so arrange a new one in the same conversation: send `Run the terminal command 'echo qa-confirm-three' and reply with its output.` through `testid=chat-input` / `testid=submit-button` and `control-openhands browser wait 'testid=action-confirm-button' --timeout 20000`. While it awaits confirmation, `control-openhands browser press Control+Enter` does nothing (`control-openhands conversation status <id>` stays `waiting_for_confirmation`); see Gotchas. `control-openhands browser press Meta+Enter` continues it: `control-openhands conversation wait <id> --fresh --timeout 120` ends `finished` and `control-openhands conversation events <id> --kinds ObservationEvent` contains `qa-confirm-three`. Restore afterwards: `browser goto /settings/verification`, click `testid=sdk-section-all-toggle`, `Show suggestions`, `role=listbox >> role=option[name="LLM"]`, then `testid=verification-settings-screen >> text=Confirmation Mode`, then `save-button`; `api GET /api/settings` shows `"confirmation_mode": false`, `"security_analyzer": "llm"`.+- **Branch from here (`F06.branch-from-here`).** Open a conversation with at least two exchanges (the OK/PONG one above): `control-openhands browser goto /conversations/<id>` with its id (the previous bullet left `/settings/verification`). Agent message: `control-openhands browser hover 'testid=agent-message >> nth=0'`, `control-openhands browser click 'testid=agent-message >> nth=0 >> role=button[name="Branch from here"]' --expect-url '/conversations/(?!<id>)'`; after `control-openhands browser wait 'testid=user-message'` (the history mounts a moment after the URL changes, so an immediate count reads `0`) the new conversation has `count 'testid=user-message'` `1`, the agent message `OK`, and `browser eval "document.title"` contains `(branch)`. User message (edit): back on the OK/PONG conversation (`control-openhands browser goto /conversations/<id>`; the branch above has one user message), `control-openhands browser hover 'testid=user-message >> nth=1'` and `control-openhands browser click 'testid=user-message >> nth=1 >> role=button[name="Branch from here"]' --observe '[data-testid=chat-input]' --observe-ms 4000`: `observed` shows the composer change from empty to `Reply with only the word PONG.` and stay. The new conversation (`<branch-id>` from `browser url`) omits that message, `control-openhands browser text 'testid=chat-input'` is `Reply with only the word PONG.`, and nothing was sent: `control-openhands conversation events <branch-id> --kinds MessageEvent` lists only the copied first exchange (count `2`: the long message that starts `Reply with only the word OK.`, then `OK`; no `PONG`). `control-openhands browser enabled 'testid=submit-button'` should be `true` with the prefilled text; today it is `false` until the text is edited or the page is reloaded (see Gotchas). Send it with `control-openhands browser press Enter --selector 'testid=chat-input'` (Enter sends whatever the Send button's state is) and `control-openhands conversation wait <branch-id> --fresh --timeout 120`: expected `finished` with a reply; today it ends `error` (Agent Server bug, see Gotchas).+- **Images (`F06.image-attachments`).** Run `control-openhands fixture image --name qa-f06-img` (prints the PNG path), `control-openhands browser upload 'testid=upload-image-input' <png path>` (a thumbnail appears in the composer), fill `testid=chat-input` with `Reply with only the word SEEN.` and click `testid=submit-button`. The user bubble contains `image-carousel` / `image-preview`. Run `control-openhands browser hover 'testid=image-preview'`, `control-openhands browser click 'testid=expand-image-button'` (`count 'testid=image-lightbox'` is `1`), `control-openhands browser press Escape` (`0`), click `expand-image-button` again and `control-openhands browser click 'testid=image-lightbox-close'` (`0`).+- **Error events (`F06.error-events`).** Any run that ends in a `ConversationErrorEvent` (today: any message sent in a branched conversation) leaves `conversation wait <id>` at `"status": "error"`; `control-openhands browser testids 'testid=chat-interface'` lists `error-message-banner` with `warning-message-banner-icon` and the error's text, and the composer status reads `Error`. Read the code with `control-openhands api GET "/api/conversations/<id>/events/search?limit=3&sort_order=TIMESTAMP_DESC"`.+- **Skill installed banner (`F06.skill-install-banner`).** The banner keys on the installer's success line in terminal output. Put this one line in a prompt file: `Run exactly this one terminal command, verbatim, then reply DONE: mkdir -p .agents/skills/qa-skill && printf '# qa-skill\n' > .agents/skills/qa-skill/SKILL.md && echo "✅ Successfully installed 'qa-skill' to $PWD/.agents/skills/qa-skill"`, then run `control-openhands conversation start --prompt "$(cat <prompt file>)" --wait --timeout 150`. `control-openhands browser text 'testid=skill-install-restart-banner'` reads `Installed to this workspace: qa-skill. Skills load when a conversation starts, so this conversation can't use them yet.` Run `control-openhands browser click 'testid=skill-install-restart-action' --expect-url '/conversations/(?!<id>)'`; `control-openhands api GET /api/conversations/<new id>` has the same `workspace.working_dir` as the source. Back on the source (`control-openhands browser goto /conversations/<id>`), `control-openhands browser click 'testid=skill-install-restart-dismiss'` hides it (count `0`); after `browser reload` it is back (dismissal is session-only by design).+- **No LLM (`F06.llm-not-configured-banner`).** On the fresh no-LLM run: `control-openhands onboard --skip`, `control-openhands browser click 'testid=conversation-panel-new-thread-picker'`, `control-openhands browser click 'testid=launch-no-workspace' --expect-url '/conversations/'`. `control-openhands browser text 'testid=home-llm-not-configured-banner'` reads `Your LLM isn't set up yet, so conversations won't run. Finish setup to get started. Set up LLM`; `count 'testid=chat-suggestions'` is `0`; the composer cannot take text (`control-openhands browser attr 'testid=chat-input' contenteditable` is `false`, so `browser fill` fails) and `control-openhands browser enabled 'testid=submit-button'` is `false`. `control-openhands browser click 'testid=home-llm-not-configured-action'` then `browser url` ends in `/settings/llm`.+- **Critic (`F06.critic-result`, blocked).** Toggle the hidden switch through its label on `/settings/verification`: `control-openhands browser goto /settings/verification`, `control-openhands browser click 'label:has([data-testid="sdk-settings-verification.critic_enabled"])'`, save, `api GET /api/settings` shows `"critic_enabled": true`. Without a Critic API key a `Reply with only the word OK.` conversation renders no critic block. Turn it off again the same way.+- **Phone (`F06.phone`).** Run `control-openhands browser viewport phone`, open the table conversation (`control-openhands browser goto /conversations/<stream id>`), `control-openhands browser bbox 'testid=chat-interface'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser bbox 'testid=markdown-table-scroll'` (`scrollWidth` larger than `clientWidth`: the table scrolls inside itself). `control-openhands browser screenshot --feature F06.phone --name conversation`, then `control-openhands browser viewport desktop`.+- After each group run `control-openhands browser errors --app-only`. Outages driven with `service stop` log connection-refused console errors by design; `pageErrors` must stay `0`.++## Gotchas++- `control-openhands conversation events <id>` returns only the last 25 events unless you pass `--last N`; event texts are cut at about 160 characters.+- `--observe` takes a CSS selector (`'[data-testid=chat-message-sending]'`), not the ` >> ` syntax; a `testid=` value there fails with "not a valid selector".+- `role=button[name="Expand"]` also matches "Expand thinking" and "Expand actions"; use `[exact]` to target tool rows. Each click flips the row to Collapse, so `nth=0` walks to the next collapsed row.+- Tool rows show no success icon; the only indicators are the `exit N` badge for non-zero exits and a clock icon (`status-icon`) for timeouts. A single action is not grouped: it renders as a bare row without `event-group`.+- The model writes the tool titles and may append to commands (it turned `ls /missing` into `ls ...; echo "EXIT:$?"`, exit 0). Ask for the command "verbatim, with nothing appended" when the exit code matters.+- The agent itself may open files with `canvas_ui_control` (a third action in the echo/file run). Close the file tab before proving that a path link opens it.+- On Settings → Verification the Security Analyzer field (All tab) is shown only while Confirmation Mode is on: switch Confirmation Mode on first, then pick the analyzer. Check `api GET /api/settings` after saving.+- Confirmation mode with the default Security Analyzer `LLM` uses ConfirmRisky(HIGH): harmless commands run without a prompt. Set the analyzer to `None` to confirm every action, and restore `LLM` afterwards. The composer stays editable while waiting (status "User needed"); the buttons read Cancel / Continue.+- Known failure, Canvas UI: after Cancel the event group keeps a spinner and "1/2 actions completed" forever, even after reload, although the conversation is idle and the server recorded `UserRejectObservation` (the group only counts `ObservationEvent`s) (#17920). Evidence `F06.confirmation-mode/rejected-after-reload.png`.+- Known failure, Canvas UI: the confirm/cancel shortcuts check only `metaKey`; on Linux/Windows `Control+Enter` does nothing although the composer and plan shortcuts accept Ctrl (#17928).+- Known failure, Canvas UI (repro candidate, not filed yet): after a user-message branch the composer holds the prefilled text but Send stays disabled (`browser enabled 'testid=submit-button'` is `false`, and a click on it times out with `element is not enabled`). The prefill is a saved draft that `src/hooks/chat/use-draft-persistence.ts` writes into the field without an input event, and the composer is reused across the client-side switch, so its Send state keeps the source conversation's empty field. Editing the text, a reload, or Enter in the field (`browser press Enter --selector 'testid=chat-input'`) all work. A draft restored by a sidebar switch behaves the same (F05 Gotchas).+- Known failure, likely Agent Server: every message in a branched conversation ends with `ConversationErrorEvent` `LLMAuthenticationError` ("Your LLM API key appears to be invalid or has expired."), while the source conversation keeps working (OpenHands/software-agent-sdk#5465). Do not use branches as fixtures for other checks.+- "The terminal session was reset because the underlying tmux server/session disappeared" (clock `status-icon` on the row) appears after a `service stop agent-server` / `restart` cycle. Since `launch` gives each run its own short `TMUX_TMPDIR`, other runs no longer cause it. The underlying product bug is still open (OpenHands/OpenHands#17946) for plain `agent-canvas` instances: `bin/agent-canvas.mjs` → `scripts/dev-with-automation.mjs` passes `TMUX_TMPDIR=<state>/tmux` to the Agent Server but `ensureDirectories` never creates it (`dev-safe.mjs` does), so tmux 3.4 falls back to the shared `/tmp/tmux-<uid>/openhands` socket and another instance's restart or stop kills this run's windows. The model usually reruns the command; expect an extra action.+- The `ConversationErrorEvent` banner is not restored after navigating away and back (or a reload); read the error from the events API instead.+- After `restart`, reconnection takes about 20 s without a click; click `error-message-banner-retry` to reconnect at once. The error banner does not come back after a page reload once the stack is healthy.+- "Sending..." lasts about 100 to 650 ms on a local stack, too short to hover and click `chat-message-stop`; that stop path is not driven here. The `F06.pending-messages` failure path needs `service stop agent-server`.+- Local `Stop` calls the Agent Server's interrupt (Cloud pauses the sandbox instead, see `pauseConversation`): a command already running in the terminal is cut off, recorded as `AgentErrorEvent` + `InterruptEvent`, and after Play the model only reports the interruption.+- The no-LLM banner reuses the home banner's test ids (`home-llm-not-configured-banner`). It exists only in a run where no LLM was ever configured: use a separate `launch --new`, never remove the profile from the shared run.+- Read the clipboard with `control-openhands browser clipboard`, never `browser eval "navigator.clipboard.readText()"`. An agent bubble that contains a code block holds two `copy-to-clipboard` buttons (the code block's is hidden until hovered): scope the bubble's with `>> nth=0`.+- Plan-mode previews (`plan-preview-*`) and the BTW side messages render in this stream but are reached from the composer's mode controls; they are not mapped here.diff --git a/.agents/skills/verify-openhands/references/feature-map/F07-conversation-page.md b/.agents/skills/verify-openhands/references/feature-map/F07-conversation-page.mdnew file mode 100644index 0000000000..8b42eea77f--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F07-conversation-page.md@@ -0,0 +1,108 @@+# F07 — Conversation page, header and management menu++The conversation page (`/conversations/<id>`) shows the chat pane: a header with+the runtime status dot, the editable title, the "..." management menu and the+Git actions, Overview and panel toggles, then the message history and the+composer. From the header a user renames, stops or resumes the runtime, opens+the skills, hooks and agent-tools dialogs, exports or downloads the+conversation, jumps to usage and deletes it.++Source: `src/routes/conversation.tsx`, `src/components/features/conversation/`, `src/components/features/conversation-panel/`, `src/components/features/controls/server-status-context-menu.tsx`, `src/hooks/use-conversation-name-context-menu.ts`.++## Sub-features++- `F07.open-by-url`: `/conversations/<id>` shows header, history and composer, and remembers the id as the backend's last conversation.+- `F07.missing-redirect`: an unknown id toasts "This conversation does not exist…" and redirects to `/conversations`.+- `F07.history-skeleton`: opening a conversation shows a message skeleton until its history has loaded.+- `F07.panel-route`: at phone width (up to 1024 px) the header panel button opens `/conversations/<id>/panel`, the tabs panel full width with a Back button; wider, that URL redirects to `/conversations/<id>` with the drawer open beside the chat.+- `F07.rename-inline`: double-click the title (or menu Rename), Enter or blur saves with a toast; an empty value reverts.+- `F07.status-menu`: hovering the status dot (or tapping it on touch) opens a menu with the state and Stop Runtime (active) or Start Runtime (paused).+- `F07.menu-open`: the "..." menu opens under the title; Escape closes it and returns focus to "...", and so does an outside click (without the focus move).+- `F07.menu-items-by-state`: Show Available Hooks and Stop Conversation appear only while the conversation is active.+- `F07.skills-modal`: Show Available Skills lists the loaded skills with expandable rows and Refresh.+- `F07.hooks-modal`: Show Available Hooks lists hooks or "No hooks configured for this conversation."+- `F07.skills-modal-project`: a workspace with `.agents/skills/<name>/SKILL.md` adds a "Project skills" section above the public ones; each row expands to its triggers and body, and the list is re-read from the workspace when the dialog opens or Refresh is clicked.+- `F07.agent-tools-modal`: Show Agent Tools & Metadata shows the system message and the tool list.+- `F07.export-transcript`: Export… downloads a Markdown or HTML transcript with optional tool details and timestamps.+- `F07.download-zip`: Download conversation data downloads `conversation_<id>.zip`.+- `F07.display-cost`: Display Usage and Cost opens the right panel on the Usage tab.+- `F07.stop-confirm`: Stop Conversation asks for confirmation; Confirm Close pauses the conversation and returns to `/conversations`.+- `F07.delete-confirm`: Delete Conversation names the title in a confirmation; Cancel keeps it, Confirm Delete removes it and returns to `/conversations`.+- `F07.branch-from-message`: Branch from here on a message forks the conversation as `<title> (branch)`; on a user message the message is left out and its text goes back into the composer.+- `F07.right-panel-toggle`: the header panel button shows and hides the right tabs panel (closed again after a reload).+- `F07.overview-toggle`: the header (i) button shows and hides the Overview column, which is exclusive with the right panel.+- `F07.git-actions-menu`: Git actions offers Commits, Pull, Push, Create PR and Create New Branch; each pre-fills the composer without sending.+- `F07.git-control-bar`: under the composer, a folder workspace shows an inert workspace chip and the branch; with a GitHub `origin` the repo and branch chips link to GitHub and Pull, Push and Pull Request appear.+- `F07.git-control-bar-send`: the Pull, Push and Pull Request chips send their git prompt to the agent at once.+- `F07.cloud-only`: Share publicly, Connect Repo, `task-<uuid>` start URLs, paused-sandbox resume, archived read-only state and the shared-conversation redirect exist only on a Cloud backend.+- `F07.phone`: at 390 px the header keeps its controls and the info dialogs fit the viewport.++## How to get to it (user POV)++- Sidebar conversation row (`conversation-card`), or the home composer submit, which navigates to the new conversation.+- Direct URL `/conversations/<id>`.+- Direct URL `/conversations/<id>/panel`, or the header panel button, at phone width (up to 1024 px); at desktop width that URL redirects to `/conversations/<id>` with the drawer open.+- Hovering a message in the history: **Branch from here** (local backends only).+- Chips under the composer (git control bar) for conversations in a git workspace (home **Open Workspace**).+- Header controls inside `testid=chat-pane-header`: the status dot (`server-status-menu-trigger`), the title (`conversation-name-title`), the "..." button (`ellipsis-button`, aria "More options"), `conversation-git-actions-toggle`, `conversation-overview-toggle`, `right-panel-toggle`.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and an active LLM profile (`control-openhands llm preset deepseek`).+- A finished conversation: `control-openhands conversation start --prompt "Reply with the single word: pong" --wait --timeout 240` prints its `<id>`.+- A running conversation for the active-only items: `control-openhands conversation start --prompt "Run the shell command: sleep 90 ; then reply with the word done" --wait --until running --timeout 120` prints `<running-id>`. It finishes after about 90 s, so start it right before `F07.stop-confirm` (after a Stop it stays `paused` until Start Runtime).+- A conversation in a git workspace for the git control bar: `control-openhands fixture git-repo --name qa-f07-repo`, then `control-openhands browser goto /` (`conversation start` left the browser on `<id>`), `control-openhands browser click 'testid=open-workspace-button'`, `control-openhands browser click 'role=dialog >> role=combobox[name="Select a workspace"]'`, `control-openhands browser click 'role=dialog >> role=button[name="+ Add Workspace"]'`, `control-openhands browser click 'testid=folder-browser-sidebar-workspace'`, `control-openhands browser click 'testid=folder-browser-up'` three times (to the run directory), `control-openhands browser click 'testid=folder-browser-entry-workspace'`, `control-openhands browser click 'testid=folder-browser-entry-qa-f07-repo'`, `control-openhands browser click 'testid=folder-browser-use'`, `control-openhands browser click 'testid=workspace-launch-button'`, then `control-openhands conversation start --prompt "Reply with the single word: ok" --stay --wait --timeout 240` prints `<git-id>`.+- Cloud-only rows (`F07.cloud-only`) are blocked without an OpenHands Cloud account.+- Desktop viewport unless a bullet says otherwise.++- **Open by URL (`F07.open-by-url`).** Run `control-openhands browser goto /conversations/<id>`, `control-openhands browser wait 'testid=chat-pane-header'`, `control-openhands browser text 'testid=conversation-name-title'` and `control-openhands browser count 'testid=chat-interface >> testid=agent-message'`. The title is the generated one and the count is `1`. `control-openhands browser eval "localStorage.getItem('openhands-last-conversation-by-backend')"` reads `{"default-local":"<id>"}`.+- **Unknown id (`F07.missing-redirect`).** Run `control-openhands browser goto /conversations/00000000-0000-0000-0000-000000000000`, `control-openhands browser wait-url '/conversations$'` and `control-openhands browser toasts`. A toast reads `This conversation does not exist, or you do not have permission to access it. If this is your conversation, try switching to the workspace where it was created.` and the last-conversation slot is `{}`. It is the only toast: `control-openhands browser toasts --history` has no entry with `does not understand`.+- **Rename inline (`F07.rename-inline`).** On `/conversations/<id>` (`control-openhands browser goto /conversations/<id>`; the unknown id redirected to `/conversations`) run `control-openhands browser dblclick 'testid=conversation-name-title'`, `control-openhands browser fill 'testid=conversation-name-input' 'QA_F07 renamed'`, `control-openhands browser press Enter`, `control-openhands browser toasts` (`Conversation title updated successfully`), then `control-openhands browser reload` and `control-openhands browser text 'testid=conversation-name-title'`. It reads `QA_F07 renamed`, and so does `control-openhands browser text 'testid=conversation-card >> testid=conversation-card-title'`.+- **Rename from the menu, empty value (`F07.rename-inline`).** Run `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'`, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=rename-button'`, `control-openhands browser fill 'testid=conversation-name-input' ''` and `control-openhands browser press Enter`. The title stays `QA_F07 renamed` and no toast appears.+- **History skeleton and sidebar entry (`F07.history-skeleton`, `F07.open-by-url`).** From `/` (`control-openhands browser goto /`) run `control-openhands browser click 'testid=conversation-card >> has-text=QA_F07 renamed' --expect-url '/conversations/[0-9a-f-]+' --observe 'testid=chat-messages-skeleton' --observe-ms 3000` (run it after the rename above; before it, match the generated title instead). The `observed` list shows the skeleton present for a few hundred ms, then `<absent>`; the URL is `/conversations/<id>?backend=default-local`.+- **Status menu, stop (`F07.status-menu`).** On `/conversations/<id>` run `control-openhands browser hover 'testid=server-status-menu-trigger'` (for a mouse the hover opens the menu and a click on the open menu's dot closes it; a CLI `click` from elsewhere usually opens it only because the click lands before the hover renders, a race that sometimes leaves it closed, so do not click), `control-openhands browser text 'testid=server-status-context-menu'` (`Running` / `Stop Runtime`), then `control-openhands browser click 'testid=server-status-context-menu >> testid=stop-server-button' --expect-url '/conversations$'` and `control-openhands browser toasts`. The toasts read `Stopping conversation...` and `Conversation stopped` and the URL is `/conversations`.+- **Menu (`F07.menu-open`).** Stop Runtime left the browser on `/conversations`: run `control-openhands browser goto /conversations/<git-id>` (a finished conversation whose runtime was not stopped), then `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'` and `control-openhands browser testids 'testid=conversation-name-context-menu'`. On a finished or running conversation the items are `rename-button`, `show-skills-button`, `show-hooks-button`, `show-agent-tools-button`, `export-transcript-button` (`Export…`), `download-trajectory-button`, `display-cost-button` (`Display Usage and Cost`), `stop-button`, `delete-button`. `control-openhands browser press Escape` closes it (`control-openhands browser count 'testid=conversation-name-context-menu'` is `0`) and focus is back on the trigger (`control-openhands browser eval "document.activeElement.dataset.testid"` is `ellipsis-button`). Open it again: `control-openhands browser mouse-click 900 500` closes it too (count `0`).+- **Stop with confirmation (`F07.stop-confirm`).** On `/conversations/<running-id>` run `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'`, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=stop-button'` and `control-openhands browser snapshot 'role=dialog'` (`Confirm Stop Conversation`, buttons `Cancel` and `Confirm Close`). `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` closes it and `control-openhands conversation status <running-id>` stays `running`. Repeat the two clicks, then `control-openhands browser click 'role=dialog >> role=button[name="Confirm Close"]' --expect-url '/conversations$'`; the toasts read `Conversation stopped` and `conversation status <running-id>` is `paused`.+- **Branch from a message (`F07.branch-from-message`).** On `/conversations/<id>` (`control-openhands browser goto /conversations/<id>`; Stop with confirmation ended on `/conversations`) run `control-openhands browser hover 'testid=agent-message'`, then `control-openhands browser click 'testid=agent-message >> role=button[name="Branch from here"]' --expect-url '/conversations/(?!<id>)[0-9a-f-]+'`, `control-openhands browser text 'testid=conversation-name-title'` (`QA_F07 renamed (branch)`) and `control-openhands browser count 'testid=chat-interface >> testid=user-message'` (`1`, the history is copied up to that reply). Back on `/conversations/<id>` (`control-openhands browser goto /conversations/<id>`), `control-openhands browser hover 'testid=user-message'` and `control-openhands browser click 'testid=user-message >> role=button[name="Branch from here"]' --expect-url '/conversations/(?!<id>)[0-9a-f-]+'` (it prints `/conversations/<branch-id>`): the new branch has `0` user messages and `control-openhands browser text 'testid=chat-input'` reads the original prompt `Reply with the single word: pong`, still there a few seconds later and not sent (`control-openhands conversation events <branch-id> --kinds MessageEvent` has count `0`).+- **Delete with confirmation (`F07.delete-confirm`).** On a disposable conversation (for example the branch from `F07.branch-from-message`) run `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'`, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=delete-button'` and `control-openhands browser snapshot 'role=dialog'`: `Confirm Delete Are you sure you want to delete the "<title>" conversation? This action cannot be undone.` with `Cancel` and `Confirm Delete`. `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps the URL. Repeat the two clicks, then `control-openhands browser click 'role=dialog >> role=button[name="Confirm Delete"]' --expect-url '/conversations$'`; `control-openhands api GET '/api/conversations?ids=<id>'` returns `[null]` and `browser goto /conversations/<id>` redirects as in `F07.missing-redirect`.+- **Paused conversation (`F07.menu-items-by-state`, `F07.status-menu`).** Run `control-openhands browser goto /conversations/<running-id>`, open the "..." menu and `control-openhands browser testids 'testid=conversation-name-context-menu'`: `show-hooks-button` and `stop-button` are absent. Close it with `control-openhands browser mouse-click 900 500`. Run `control-openhands browser click 'testid=server-status-menu-trigger'` and `control-openhands browser text 'testid=server-status-context-menu'` (`Server Stopped` / `Start Runtime`), then `control-openhands browser click 'testid=server-status-context-menu >> testid=start-server-button'` and `control-openhands conversation wait <running-id> --until running,finished,idle --timeout 60`. The status is `running` again and the menu reads `Running` / `Stop Runtime`.+- **Hooks (`F07.hooks-modal`).** On an active conversation open the "..." menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=show-hooks-button'` and `control-openhands browser text 'testid=hooks-modal'`. It reads `Available Hooks`, the workspace explanation and `No hooks configured for this conversation.`; `control-openhands browser click 'testid=hooks-modal >> testid=refresh-hooks'` keeps it, `control-openhands browser click 'testid=close-hooks-modal'` closes it.+- **Skills (`F07.skills-modal`).** Open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=show-skills-button'`, `control-openhands browser snapshot 'role=dialog'` (`Public skills 12` and one button per skill), `control-openhands browser click 'testid=skills-modal >> role=button[name="github Knowledge"]'`; the row expands to `Triggers` and `Content`. `control-openhands browser press Escape` closes it (`browser count 'testid=skills-modal'` is `0`).+- **Project skills and configured hooks (`F07.skills-modal-project`, `F07.hooks-modal`).** Arrange (outside the UI) a project skill and a hook in the git fixture: `mkdir -p <run>/workspace/qa-f07-repo/.agents/skills/qa-f07-skill <run>/workspace/qa-f07-repo/.openhands`, write `<run>/workspace/qa-f07-repo/.agents/skills/qa-f07-skill/SKILL.md` with front matter `name: qa-f07-skill`, `description: QA fixture skill for F07.`, `triggers: [qaf07trigger]` and the body `QA_F07 skill body.`, and write `<run>/workspace/qa-f07-repo/.openhands/hooks.json` as `{"pre_tool_use":[{"matcher":"terminal","hooks":[{"type":"command","command":"true","timeout":10}]}]}`. Then `control-openhands conversation start --workspace qa-f07-repo --prompt "Reply with the single word: hi" --wait --timeout 240` prints `<hooks-id>`; `control-openhands api GET /api/conversations/<hooks-id>` shows that `hook_config.pre_tool_use` holds the `terminal` matcher. On `/conversations/<hooks-id>` open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=show-skills-button'` and `control-openhands browser snapshot 'role=dialog'`: `Project skills 1` with `button "qa-f07-skill AgentSkills"` above `Public skills 12`. `control-openhands browser click 'testid=skills-modal >> role=button[name="qa-f07-skill AgentSkills"]'` expands it to `Triggers qaf07trigger Content QA_F07 skill body.`; `control-openhands browser click 'testid=skills-modal >> testid=refresh-skills'` re-reads the workspace (`browser network` shows `POST /api/skills`). Close with `control-openhands browser press Escape`. Hooks: open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=show-hooks-button'` and `control-openhands browser text 'testid=hooks-modal'` should list a `Pre Tool Use` event with `Matcher` `terminal` and `Commands` `true`; today it reads `No hooks configured for this conversation.` even after `refresh-hooks` (see Gotchas).+- **Agent tools (`F07.agent-tools-modal`).** Open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=show-agent-tools-button'`; the dialog `testid=system-message-modal` has tabs `System Message` (selected, the system prompt) and `Available Tools`. `control-openhands browser click 'role=dialog >> role=tab[name="Available Tools"]'`, `control-openhands browser count 'testid=system-message-modal >> testid=toggle-button'` (`9`), `control-openhands browser click 'testid=system-message-modal >> testid=toggle-button >> nth=0'` expands `terminal` with its description. Close with `control-openhands browser click 'testid=close-system-message-modal'`.+- **Export transcript (`F07.export-transcript`).** Open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=export-transcript-button'`; `control-openhands browser snapshot 'role=dialog'` shows `Export conversation`, radio `Markdown document (.md)` checked, `Standalone web page (.html)`, and checkboxes `Include tool call details` and `Include timestamps` checked. `control-openhands browser click 'testid=confirm-transcript-export'` then `control-openhands browser downloads --last 1 --inspect`: a `<ms>-conversation-<id>.md` (the harness prefixes a timestamp to the suggested `conversation-<id>.md`) lands in `<run>/private/downloads` starting `# QA_F07 renamed`, `**Model:** deepseek/deepseek-flash`, `## User` with `<sub>` timestamps. Reopen, `control-openhands browser click 'role=dialog >> role=radio[name="Standalone web page (.html)"]'`, `control-openhands browser click 'role=dialog >> role=checkbox[name="Include timestamps"]'`, export: the `.html` has `<title>QA_F07 renamed</title>` and no timestamps. Reopen once more: `control-openhands browser click 'testid=cancel-transcript-export'` closes it without a download (the file count in `<run>/private/downloads` is unchanged); `browser press Escape` and `testid=close-transcript-export-modal` close it too.+- **Download data (`F07.download-zip`).** Open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=download-trajectory-button'`, then `control-openhands browser downloads`. A `<ms>-conversation_<id>.zip` lands in `<run>/private/downloads`; `browser downloads --last 1 --inspect` lists `<id-without-dashes>/base_state.json` and `bash_events/`, and every LLM `api_key` in `base_state.json` is masked as asterisks (`**********`).+- **Usage (`F07.display-cost`).** Open the menu, `control-openhands browser click 'testid=conversation-name-context-menu >> testid=display-cost-button'`, `control-openhands browser wait 'testid=usage-panel'` and `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` (`true`). The panel shows Context Window, Token Usage and Total Cost (contents are F27).+- **Right panel (`F07.right-panel-toggle`).** Run `control-openhands browser click 'testid=right-panel-toggle'` and `control-openhands browser attr 'testid=right-panel-toggle' aria-label`: it alternates `Show panel` / `Hide panel`, and `control-openhands browser wait 'testid=tabs-pane-header' --state hidden --timeout 5000` (after `Show panel`) or `--state visible` (after `Hide panel`) follows; a plain `browser visible` right after the click still reads the old value while the panel animates. With the panel open, `control-openhands browser reload` and `browser attr 'testid=right-panel-toggle' aria-pressed` reads `false` (closed by design; the selected tab is remembered).+- **Overview (`F07.overview-toggle`).** Run `control-openhands browser click 'testid=conversation-overview-toggle'`, `control-openhands browser visible 'testid=conversation-overview-panel'` (`true`) and `browser attr 'testid=conversation-overview-toggle' aria-label` (`Hide overview`). Then `control-openhands browser click 'testid=right-panel-toggle'`: `control-openhands browser wait 'testid=conversation-overview-column' --state hidden --timeout 5000` succeeds (an immediate `browser visible` can still read `true`). With the panel open, `control-openhands browser hover 'testid=conversation-overview-toggle'` and `control-openhands browser wait 'testid=conversation-overview-peek' --timeout 5000` shows the peek. Clicking the overview toggle now closes the panel (`aria-pressed` `false`) and shows the overview (`browser wait 'testid=conversation-overview-column' --state visible`). Click the overview toggle once more to restore the closed state.+- **Git actions (`F07.git-actions-menu`).** Run `control-openhands browser click 'testid=conversation-git-actions-toggle'` and `control-openhands browser testids 'testid=conversation-git-actions-menu'` (`-commit`, `-pull`, `-push`, `-create-pr`, `-create-new-branch`, labels `Commits`, `Pull`, `Push`, `Create PR`, `Create New Branch`). `control-openhands browser click 'testid=conversation-git-actions-menu >> testid=conversation-git-actions-commit'` then `control-openhands browser text 'testid=chat-input'`: `Please review the current changes and create a git commit with a concise, descriptive message.`; `conversation events <id> --kinds MessageEvent` shows no new message. Each item replaces the composer text: `-pull` gives `Please pull the latest code from the repository.`, `-create-new-branch` gives `Please create a new branch with a descriptive name related to the work you plan to do.`, and the Push and Create PR prompts name `GitHub` by default. `control-openhands browser press Escape` closes the open menu. Clear the composer with `control-openhands browser fill 'testid=chat-input' ''`.+- **Panel route (`F07.panel-route`).** Run `control-openhands browser viewport phone`, open `/conversations/<id>` (`control-openhands browser goto /conversations/<id>`), `control-openhands browser click 'testid=right-panel-toggle' --expect-url '/panel$'` and `control-openhands browser testids --filter mobile` (`conversation-mobile-panel-top`, `conversation-mobile-panel-back`), then `control-openhands browser click 'testid=conversation-mobile-panel-back' --expect-url '/conversations/[0-9a-f-]+$'`. Direct entry at phone width: `control-openhands browser goto /conversations/<id>/panel` and `control-openhands browser wait 'testid=conversation-mobile-panel-back'` succeed (`control-openhands browser screenshot --feature F07.panel-route --name phone-direct`). The panel page serves every width up to 1024 px: after `control-openhands browser viewport tablet` the URL still ends `/panel` and `control-openhands browser count 'testid=conversation-mobile-panel-back'` is `1`. Wider, there is no panel page: run `control-openhands browser viewport desktop`, then `control-openhands browser wait-url '/conversations/[0-9a-f-]+$'` (the app replaces `/panel` with `/conversations/<id>`), `control-openhands browser count 'testid=conversation-mobile-panel-back'` (`0`) and `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` (`true`: the drawer is open beside the chat). A desktop-width visit lands the same way (#18045): `control-openhands browser goto /conversations/<id>/panel`, `control-openhands browser wait-url '/conversations/[0-9a-f-]+$'`, the same count (`0`) and `aria-pressed` (`true`); `control-openhands browser screenshot --feature F07.panel-route --name desktop-redirect` shows the chat with the drawer open beside it.+- **Git control bar (`F07.git-control-bar`).** On `/conversations/<git-id>` (`control-openhands browser goto /conversations/<git-id>`; Panel route ends on `/conversations/<id>`) run `control-openhands browser snapshot 'testid=interactive-chat-box'`: `button "qa-f07-repo" [disabled]` and the branch text `main`, no Pull/Push. Add a GitHub origin to the fixture (arrange step, outside the UI): `git -C <run>/workspace/qa-f07-repo remote add origin https://github.com/qa-example/qa-f07-repo.git`. Then `control-openhands browser reload` and the snapshot again: link `qa-example/qa-f07-repo` (`https://github.com/qa-example/qa-f07-repo`), link `main` (`…/tree/main`) and buttons `Pull`, `Push`, `Pull Request`.+- **Pull sends at once (`F07.git-control-bar-send`).** Run `control-openhands browser click 'testid=interactive-chat-box >> role=button[name="Pull"][exact]'` and `control-openhands browser wait 'testid=user-message >> has-text=Please pull the latest code' --timeout 15000`; `conversation status <git-id>` is `running`. Stop it right away with Stop Conversation as in `F07.stop-confirm` (the fake remote cannot be pulled). Push and Pull Request are blocked: they need a real remote and GitHub credentials.+- **Cloud-only (`F07.cloud-only`).** Blocked without a Cloud backend. On local, confirm the absence: the menu testids (see `F07.menu-open`) have no `share-publicly-button`, and the git control bar shows no `Connect Repo` chip. With Cloud: the menu's **Share publicly** switch (`share-publicly-button`, then `copy-share-link-button`, `open-share-link-button`), the repo chip **Connect Repo** opening the Open repository modal (`close-open-repository-modal`), `/conversations/task-<uuid>` while a conversation starts, and the `Unavailable for Archives` tooltips (see F25).+- **Phone (`F07.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser testids 'testid=chat-pane-header'` (adds `sidebar-mobile-menu-toggle`; all header controls visible), open each info dialog from the menu and `control-openhands browser bbox 'testid=skills-modal'` (likewise `hooks-modal`, `system-message-modal`): `insideViewport` is `true` and `pageHorizontalOverflow` `false`. Then `control-openhands browser click 'testid=chat-pane-header >> testid=ellipsis-button'` and `control-openhands browser bbox 'testid=conversation-name-context-menu'`: inside the viewport too (`x` about 145, `width` about 237), and `control-openhands browser screenshot --feature F07.phone --name header-menu` shows every label whole (`Show Available Skills`, `Download conversation data`, `Delete Conversation`). `control-openhands browser press Escape` closes it. Return with `control-openhands browser viewport desktop`.++## Gotchas++- The stop and delete confirmation buttons have no test ids at runtime (`BrandButton` takes `testId`, the modals pass `data-testid`) (#17915): select them by role inside `role=dialog`.+- `stop-button`, `show-skills-button`, `show-hooks-button` and `show-agent-tools-button` also exist in the composer, and `ellipsis-button` in sidebar rows: always scope to `testid=chat-pane-header` or `testid=conversation-name-context-menu`.+- Stop Runtime (status menu) and Stop Conversation (menu) both navigate to `/conversations`. On a finished local conversation the agent server keeps `finished`; use a running conversation to see `paused` and Start Runtime.+- Rename has no Escape-to-cancel: Escape leaves the input open and the next blur saves whatever was typed.+- Expected: Escape closes the status-dot menu, as it closes the "..." and Git actions menus. Known failure: the menu stays open (`browser count 'testid=server-status-context-menu'` stays `1`), so close it with an outside click (`browser mouse-click 900 500`). Repro candidate, not yet filed: it was listed in a comment on #17933, which #18044 closed while leaving this menu for a follow-up.+- The status menu reads `Running` / `Stop Runtime` for a finished local conversation too; only a paused one shows `Server Stopped` / `Start Runtime`.+- Panel and Overview columns animate: read their state with `browser wait <sel> --state hidden|visible`, not an immediate `browser visible`.+- The Skills dialog re-reads the workspace each time it opens, so a project skill added while the dialog is closed appears without Refresh.+- `tabs-pane-header` and `conversation-overview-column` stay in the DOM when hidden: assert with `browser visible` or `aria-pressed`, not `count`.+- `browser visible 'testid=usage-panel'` right after Display Usage and Cost can read `false`; `browser wait` first.+- Exports and the zip land in `<run>/private/downloads`; the transcript holds the prompts and the zip holds the full event store. Review before sharing.+- `--observe` accepts the same selector syntax as other verbs (`'testid=chat-messages-skeleton'`) as well as CSS.+- A sidebar row click lands on `/conversations/<id>?backend=default-local`: end `--expect-url` regexes without `$` there.+- `role=button[name="Pull"]` also matches `Pull Request`; add `[exact]`.+- The Open Workspace folder browser has no path field: walk it with `folder-browser-up` and `folder-browser-entry-<name>`. `fixture git-repo` puts the repo in `<run>/workspace`, three levels above the `workspace` favorite.+- The repo, branch and Pull/Push chips come from `git remote get-url origin` in the workspace, read when the page loads: reload after changing the remote.+- The Usage tab logs `GET /api/llm/balance` 404 on a local backend (F27); count it in `browser errors --app-only` but it is not an F07 failure.+- The overview's Automations section has no opener in the UI (the overview menu offers Workspace and Git sections only).+- Known product issue (repro candidate, #17924): on a local backend the Hooks dialog shows `No hooks configured`, even for a conversation started with workspace hooks. `getHooks` in `src/api/conversation-service/agent-server-conversation-service.api.ts` always returns an empty list, although the conversation's `hook_config` holds the workspace `.openhands/hooks.json` and the dialog says hooks are loaded from the workspace.+- After the user-message branch in `F07.branch-from-message`, Send stays disabled next to the prefilled text (`browser enabled 'testid=submit-button'` is `false`; repro candidate, not filed yet, see F05 Gotchas). Enter in the field sends it.diff --git a/.agents/skills/verify-openhands/references/feature-map/F08-workspace-files-and-changes.md b/.agents/skills/verify-openhands/references/feature-map/F08-workspace-files-and-changes.mdnew file mode 100644index 0000000000..3d9d726ba3--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F08-workspace-files-and-changes.md@@ -0,0 +1,118 @@+# F08 — Workspace drawer: files and changes++Next to the chat, a conversation has a right-hand drawer with tabs. This family+covers the drawer itself (toggle, tab bar, overflow menu with pinning, the phone+panel page) and its two workspace tabs. **Files** is a read-only browser of the+conversation's working directory: a path row with copy, a strip of open files,+a collapsible tree, and a Rich/Plain viewer for code, Markdown, HTML, images and+binaries. **Commits** lists an "Uncommitted" row and the git history, newest+first. Each expands into per-file Monaco diffs with old/diff/new modes. The+Terminal, Browser, Planner, Task list and Usage tab bodies belong to F27. The+Files tab has no upload, download or edit.++Source: `src/components/features/conversation/conversation-tabs/`, `src/components/features/conversation/right-panel-toggle.tsx`, `src/components/features/conversation/conversation-main/`, `src/routes/conversation.tsx`, `src/hooks/use-conversation-panel-route.ts`, `src/routes/conversation-panel.tsx`, `src/routes/files-tab.tsx`, `src/components/features/files-tab/`, `src/hooks/query/use-workspace-files.ts`, `src/hooks/query/use-workspace-file-content.ts`, `src/hooks/use-auto-refresh-files-on-edit.ts`, `src/routes/commits-tab.tsx`, `src/components/features/diff-viewer/`, `src/services/canvas-ui.ts`.++## Sub-features++- `F08.panel-toggle`: the chat-header toggle (`Show panel`/`Hide panel`, `aria-pressed`) opens and closes the drawer; the first open shows Files.+- `F08.tab-bar`: the tab bar (Files, Commits, Planner, Terminal, Browser, Usage; Task list only when the agent has one) switches the drawer body, and only the active tab shows its label. Clicking the active tab closes the drawer.+- `F08.drawer-state-reload`: after a reload the drawer starts closed, and reopening it restores the last selected tab for that conversation.+- `F08.tabs-menu`: the ellipsis menu at the end of the tab bar lists every tab. Choosing a row opens that tab and closes the menu, and so does clicking outside.+- `F08.tabs-pin`: the pill on each menu row pins or unpins a tab. Unpinning the active tab selects another pinned one, and the choice persists across reloads.+- `F08.drawer-resize`: dragging the chat/drawer divider resizes both panes (chat 30–80 %, default 50 %, stored in `desktop-layout-panel-width`).+- `F08.vscode-link`: a `VSCode` button at the right of the tab bar opens the editor in a new window; it is hidden when the runtime has no editor. (#17660 removed it and #18048 restored it.)+- `F08.archived-disabled`: on an archived conversation the toggle is disabled with the tooltip `Unavailable for Archives`.+- `F08.phone-panel-page`: at 1024 px or narrower the toggle navigates to `/conversations/<id>/panel`, a full-screen page with a Back chevron, the same tab bar and the tab body.+- `F08.panel-direct-url`: opening `/conversations/<id>/panel` directly renders the panel page at 1024 px or narrower, and Back returns to the chat; wider, the URL is replaced with `/conversations/<id>` and the drawer opens beside the chat.+- `F08.files-workspace-path`: `Workspace: <working_dir>` with the full path in its tooltip; the copy button turns into `Copied to clipboard` for about 2 s.+- `F08.files-tree`: a tree of folders, collapsed at first, and files. Clicking a file selects it and adds it to the open-file strip.+- `F08.files-empty-workspace`: a workspace with no files shows `No files in workspace`.+- `F08.files-tree-toggle`: the list-tree button hides or shows the tree, and the choice persists per conversation. The tree is 224 px wide by default.+- `F08.files-tree-resize`: dragging the divider between the tree and the preview resizes the tree (160–480 px, default 224) and the width persists across reloads (`files-tab-tree-width` in localStorage).+- `F08.files-open-tabs`: the open-file strip, each tab with a close X. Closing the selected file selects a neighbour. Open files and the selection survive a reload and do not leak into other conversations.+- `F08.files-no-selection`: with no file selected the pane reads `Select a file to view its contents` and the Rich/Plain toggle is absent.+- `F08.files-rich-plain`: Rich highlights code, renders Markdown and shows HTML in an iframe sandboxed without scripts. Plain shows highlighted source. The mode persists across reloads.+- `F08.files-fallbacks`: images render as `<img>` in Rich mode. Files with NUL bytes show `Binary file – preview not available`, and Office files show `Preview isn't available for Word files.` (or PowerPoint/Excel).+- `F08.files-load-error`: a selected file that can no longer be read shows the error (`Failed to read <path>: 404`).+- `F08.files-open-new-window`: the external-link icon opens the file from the workspace fileserver in a new browser tab.+- `F08.files-refresh`: `Refresh files` re-reads the file list and the selected file's content.+- `F08.files-auto-refresh`: files the agent writes appear without a manual refresh.+- `F08.files-open-from-chat`: clicking a workspace path in an agent (or user) message opens the drawer on Files with that file selected.+- `F08.files-open-from-tool-chip`: the path chip on a file-editor tool card (absolute path) opens the drawer on Files with that file selected.+- `F08.commits-states`: with no commits and no changes the Commits tab shows `No commits yet`. While the runtime is inactive it shows `Waiting for runtime to start...`, and while loading `Loading changes...`.+- `F08.uncommitted-changes`: the top row reads `-`, `Uncommitted` and a file count; expanding it lists the changed paths.+- `F08.commit-rows`: each commit row shows the short SHA, subject, author (only when there are several authors) and relative time. Rows are single-open accordions, and new agent commits appear without a reload.+- `F08.commits-cap`: the history loads the latest 50 commits; a longer history ends with `Showing the latest 50 commits`.+- `F08.diff-view-modes`: expanding a changed file shows its diff; the view-mode buttons (`Old version`, `Diff`, `New version`) switch between old, diff and new without page errors.+- `F08.diff-markdown-preview`: a Markdown file in new (or old) mode renders as a prose preview.+- `F08.diff-deleted-file`: a deleted working-tree file reads `This file was deleted. Its previous contents are no longer available for preview.`+- `F08.changes-from-overview`: the overview's Changes row opens the drawer on Commits with Uncommitted expanded and closes the overview.++## How to get to it (user POV)++- Chat header: the panel toggle (`right-panel-toggle`, block-drawer icon, right of the overview `i` button). At desktop width it shows or hides the drawer; at 1024 px or narrower it navigates to the panel page.+- Drawer tab bar (`tabs-pane-header`): `conversation-tab-files`, `conversation-tab-commits`. The ellipsis (`tabs-pane-header >> testid=ellipsis-button`) opens the menu with `conversation-tabs-menu-open-<tab>` and `conversation-tabs-menu-pin-<tab>`.+- Direct URL `/conversations/<id>/panel` (the phone panel page at 1024 px or narrower; wider, it redirects to `/conversations/<id>` with the drawer open).+- Overview (`conversation-overview-toggle`) → Changes row (`conversation-overview-diffs`) → Commits tab with Uncommitted expanded.+- Workspace paths in agent messages written as inline code (`markdown-file-path-link`), plus path chips in file-editor tool cards (`file-path-chip`) → Files tab with that file selected.+- There is no command-menu entry or keyboard shortcut for the drawer or these tabs.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` (three short model turns, deepseek-flash).+- A git fixture: `control-openhands fixture git-repo` (creates `<run>/workspace/qa-repo` with `README.md`, `src/calc.py`, `src/test_calc.py` and one commit by `QA Fixture`).+- The conversation runs in that repo. From `/` run `control-openhands browser click 'testid=open-workspace-button'`, `control-openhands browser click 'testid=workspace-dropdown'`, `control-openhands browser click 'role=button[name="+ Add Workspace"]'`. The folder browser opens at `<run>/private/home`, so then run `control-openhands browser click 'testid=folder-browser-up'` twice, `control-openhands browser dblclick 'testid=folder-browser-entry-workspace'`, `control-openhands browser dblclick 'testid=folder-browser-entry-qa-repo'`, `control-openhands browser click 'testid=folder-browser-use'` and `control-openhands browser click 'testid=workspace-launch-button'`. The composer now shows a `qa-repo` chip. Start with `--stay`, which keeps that chip; a plain `conversation start` navigates home and loses it.+- Seed changes with a prompt file, because the command contains quotes. Write `qa-f08-1.txt` (anywhere outside the workspace) containing: ``In the current workspace directory run exactly this one bash command and then reply only "done": printf '# QA notes\n\nHello **world**\n' > qa-notes.md && printf '<h1>QA page</h1>\n' > qa-page.html && printf 'def sub(a, b):\n return a - b\n' >> src/calc.py && rm src/test_calc.py && printf 'PK\003\004' > qa-deck.pptx && head -c 64 /dev/urandom > qa-blob.bin && git status --short``. Then run `control-openhands conversation start --stay --prompt "$(cat qa-f08-1.txt)" --wait --timeout 240`. Read `<id>` from its `id` (or `control-openhands browser url`); the browser stays on `/conversations/<id>`.+- Viewport desktop (1440×1000) unless a bullet says phone.++- **Open the drawer (`F08.panel-toggle`).** Run `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` (`false`) and `control-openhands browser tooltip 'testid=right-panel-toggle'` (`Show panel`). Then run `control-openhands browser click 'testid=right-panel-toggle'`, followed by `control-openhands browser attr 'testid=right-panel-toggle' aria-label` and `control-openhands browser visible 'testid=files-tab'`. The label is `Hide panel`, `aria-pressed` is `true`, and Files is visible with the workspace path and tree (`browser screenshot --feature F08.panel-toggle --name drawer-open-files`).+- **Switch and close by tab (`F08.tab-bar`).** Run `control-openhands browser click 'testid=conversation-tab-commits'` and `control-openhands browser wait 'testid=commit-list' --state visible --timeout 10000` (the first open shows `Loading changes...` for a moment, so an immediate `browser visible` can read `false`). Click `testid=conversation-tab-commits` again. `right-panel-toggle` `aria-pressed` becomes `false` and `control-openhands browser visible 'testid=tabs-pane-header'` is `false`. Reopen with `right-panel-toggle`.+- **Reload (`F08.drawer-state-reload`).** With Commits selected, run `control-openhands browser reload`, then `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` (`false`; the drawer is closed). Click `testid=right-panel-toggle`; `control-openhands browser visible 'testid=commit-list'` is `true`.+- **Overflow menu (`F08.tabs-menu`).** Run `control-openhands browser click 'testid=tabs-pane-header >> testid=ellipsis-button'` and `control-openhands browser testids --filter conversation-tabs-menu`; there is one open row and one pin row per tab. Run `control-openhands browser click 'testid=conversation-tabs-menu-open-usage'`; then `control-openhands browser count 'testid=conversation-tabs-menu-open-usage'` is `0` (menu closed) and the bar's active label is `Usage`. Reopen the menu and run `control-openhands browser mouse-click 560 600` (over the chat); the menu count is `0`.+- **Pin/unpin (`F08.tabs-pin`).** With Usage active, open the menu and run `control-openhands browser click 'testid=conversation-tabs-menu-pin-usage'`, then `control-openhands browser attr 'testid=conversation-tabs-menu-pin-usage' aria-label` (`Pin tab to bar`; `aria-pressed` is `false`). Close the menu with `browser mouse-click 560 600`, then run `control-openhands browser count 'testid=tabs-pane-header >> testid=conversation-tab-usage'`. The count is `0` and Planner is now active. Run `control-openhands browser reload` and reopen the drawer; the count is still `0`. To restore, open the menu, click `testid=conversation-tabs-menu-pin-usage` (label `Unpin tab from bar`), then `control-openhands browser click 'testid=conversation-tabs-menu-open-files'`. The usage tab count is `1` again.+- **Resize (`F08.drawer-resize`).** The divider has no test id; its grip is the first `.cursor-ew-resize` on the page (the second is the Files tree divider). With the drawer open, `control-openhands browser bbox 'testid=chat-interface'` and `control-openhands browser bbox 'testid=tabs-pane-header'` are about 570 px wide each and `control-openhands browser eval "localStorage.getItem('desktop-layout-panel-width')"` is `"50"`. Run `control-openhands browser drag '.cursor-ew-resize >> nth=0' --by 200,0`: the chat is 770 px, the drawer about 369 px and the key about `67.5`. `--by 900,0` clamps at `"80"`, `--by -1200,0` at `"30"` (chat 342 px), and after `browser reload` plus the toggle the chat is still 342 px. Restore with `control-openhands browser drag '.cursor-ew-resize >> nth=0' --by 228,0` (chat 570 px, key `"50"`).+- **VS Code link (`F08.vscode-link`).** Blocked in a runtime without a running VS Code server: `control-openhands browser count 'testid=drawer-vscode-link'` is `0` (hidden, as designed), and `control-openhands api GET /api/vscode/status` explains why (`enabled: false`, or `running: false` when the agent-server has no editor binary, as in these stacks; see F26 Gotchas). It needs a runtime with `enable_vscode` and a running editor, on an origin that serves `/vscode/`.+- **Archived (`F08.archived-disabled`).** Blocked locally: archived status comes from a Cloud sandbox (`sandbox_status`). On such a conversation, `browser enabled 'testid=right-panel-toggle'` should be `false` and `browser tooltip 'testid=right-panel-toggle'` should read `Unavailable for Archives`.+- **Workspace path (`F08.files-workspace-path`).** Run `control-openhands browser attr 'testid=files-tab-workspace-path-value' title` (ends in `/workspace/qa-repo`). Click `testid=files-tab-workspace-path >> testid=copy-to-clipboard`. Immediately afterwards, `control-openhands browser attr 'testid=files-tab-workspace-path >> testid=copy-to-clipboard' aria-label` is `Copied to clipboard` and `browser enabled` on the same button is `false`. `control-openhands browser clipboard` returns the full path. About 3 s later the label is `Copy to clipboard` again.+- **Tree (`F08.files-tree`).** Run `control-openhands browser click 'testid=files-tab-refresh'` first (see Gotchas: files the agent made with bash are missing until a refresh). Then `control-openhands browser attr 'testid=file-tree-dir-src' aria-expanded` (`false`), `control-openhands browser click 'testid=file-tree-dir-src'` (now `true`) and `control-openhands browser click 'testid=file-tree-file-src/calc.py'`. `control-openhands browser text 'testid=file-content-viewer-highlighted'` shows the 4 lines `def add`…`return a - b`, and `testid=file-quick-row-item-src/calc.py` exists.+- **Tree toggle (`F08.files-tree-toggle`).** Run `control-openhands browser bbox 'testid=files-tab-tree'` (width `224`). Then `control-openhands browser click 'testid=file-quick-row-tree-toggle'`, `control-openhands browser attr 'testid=file-quick-row-tree-toggle' aria-label` (`Show file tree`) and `control-openhands browser count 'testid=files-tab-tree'` (`0`). Reload and reopen the drawer: the count is still `0`. Click the toggle again to restore (count `1`).+- **Tree resize (`F08.files-tree-resize`).** Run `control-openhands browser drag 'testid=files-tab-tree-resize-handle >> .cursor-ew-resize' --by 100,0`; `browser bbox 'testid=files-tab-tree'` is `324` wide and `control-openhands browser eval "localStorage.getItem('files-tab-tree-width')"` is `"324"`. `--by 500,0` clamps at `480`, `--by -600,0` at `160`, and the width survives `browser reload` plus the toggle. Restore with `--by 64,0` (`224`).+- **Rich/Plain (`F08.files-rich-plain`).** Click `testid=file-tree-file-qa-notes.md`; `testid=file-content-viewer-markdown` exists. Click `testid=file-tree-file-qa-page.html`, then run `control-openhands browser attr 'testid=file-content-viewer-iframe' sandbox` (`allow-same-origin`) and `control-openhands browser eval "document.querySelector('[data-testid=file-content-viewer-iframe]').contentDocument.body.innerText"` (`QA page`). Run `control-openhands browser click 'testid=files-tab-content-mode-toggle-option-plain'`; `control-openhands browser text 'testid=files-tab-content >> testid=file-content-viewer-highlighted'` reads `1<h1>QA page</h1>`. After `browser reload` and reopening, `control-openhands browser attr 'testid=files-tab-content-mode-toggle-option-plain' aria-checked` is `true`. Switch back with `testid=files-tab-content-mode-toggle-option-rich`.+- **Open in new window (`F08.files-open-new-window`).** With `qa-page.html` selected, run `control-openhands browser click 'testid=files-tab-open-in-new-window'` and `control-openhands browser tabs`. Page 1's URL is `/api/conversations/<id>/workspace/qa-page.html?v=<n>`. Run `control-openhands browser tab 1`, `control-openhands browser text 'body'` (`QA page`) and `control-openhands browser close-tab 1`.+- **Open-file strip (`F08.files-open-tabs`).** With several files opened, run `control-openhands browser attr 'testid=file-quick-row-item-qa-page.html' title` (the path). Select `qa-notes.md` with `control-openhands browser click 'testid=file-quick-row-item-qa-notes.md'`, then close it with `control-openhands browser click 'testid=file-quick-row-close-qa-notes.md'`. `control-openhands browser eval "[...document.querySelectorAll('[data-testid^=file-quick-row-item-]')].filter(e=>e.getAttribute('aria-selected')==='true').map(e=>e.dataset.testid)"` names the neighbour. Run `browser reload`, reopen the drawer and `control-openhands browser text 'testid=file-quick-row'`: the same files remain. Opening a different conversation (see Commits empty state) shows no quick-row items: `browser text 'testid=file-quick-row'` is empty. `browser testids` omits strip tabs scrolled out of view; count them with `browser eval "[...document.querySelectorAll('[data-testid^=file-quick-row-item-]')].length"`.+- **No selection (`F08.files-no-selection`).** Close every open file with its `file-quick-row-close-<path>` button. `control-openhands browser text 'testid=files-tab-content'` reads `Select a file to view its contents`, and `control-openhands browser count 'testid=files-tab-content-mode-toggle'` is `0`.+- **Second agent turn: commit, binaries, auto-refresh (`F08.files-auto-refresh`, `F08.files-refresh`).** Keep Files open with `qa-notes.md` selected in Rich mode. Write `qa-f08-2.txt` with: ``In the current workspace directory run exactly this one bash command and then reply only "done": printf 'BIN\000\001' > qa-nul.bin && printf 'PK\003\004\000\000' > qa-real.docx && python3 -c "import base64;open('qa-dot.png','wb').write(base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='))" && printf '\n- edited by agent\n' >> qa-notes.md && git add qa-notes.md && git -c user.name=QA-Agent -c [email protected] commit -qm 'QA agent commit' && git log --oneline``. Run `control-openhands conversation start --stay --prompt "$(cat qa-f08-2.txt)" --wait --timeout 240`, then `control-openhands browser testids 'testid=files-tab-tree'` and `control-openhands browser text 'testid=file-content-viewer-markdown'`. Expected: `qa-nul.bin`, `qa-real.docx` and `qa-dot.png` are listed, and the preview ends with `edited by agent`. Known failure (reproduced 2026-10-06): neither changes until Refresh, because the auto-refresh hook skips the file queries for shell commands on purpose (see Gotchas). Repro candidate, not yet filed; a report would ask to revisit that choice. Click `testid=files-tab-refresh` once: the list gains the three files and the open preview ends with `edited by agent`.+- **Fallbacks (`F08.files-fallbacks`).** After a refresh, click `testid=file-tree-file-qa-nul.bin` (`testid=file-content-viewer-binary-fallback`, text `Binary file – preview not available`). Then click `testid=file-tree-file-qa-real.docx` (`testid=file-content-viewer-unsupported-document`, `Preview isn't available for Word files.`). Then click `testid=file-tree-file-qa-dot.png` and run `control-openhands browser eval "document.querySelector('[data-testid=file-content-viewer-image] img').naturalWidth"` (`1`). In Plain mode the PNG shows the binary fallback. `qa-deck.pptx` and `qa-blob.bin` from the first prompt have no NUL byte and render as text (see Gotchas).+- **File-editor edits auto-refresh; deleted file errors (`F08.files-auto-refresh`, `F08.files-load-error`).** Keep Files open with `testid=file-tree-file-qa-blob.bin` selected. Run `control-openhands conversation start --stay --prompt 'Do two steps, then reply only "done". Step 1: run the bash command: rm qa-blob.bin. Step 2: use your file editor tool (not bash) to create the file qa-editor.txt in the current workspace directory with the single line: created by file editor' --wait --timeout 240`. Without clicking Refresh, `control-openhands browser count 'testid=file-tree-file-qa-editor.txt'` is `1` and `browser count 'testid=file-tree-file-qa-blob.bin'` is `0` (the editor observation refetches the whole list). `qa-blob.bin` stays in the open-file strip, and the same observation re-reads the open file: `control-openhands browser text 'testid=file-content-viewer-error'` reads `Failed to read qa-blob.bin: 404` and `control-openhands browser network --filter qa-blob` shows the 404 (`browser screenshot --feature F08.files-load-error --name deleted-open-file`).+- **Open from chat (`F08.files-open-from-chat`).** Run `control-openhands conversation start --stay --prompt 'Without running any tool, reply with exactly this text and nothing else: See `src/calc.py` for the code.' --wait --timeout 180`. Close the drawer, then run `control-openhands browser click 'testid=agent-message >> nth=-1 >> testid=markdown-file-path-link'`. `right-panel-toggle` `aria-pressed` turns `true`, `testid=files-tab` is visible and `file-quick-row-item-src/calc.py` is the selected tab. The same path in the prompt bubble works too: close the drawer and click `'testid=user-message >> testid=markdown-file-path-link'`. Phone: select another file (`control-openhands browser click 'testid=file-quick-row-item-qa-notes.md'`), run `control-openhands browser viewport phone`, then the same agent-message click with `--expect-url '/panel$'`: the URL becomes `/conversations/<id>/panel`, `browser visible 'testid=files-tab'` is `true` and `control-openhands browser attr 'testid=file-quick-row-item-src/calc.py' aria-selected` is `true` (`browser screenshot --feature F08.files-open-from-chat --name phone-after-click`). Return with `control-openhands browser viewport desktop`: the app replaces `/panel` with `/conversations/<id>` (`control-openhands browser wait-url '/conversations/[^/]+$'`) and shows the drawer beside the chat.+- **Tool-card path chip (`F08.files-open-from-tool-chip`).** After the file-editor turn above, close the drawer and expand its tool group and card: `control-openhands browser click 'text=2 actions completed'`, then `control-openhands browser click 'role=region[name="Collapse actions"] >> role=button[name="Expand"] >> nth=-1'` (the `Create qa-editor.txt` card). `control-openhands browser text 'testid=file-path-chip'` is the absolute `<run>/workspace/qa-repo/qa-editor.txt`. Run `control-openhands browser click 'testid=file-path-chip'`: `right-panel-toggle` `aria-pressed` turns `true`, the selected strip tab is `file-quick-row-item-qa-editor.txt` (relative) and `browser text 'testid=files-tab-content'` ends with `created by file editor`.+- **Commits list (`F08.uncommitted-changes`, `F08.commit-rows`).** Click `testid=conversation-tab-commits` and run `control-openhands browser text 'testid=commit-list'`. After the first prompt it reads `-`, `Uncommitted`, `6 files`, then `4bf8272`-style SHA, `Initial fixture commit` and `… ago`; after the second prompt `QA agent commit` appears above it, with author names `QA-Agent` and `QA Fixture` shown because there are now two authors. Run `control-openhands browser click 'testid=uncommitted-changes-row-toggle'` and `control-openhands browser text 'testid=uncommitted-changes-row-content'` (the changed paths; `aria-expanded` is `true`). Run `control-openhands browser click 'testid=commit-row >> has-text=Initial fixture commit >> testid=commit-row-toggle'`; Uncommitted's `aria-expanded` turns `false`, and `control-openhands browser text 'testid=commit-row-content'` lists `README.md`, `src/calc.py`, `src/test_calc.py`. After the third prompt the Uncommitted count is `8 files`.+- **Diff modes (`F08.diff-view-modes`).** In the expanded Uncommitted row, run `control-openhands browser click 'testid=uncommitted-changes-row-content >> testid=file-diff-viewer-outer >> has-text=src/calc.py >> testid=collapse'`. `control-openhands browser text 'testid=uncommitted-changes-row-content >> testid=file-diff-viewer-outer >> has-text=src/calc.py >> testid=editor-container'` shows the added `def sub` lines, and `view-mode-diff` has `aria-pressed` `true`. The row's buttons are named: `control-openhands browser snapshot 'testid=uncommitted-changes-row-content >> testid=file-diff-viewer-outer >> has-text=src/calc.py'` lists `button "Old version"`, `button "Diff" [pressed]`, `button "New version"` and `button "Collapse"` (the same `collapse` button reads `Expand` while the row is collapsed), so `… >> role=button[name="Old version"]` works as well as the test id. Click `… >> testid=view-mode-old` (2 lines), then `… >> testid=view-mode-new` (4 lines), then `view-mode-diff`. Run `control-openhands browser errors --app-only` before and after: each collapse and each diff→old switch adds `TextModel got disposed before DiffEditorWidget model got reset` (fail, #17567).+- **Markdown preview (`F08.diff-markdown-preview`).** In this order `qa-notes.md` is already committed, so check it in the `QA agent commit` row: `control-openhands browser click 'testid=commit-row >> has-text=QA agent commit >> testid=commit-row-toggle'`, then with `F='testid=commit-row >> has-text=QA agent commit >> testid=file-diff-viewer-outer >> has-text=qa-notes.md'` click `"$F >> testid=collapse"` and `"$F >> testid=view-mode-new"`. `control-openhands browser count "$F >> testid=markdown-preview"` is `1`, rendering `<h1>QA notes</h1>`, **world** in bold and the `edited by agent` list item. (Before the second prompt the same check works under `testid=uncommitted-changes-row-content`.) Re-expand Uncommitted with `uncommitted-changes-row-toggle` for the next bullet.+- **Deleted file (`F08.diff-deleted-file`).** Expand `src/test_calc.py` in Uncommitted. `control-openhands browser text 'testid=uncommitted-changes-row-content >> testid=file-diff-viewer-outer >> has-text=src/test_calc.py >> testid=file-deleted-message'` reads `This file was deleted. Its previous contents are no longer available for preview.`+- **From the overview (`F08.changes-from-overview`).** With the drawer closed, run `control-openhands browser click 'testid=conversation-overview-toggle'` and `control-openhands browser click 'testid=conversation-overview-diffs'` (its siblings `conversation-overview-diffs-additions`/`-deletions` show `+N`/`-N`; deleted files are not counted). `right-panel-toggle` `aria-pressed` is `true`, `testid=commit-list` is visible, `uncommitted-changes-row-toggle` has `aria-expanded` `true` and `testid=conversation-overview-panel` is hidden. After `browser reload` and the toggle, Commits is still selected.+- **Empty states (`F08.commits-states`, `F08.files-empty-workspace`).** Run `control-openhands fixture folder`, which makes `<run>/workspace/qa-folder`, a plain folder (no `.git`) with `notes.md`; by the time the conversation has run it holds an empty `.git` (seen live; not created by the prompt), so it ends up a repo with no commits. Run `control-openhands browser goto /` (the browser is on the qa-repo conversation) and pick it with the workspace picker as in Preconditions (`folder-browser-entry-qa-folder`). Then run `control-openhands conversation start --stay --prompt 'Run exactly this bash command, then reply only "done": rm notes.md && git status --short' --wait --timeout 180`. Open the drawer and click `testid=conversation-tab-commits`; `control-openhands browser count 'text="No commits yet"'` is `1` (`browser screenshot --feature F08.commits-states --name no-commits`). On Files, click `testid=files-tab-refresh`; `control-openhands browser text 'testid=files-tab-tree'` reads `No files in workspace`. `Loading changes...` (`testid=commits-tab-status`) shows briefly on the first Commits open after a load: on `/conversations/<id>` with Files selected, `browser reload`, open the drawer, then `control-openhands browser click 'testid=conversation-tab-commits' --observe 'testid=commits-tab-status' --observe-ms 4000` records `Loading changes...` for a few ms. `Waiting for runtime to start...` (agent state init/loading/error) was not reached: `service stop agent-server` and `restart` both left `No commits yet` on screen.+- **Commit cap (`F08.commits-cap`).** Arrange more than 50 commits in the fixture (read-only for the UI): `for i in $(seq 1 50); do git -C "$OH_VERIFY_RUN/workspace/qa-repo" -c user.name=QA-Bulk -c [email protected] commit -q --allow-empty -m "QA bulk $i"; done`. On the qa-repo conversation (`control-openhands browser goto /conversations/<id>`; Empty states left the qa-folder conversation) run `browser reload`, open the drawer on Commits and wait for `testid=commit-list`. `control-openhands browser text 'testid=commit-list-cap-notice'` reads `Showing the latest 50 commits` and `browser count 'testid=commit-row'` is `50`. Do this last: it changes the commit list the other bullets read.+- **Phone panel page (`F08.phone-panel-page`).** Run `control-openhands browser viewport phone` on `/conversations/<id>`, then `control-openhands browser click 'testid=right-panel-toggle' --expect-url '/panel$'`. `control-openhands browser bbox 'testid=files-tab'` gives `insideViewport` `true` and `pageHorizontalOverflow` `false`, with Commits diffs usable at 390 px (`browser screenshot --feature F08.phone-panel-page --name panel`). `control-openhands browser attr 'testid=conversation-mobile-panel-back' aria-label` is `Back`. Run `control-openhands browser click 'testid=conversation-mobile-panel-back' --expect-url '/conversations/[^/]+$'`; the chat is visible. Return with `control-openhands browser viewport desktop`.+- **Direct panel URL (`F08.panel-direct-url`).** At desktop run `control-openhands browser goto /conversations/<id>/panel`. The app replaces the URL with `/conversations/<id>` (the `goto` result already shows it; `control-openhands browser url` confirms), `control-openhands browser count 'testid=conversation-mobile-panel-back'` is `0`, `browser visible 'testid=chat-interface'` is `true` and `right-panel-toggle` `aria-pressed` is `true` (the drawer opens beside the chat; `browser screenshot --feature F08.panel-direct-url --name desktop-redirect`). Then run `control-openhands browser viewport phone` and the same `goto`: the URL keeps `/panel`, the `conversation-mobile-panel-back` count is `1` and `chat-interface` is not visible. `control-openhands browser click 'testid=conversation-mobile-panel-back' --expect-url '/conversations/[^/]+$'` returns to the chat. Return with `control-openhands browser viewport desktop`.+- **Errors.** After each group run `control-openhands browser errors --app-only`. The Monaco disposal error above belongs to this family. 404s on `/api/llm/balance` and `.agents_tmp/` downloads come from the Usage and Planner tabs (F27).++## Gotchas++- When the drawer is closed, its tabs stay mounted at width 0. `browser count 'testid=files-tab'` is `1` even then, so assert with `browser visible` or `right-panel-toggle` `aria-pressed`.+- The tab row is a `tablist "Conversation panels"` of `role=tab` controls, each named after its tab even when inactive (#17612), so `role=tab[name="Commits"]` finds the Commits tab whether or not it is active; `role=button[name="Commits"]` finds nothing. `aria-selected` marks the selected tab. The `conversation-tab-*` test ids still work.+- The tab row ends with the ellipsis menu (`Customize tabs`), then the `VSCode` button (`drawer-vscode-link`, named `Open in VS Code`) when the runtime reports a running editor. #17660 removed that button and #18048 restored it, so on a checkout between the two the drawer has no editor control at all.+- The overflow menu is not a `role=menu`. Escape should close it. Known failure (reproduced 2026-10-06): the `conversation-tabs-menu-*` rows stay and focus stays on the ellipsis; #18044 fixed Escape for other popups (#17933, closed) and left this menu as a follow-up; its repro is in [this #17933 comment](https://github.com/OpenHands/OpenHands/issues/17933#issuecomment-5987090872). Repro candidate, not yet filed. Close it by choosing a row or with `browser mouse-click` outside.+- The Files list and the open preview do not follow bash edits: `use-auto-refresh-files-on-edit.ts` refreshes the file queries only for file-editor observations, and its comment says shell observations skip them on purpose (so that every shell command does not reload canvas iframes). This map still expects files the agent writes to appear (`F08.files-auto-refresh`), so the bash case stays a fail row. Click `files-tab-refresh` once before asserting on files the agent made with the shell. Since #18032 that one click also re-reads the open file (the content fetch revalidates instead of using the browser HTTP cache, and the rich preview gets a new `?v=`), and a page reload shows the current body without a click.+- The chat also fetches the file list (to linkify paths). A conversation page left open while the agent works can therefore show a stale tree the moment the drawer first opens.+- Binary detection is a NUL-byte sniff of the first 8 KB, and the Office message also needs that sniff to trip. A 4-byte `PK\003\004` "pptx" or random bytes without a NUL render as text in the plain viewer. Fixtures must contain a NUL.+- `control-openhands fixture folder` writes a plain folder with `notes.md`, but by the time the conversation has run the folder holds an empty `.git`, so a conversation that leaves `notes.md` in place shows `Uncommitted 1 file` rather than the empty state. Delete it first (as in the recipe).+- Diff views are Monaco. `testid=file-diff-viewer` and `file-single-viewer` are not on the DOM; read text through `testid=editor-container`. The narrow drawer falls back to an inline (not side-by-side) diff. The view-mode buttons are named `Old version`, `Diff` and `New version`, and `collapse` is named `Expand` or `Collapse` after its state (#18033).+- `browser eval "navigator.clipboard.readText()"` hangs for about 2 minutes (no clipboard permission). Use `control-openhands browser clipboard` to read what Copy wrote.+- `browser click ... --observe` accepts the usual selector syntax (`testid=...`).+- Two `.cursor-ew-resize` grips sit in the conversation page (chat/drawer, then the Files tree); scope the tree one with `testid=files-tab-tree-resize-handle`.+- At phone width, chat path links (and the agent's `canvas_ui_control` tab and file requests, through `src/services/canvas-ui.ts`) navigate to `/conversations/<id>/panel` (#18045); at desktop width they open the side drawer and the URL does not change. A `/panel` URL above 1024 px redirects to `/conversations/<id>`, so a bullet that leaves the phone viewport on `/panel` ends on the chat route.+- If the agent's terminal resets mid-command ("terminal session was reset", for example after a `restart`), the agent reruns the command. Check the workspace with `git status` through a second prompt rather than trusting the first observation. Runs no longer share a tmux server (OpenHands/OpenHands#17946).+- Known issue: [#17567](https://github.com/OpenHands/OpenHands/issues/17567) (Monaco disposed-model page error on diff unmount; it also fires on collapse and on a diff→old switch).diff --git a/.agents/skills/verify-openhands/references/feature-map/F09-settings-shell.md b/.agents/skills/verify-openhands/references/feature-map/F09-settings-shell.mdnew file mode 100644index 0000000000..51ed1d22a8--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F09-settings-shell.md@@ -0,0 +1,93 @@+# F09 — Settings shell and navigation++Settings is one shell around eight pages (Agent, LLM, Model Router, Condenser,+Agent Context, Verification, Application, Secrets). On desktop a pinned left+column lists the pages, highlights the current one and ends with an "Agent+Canvas" version card and a "synced from … backend" note; each page gets a title+and a grey subline. Below 1024 px (phones and tablets) `/settings` is a hub list+instead, and at phone width every page shows a Back chevron to the hub. Users reach Settings from the sidebar gear,+the collapsed rail, the command menu and several deep links (LLM banner, getting+started checklist, composer pickers). The individual pages are other families+(F10–F16; Secrets is F14).++Source: `src/routes.ts`, `src/routes/settings.tsx`, `src/routes/settings-index.tsx`, `src/routes/agent-settings.tsx`, `src/constants/settings-nav.tsx`, `src/hooks/use-settings-nav-items.ts`, `src/utils/settings-utils.ts`, `src/components/features/settings/settings-layout.tsx`, `src/components/features/settings/settings-desktop-sidebar.tsx`, `src/components/features/settings/settings-mobile-hub.tsx`, `src/components/features/settings/backend-synced-settings-badge.tsx`, `src/components/features/settings/agent-canvas-update-card.tsx`, `src/components/features/settings/agent-canvas-version-tile.tsx`, `src/utils/mobile-section-nav.ts`, `src/components/features/command-menu/command-menu-items.tsx`.++## Sub-features++- `F09.entry-gear`: the sidebar gear opens Settings on the Agent page; the gear is marked active on every settings URL; at phone width the drawer's gear opens the hub and closes the drawer.+- `F09.entry-collapsed-rail`: with the sidebar collapsed, the rail's Settings icon opens the Agent page.+- `F09.entry-command-menu`: the command menu's Settings group (Settings, Agent settings, LLM profiles, Model Router, Condenser, Agent Context, Verification, Application, Secrets settings) opens the matching page.+- `F09.command-menu-coverage`: every page in the settings nav, including Model Router and Agent Context, can be found in the command menu and opens from it.+- `F09.entry-deep-links`: the Home "Set up LLM" banner, the checklist items "Add LLM API key" and "Customize your agent", the composer LLM picker's "LLM Profiles" link and the + menu's "Manage agent profiles" link each land on `/settings/llm` or `/settings/agents`.+- `F09.index-redirect`: on desktop, `/settings` replaces itself with `/settings/agents` (Back skips `/settings`).+- `F09.locked-cloud-landing`: on a canvas locked to a Cloud host, `/settings` lands on `/settings/app` instead.+- `F09.legacy-agent-redirect`: the retired `/settings/agent` URL replaces itself with `/settings/agents`.+- `F09.hidden-llm-redirect`: with the `hide_llm_settings` feature flag, the LLM link disappears and `/settings/llm` redirects to `/settings/agents`.+- `F09.desktop-nav`: the desktop nav lists the eight pages in order, exactly one link is `aria-current="page"`, and the nav stays pinned while the page content scrolls.+- `F09.page-header`: each page shows its nav title as an H2 with a grey subline; Secrets draws its own header instead, and the Agent profile editor hides the shell header until you leave it.+- `F09.landmarks`: the settings screen exposes a single `main` landmark, on desktop pages and on the phone hub.+- `F09.phone-hub`: below 1024 px (phones and tablets), `/settings` stays put and shows a "Settings" heading, the eight links, the version card and the synced note, with no page header and no horizontal overflow.+- `F09.hub-resize-redirect`: widening the window to ≥1024 px while the phone hub is open replaces `/settings` with `/settings/agents`; narrowing on a sub-page keeps its URL and adds the Back chevron.+- `F09.phone-back`: at phone width each settings page shows a Back chevron (label "Settings") in the top bar that returns to the hub.+- `F09.synced-badge`: the nav footer reads "These settings are synced from Local backend (<origin>)" for the active backend.+- `F09.cloud-links`: on a Cloud backend only, the nav adds "Integrations" and "All Cloud Settings" external links; on a local backend neither exists.+- `F09.update-card`: the "Agent Canvas / Version x.y.z" card opens a dialog; its "Up to date" / "Update" badge appears only once the npm check succeeded.+- `F09.update-modal`: the dialog shows the version, a "Check for updates" button that re-runs the check, and an inline status; a failed check reads "Couldn't check for updates. Try again later."; Close and Escape dismiss it.+- `F09.update-up-to-date`: when the npm check succeeds and the client is current, the card badge reads "Up to date", the dialog status reads "You're running the latest version." with a "What's new" link to the GitHub releases page (new tab), and "Check for updates" briefly shows "Checking for updates…".+- `F09.update-available`: when npm has a newer version, the dialog shows "Version … is available.", a "What's new" link, and npm/Docker command tabs with a copy button.+- `F09.update-modal-phone`: the update dialog fits a 390 px (and a 320 px) viewport with its title and Close button on screen, and Close dismisses it.+- `F09.sidebar-version-tile`: the main sidebar shows an "Agent Canvas" version tile only when an update is available.+- `F09.unknown-subpath`: an unknown `/settings/<x>` URL shows the app's "Page not found" page inside the app shell (sidebar and a Home link), without the settings shell.++## How to get to it (user POV)++- Sidebar footer gear next to the backend selector (`backend-selector-settings-link`), on desktop or inside the phone drawer (`sidebar-mobile-menu-toggle`, then `sidebar-mobile-drawer >> backend-selector-settings-link`).+- Collapsed sidebar: the gear icon at the bottom of the rail (`collapsed-settings-link`).+- Command menu (`Control+k`/`Meta+k` or `command-menu-trigger`): group **Settings** with Settings, Agent settings, LLM profiles, Model Router, Condenser settings, Agent Context, Verification settings, Application settings, Secrets settings.+- Deep links: Home banner **Set up LLM** (`home-llm-not-configured-action`, only while no LLM key is configured); getting-started checklist **Add LLM API key** and **Customize your agent**; composer LLM pill (`chat-input-llm-profile`) → **LLM Profiles**; composer **+** (`chat-plus-button`) → **Switch agent profile** → **Manage agent profiles**. Application settings also links "Manage LLM profiles" (F15's page).+- Direct URLs: `/settings`, `/settings/agents`, `/settings/llm`, `/settings/meta-llm`, `/settings/condenser`, `/settings/agent-context`, `/settings/verification`, `/settings/app`, `/settings/secrets`, and the legacy `/settings/agent`.+- Inside Settings: the left nav (`sidebar-settings-/settings/<page>`) on desktop; the hub list (`settings-mobile-hub`) plus the top-bar Back chevron (`sidebar-mobile-back-button`) on phones.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done), desktop viewport.+- Run the banner and checklist deep links (`F09.entry-deep-links`, first bullet) **before** configuring a model: the banner only exists while no LLM key is set.+- The composer picker deep links need a configured profile: `control-openhands llm preset deepseek` (no model call is made).+- `F09.cloud-links` positive case and `F09.locked-cloud-landing` need a Cloud backend/account (blocked in a local run). `F09.hidden-llm-redirect` is blocked: the frontend hardcodes `hide_llm_settings: false`. The update states depend on the browser reaching `registry.npmjs.org`: with access and a current client you get `F09.update-up-to-date`; `F09.update-available` and the version tile also need an npm `latest` newer than the client (blocked while the client is the latest release); the failure text of `F09.update-modal` needs the registry to be unreachable (no mocks).++- **Gear entry and index redirect (`F09.entry-gear`, `F09.index-redirect`).** From `/`, run `control-openhands browser click 'testid=backend-selector-settings-link'` then `control-openhands browser wait-url '/settings/agents$'`. Then `control-openhands browser attr 'testid=sidebar-settings-/settings/agents' aria-current` is `page` and `control-openhands browser attr 'testid=backend-selector-settings-link' data-active` is `true` (it is `false` again on `/`). Run `control-openhands browser back` then `control-openhands browser url`: the URL is `/`, not `/settings`, which proves the redirect replaced history. Direct entry: `control-openhands browser goto /settings` returns `"url": ".../settings/agents"`.+- **Collapsed rail (`F09.entry-collapsed-rail`).** From `/` (`control-openhands browser goto /`; the previous bullet ends on `/settings/agents`, where the URL wait would pass at once) run `control-openhands browser click 'testid=sidebar-collapse-toggle'`, `control-openhands browser click 'testid=collapsed-settings-link'`, `control-openhands browser wait-url '/settings/agents$'` and `control-openhands browser screenshot --feature F09.entry-collapsed-rail --name rail`. The screenshot shows the icon rail, the settings nav with Agent highlighted. Restore with `control-openhands browser click 'testid=sidebar-collapse-toggle'` (the label flips back to "Collapse sidebar").+- **Command menu (`F09.entry-command-menu`).** First rest the pointer off the list with `control-openhands browser hover 'testid=command-menu-trigger'`: a hover can move the menu's selection, and Enter runs the selected option (F02 Gotchas). For each title run `control-openhands browser goto /`, `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' 'LLM profiles'`, `control-openhands browser press Enter`, `control-openhands browser wait-url '/settings/llm$'`. Expected targets: `Settings` → `/settings/agents`, `Agent settings` → `/settings/agents`, `LLM profiles` → `/settings/llm`, `Model Router` → `/settings/meta-llm`, `Condenser settings` → `/settings/condenser`, `Agent Context` → `/settings/agent-context`, `Verification settings` → `/settings/verification`, `Application settings` → `/settings/app`, `Secrets settings` → `/settings/secrets`. `control-openhands browser snapshot 'testid=command-menu >> role=listbox'` after typing `LLM profiles` shows two options under the "Settings" group text: `LLM profiles` `[selected]` and `Model Router`, whose subline mentions LLM profiles. Enter runs the selected one.+- **Command menu coverage (`F09.command-menu-coverage`).** Run `control-openhands browser goto /`, `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' 'Model Router'` and `control-openhands browser snapshot 'testid=command-menu >> role=listbox'`. It shows one option under the "Settings" group text: `Model Router Meta-profiles that route each task to the right LLM profile. Go` `[selected]`. Run `control-openhands browser press Enter` and `control-openhands browser wait-url '/settings/meta-llm$'`; `control-openhands browser count 'testid=command-menu'` is `0`. Repeat from `/` with `Agent Context`: the option reads `Agent Context Let the agent keep notes and recall them in new conversations. Go` and the URL becomes `/settings/agent-context`. With the previous bullet, every page in the settings nav has opened from the menu.+- **Deep links without a model (`F09.entry-deep-links`).** On `/` with no LLM key (`control-openhands browser goto /`): `control-openhands browser click 'testid=home-llm-not-configured-action'` then `control-openhands browser wait-url '/settings/'` → `/settings/llm`. `control-openhands browser goto /`, `control-openhands browser click 'testid=sidebar-onboarding-checklist-item-configure-llm'`, `control-openhands browser wait-url '/settings/'` → `/settings/llm`. `control-openhands browser goto /`, `control-openhands browser click 'testid=sidebar-onboarding-checklist-item-customize-agent'`, `control-openhands browser wait-url '/settings/'` → `/settings/agents`.+- **Deep links from the composer (`F09.entry-deep-links`).** After `control-openhands llm preset deepseek`, run `control-openhands browser goto /`, `control-openhands browser click 'testid=chat-input-llm-profile'`, `control-openhands browser click 'testid=chat-input-llm-profile-popover >> role=link[name="LLM Profiles"]'`, `control-openhands browser wait-url '/settings/llm$'`; `control-openhands browser count 'testid=chat-input-llm-profile-popover'` is `0`. Then `control-openhands browser goto /`, `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser hover 'testid=switch-agent-profile-button'`, `control-openhands browser click 'testid=agent-profile-submenu >> role=link[name="Manage agent profiles"]'`, `control-openhands browser wait-url '/settings/agents$'`; `control-openhands browser count 'testid=tools-context-menu'` is `0`.+- **Legacy URL (`F09.legacy-agent-redirect`).** Run `control-openhands browser goto /`, then `control-openhands browser goto /settings/agent`; the result already reads `.../settings/agents`. `control-openhands browser back` returns to `/`.+- **Desktop nav (`F09.desktop-nav`).** On any settings page (`control-openhands browser goto /settings/agents`; Legacy URL ends on `/`) run `control-openhands browser snapshot 'testid=settings-navbar-desktop'`: links Agent, LLM, Model Router, Condenser, Agent Context, Verification, Application, Secrets (with `/url`s), then `button "Agent Canvas Version …"` and the synced text. Click each one, e.g. `control-openhands browser click 'testid=sidebar-settings-/settings/meta-llm'`, `control-openhands browser wait-url '/settings/meta-llm$'`, `control-openhands browser attr 'testid=sidebar-settings-/settings/meta-llm' aria-current` (`page`), and `control-openhands browser count 'testid=settings-navbar-desktop >> [aria-current="page"]'` (`1`). Pinned: `control-openhands browser goto /settings/app` (the only page taller than the viewport), `control-openhands browser bbox 'testid=settings-navbar-desktop'` (`y` 32), `control-openhands browser hover 'testid=settings-page-subtitle'`, `control-openhands browser scroll --by 1000`, then `control-openhands browser bbox 'testid=settings-page-subtitle'` (negative `y`, content scrolled) and `control-openhands browser bbox 'testid=settings-navbar-desktop'` (still `y` 32); `control-openhands browser screenshot --feature F09.desktop-nav --name scrolled` shows Git Settings on the right and the full nav on the left.+- **Page header (`F09.page-header`).** After each nav click, `control-openhands browser text 'testid=settings-screen >> header'` reads title + subline: Agent "Create and manage reusable agent setups.", LLM "Model, API key, and options for the agent.", Model Router "Meta-profiles that route each task to the right LLM profile.", Condenser "Summarize long chats to stay within context limits.", Agent Context "Let the agent keep notes and recall them in new conversations.", Verification "Confirmation prompts and security checks on actions.", Application "Language, theme, notifications, and Git identity.". On Secrets, `control-openhands browser count 'testid=settings-screen >> header >> h2'` is `0` (the page draws its own "Secrets" heading). Editor: on `/settings/agents` (`control-openhands browser goto /settings/agents`) run `control-openhands browser click 'testid=add-agent-profile'`; `control-openhands browser count 'testid=settings-page-subtitle'` is `0` and `control-openhands browser text 'testid=settings-screen >> h2'` is `Add agent profile`. `control-openhands browser click 'testid=back-to-agent-profiles'` brings the subtitle back (count `1`); opening the editor again and clicking `testid=sidebar-settings-/settings/condenser` also shows the Condenser subline.+- **Landmarks (`F09.landmarks`).** Run `control-openhands browser goto /settings/agents`, `control-openhands browser count 'role=main'` (`1`) and `control-openhands browser eval "document.querySelector('[data-testid=settings-screen]').tagName"` (`DIV`: the shell wrapper is not a landmark; the layout's own `<main>` is). `control-openhands browser goto /settings/app` and the same `count` is `1`. At phone width (`control-openhands browser viewport phone`, `control-openhands browser goto /settings`) the hub also counts `1`; return with `control-openhands browser viewport desktop`.+- **Phone hub and Back (`F09.phone-hub`, `F09.phone-back`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings` (URL stays `/settings`), `control-openhands browser snapshot 'testid=settings-mobile-hub'` (heading "Settings", the eight links, the version button, the synced text), `control-openhands browser count 'testid=settings-page-subtitle'` (`0`), `control-openhands browser bbox 'testid=settings-mobile-hub'` (`pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F09.phone-hub --name hub`. Then `control-openhands browser click 'testid=settings-mobile-hub >> testid=sidebar-settings-/settings/condenser'`, `control-openhands browser wait-url '/settings/condenser$'`, `control-openhands browser attr 'testid=sidebar-mobile-back-button' aria-label` (`Settings`), `control-openhands browser click 'testid=sidebar-mobile-back-button'`, `control-openhands browser wait-url '/settings$'` and `control-openhands browser visible 'testid=settings-mobile-hub'` (`true`). Drawer entry: `control-openhands browser goto /`, `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'`, `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=backend-selector-settings-link'`, `control-openhands browser wait-url '/settings$'`; `control-openhands browser visible 'testid=sidebar-mobile-drawer'` is `false` (the drawer closed). Return with `control-openhands browser viewport desktop`.+- **Resize from the hub (`F09.hub-resize-redirect`).** Run `control-openhands browser goto /`, `control-openhands browser viewport phone`, `control-openhands browser goto /settings` and `control-openhands browser visible 'testid=settings-mobile-hub'` (`true`). Then `control-openhands browser viewport desktop` and `control-openhands browser wait-url '/settings/agents$'`: the hub is gone (`count 'testid=settings-mobile-hub'` is `0`) and `control-openhands browser back` lands on `/` (the redirect replaced `/settings`). Reverse: `control-openhands browser goto /settings/condenser`, `control-openhands browser viewport phone`, `control-openhands browser url` (still `/settings/condenser`) and `control-openhands browser visible 'testid=sidebar-mobile-back-button'` (`true`). Tablets get the hub too, and the boundary is 1024 px: run `control-openhands browser viewport tablet` (820 px), `control-openhands browser goto /settings` (URL stays `/settings`) and `control-openhands browser visible 'testid=settings-mobile-hub'` (`true`); then `control-openhands browser viewport 1023x900`, `control-openhands browser goto /settings` and the same `visible` (`true`); then `control-openhands browser viewport 1024x900` and `control-openhands browser wait-url '/settings/agents$'` (`browser visible 'testid=settings-navbar-desktop'` is `true`). Return with `control-openhands browser viewport desktop`.+- **Synced badge (`F09.synced-badge`).** Run `control-openhands browser text 'testid=backend-synced-settings-badge'` and `control-openhands browser eval 'location.origin'`. The text is `These settings are synced from Local backend (<origin>)` with the same origin.+- **Cloud links (`F09.cloud-links`).** On a local backend `control-openhands browser count 'testid=settings-integrations-link'` and `control-openhands browser count 'testid=settings-cloud-link'` are both `0`. Positive case (blocked without a Cloud account): with a Cloud backend active both exist; "All Cloud Settings" points at `<cloud host>/settings?org=<org id>` and opens in a new tab unless the canvas is locked to Cloud.+- **Update card and dialog (`F09.update-card`, `F09.update-modal`, `F09.update-up-to-date`).** On a settings page run `control-openhands browser text 'testid=agent-canvas-update-toggle'` (`Agent Canvas`, `Version`, the client version, plus the badge text when present), `control-openhands browser count 'testid=agent-canvas-update-badge'` (`0` while the npm check fails; `1` with "Up to date" or "Update" when it succeeds), then `control-openhands browser click 'testid=agent-canvas-update-toggle'`, `control-openhands browser wait 'testid=agent-canvas-update-modal'` and `control-openhands browser text 'testid=agent-canvas-update-status'`. With registry access and a current client the status is `You're running the latest version. What's new`, and `control-openhands browser attr 'testid=agent-canvas-update-release-notes' href` is `https://github.com/OpenHands/OpenHands/releases` (`target` `_blank`). Without registry access the status is `Couldn't check for updates. Try again later.` Re-check: run `control-openhands browser network --clear`, then `control-openhands browser click 'testid=agent-canvas-update-check-button' --observe 'testid=agent-canvas-update-modal' --observe-ms 2000` (the observed states include `Checking for updates…` before the final status), then `control-openhands browser network`: exactly one new `GET https://registry.npmjs.org/@openhands/agent-canvas/latest` proves the button re-checked (`browser errors` does not list successful requests). `control-openhands browser enabled 'testid=agent-canvas-update-check-button'` is `true` again. Close with `control-openhands browser click 'testid=close-agent-canvas-update-modal'` (modal count `0`); reopen and `control-openhands browser press Escape` also closes it.+- **Update available (`F09.update-available`).** Blocked unless the browser reaches the registry and npm `latest` is newer than the client (a checkout at the latest release shows `F09.update-up-to-date` instead). With both, and a newer npm `latest` than the client, the status shows `Version <x> is available.` with `testid=agent-canvas-update-release-notes` ("What's new"), the npm tab `testid=agent-canvas-update-command-npm` reads `npm install -g @openhands/agent-canvas@latest`, the Docker tab reads `docker pull ghcr.io/openhands/agent-canvas:latest`, and `testid=copy-to-clipboard` turns into a check mark for 2 s.+- **Update dialog at phone width (`F09.update-modal-phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings`, `control-openhands browser click 'testid=settings-mobile-hub >> testid=agent-canvas-update-toggle'`, `control-openhands browser wait 'testid=agent-canvas-update-modal'`, `control-openhands browser bbox 'testid=agent-canvas-update-modal'` and `control-openhands browser bbox 'testid=close-agent-canvas-update-modal'`, then `control-openhands browser screenshot --feature F09.update-modal-phone --name dialog`. Both boxes have `insideViewport` `true` and `pageHorizontalOverflow` `false`: the dialog is 351 px wide at `x` 19.5 and Close is at `x` 329.5; the screenshot shows the whole "Agent Canvas" title and the X. `control-openhands browser click 'testid=close-agent-canvas-update-modal'` closes it (`control-openhands browser count 'testid=agent-canvas-update-modal'` is `0`). Run `control-openhands browser viewport narrow` (320×700) and repeat the `goto`, `click`, `wait` and both `bbox` commands: the dialog is 288 px wide at `x` 16 and Close is at `x` 263, both inside the viewport; `control-openhands browser press Escape` closes it. Then `control-openhands browser viewport desktop`.+- **Sidebar version tile (`F09.sidebar-version-tile`).** On `/` run `control-openhands browser count 'testid=agent-canvas-version-tile'`. It is `0` unless the npm check found a newer version, also when the check succeeded with "Up to date" (positive case blocked without registry access or while the client is the latest release).+- **Unknown sub-page (`F09.unknown-subpath`).** Run `control-openhands browser goto /settings/does-not-exist` and `control-openhands browser snapshot 'testid=not-found-screen'`: `heading "Page not found"`, the paragraph `This address does not match any page. Check the URL, or go back to the home page.` and `link "Home"`. The settings shell is absent (`control-openhands browser count 'testid=settings-screen'` and `control-openhands browser count 'testid=settings-navbar-desktop'` are `0`), while the app sidebar stays (`control-openhands browser count 'aside[data-collapsed]'` is `1`). `control-openhands browser screenshot --feature F09.unknown-subpath --name not-found` shows the message beside the sidebar. Leave with `control-openhands browser click 'testid=not-found-home-link' --expect-url '/$'`.+- **After the family.** Run `control-openhands browser errors --clear` before the family and `control-openhands browser errors --app-only` after it. Expected: `pageErrors` `0` and `appErrors` `0`; the unknown sub-page adds no errors. The Agent profile editor logs `[i18n] Missing translation for key "SCHEMA$TOOL_CONCURRENCY_LIMIT$…"` console warnings, counted under `warnings`, not as errors (the Agent page's family). A registry request failure, when the sandbox blocks npm, is external.++## Gotchas++- `browser click` returns the URL *before* client-side navigation and redirects settle (it prints `/` or `/settings`). Always follow a navigating click with `browser wait-url '<regex>$'` before asserting.+- At phone width there are two `backend-selector-settings-link` elements (hidden desktop sidebar plus the drawer); scope with `testid=sidebar-mobile-drawer >> ...` or the click fails in strict mode. The hub's nav links share testids with the desktop nav, so scope them with `testid=settings-mobile-hub >> ...`.+- The page does not scroll inside the settings `<main>`; the app shell column does. `browser scroll <selector> --by N` only scrolls the element into view and ignores `--by`; hover the content first, then `browser scroll --by N` (mouse wheel at the pointer).+- Only `/settings/app` is taller than a 1000 px viewport in a fresh run; use it for the pinned-nav check.+- Visiting `/settings/agents` ticks the checklist item "Customize your agent" for good (struck through, still a working link, so the bullet order above is fine), and configuring a model hides the Home banner. Run the banner deep link before `llm preset` on a fresh run.+- Registry reachability depends on the sandbox and changes between runs. When the browser cannot reach `registry.npmjs.org` (seen as `ERR_CERT_AUTHORITY_INVALID` through a proxy), the version badge and sidebar tile stay hidden and the dialog shows the failure state; that is environment, not product. When it can, a checkout at the latest release shows "Up to date" and the failure text cannot be produced. Check `browser network` for the registry request before deciding which update rows are `blocked`.+- The update dialog's `role="dialog"` wrapper has no accessible name, so `role=dialog[name=...]` does not match it; use `testid=agent-canvas-update-modal`.+- The `/settings` → `/settings/agents` redirect only happens at ≥1024 px. Below that (phones and tablets) `/settings` is the hub; do not expect a redirect there.+- From 768 to 1023 px the sidebar rail stays and the top bar is gone, so a settings sub-page shows neither the settings nav nor a Back chevron (`browser visible 'testid=sidebar-mobile-back-button'` is `false`); the rail's gear (`backend-selector-settings-link`) returns to the hub.+- The phone hub is indented 32 px while sub-pages start at 16 px (hub padding inside the page padding); that is current layout, not overflow.+- The "LLM Profiles" rename in `useSettingsNavItems` targets a `/settings` nav item that does not exist, so it never applies; the LLM nav item always reads "LLM".diff --git a/.agents/skills/verify-openhands/references/feature-map/F10-llm-profiles.md b/.agents/skills/verify-openhands/references/feature-map/F10-llm-profiles.mdnew file mode 100644index 0000000000..563a3eb47d--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F10-llm-profiles.md@@ -0,0 +1,114 @@+# F10 — LLM profiles++An LLM profile is a named model configuration: provider and model (or a custom+model and base URL), an API key or a ChatGPT subscription, an optional+provider-connection link, and every advanced LLM option. Under Settings → LLM a+user lists profiles (grouped by provider connection once any are linked), adds+and edits them in an embedded form whose Save first runs a one-token validation+call, renames, duplicates, deletes and sets one as **Default**, and bulk-adds+models from a provider. The Default profile is the model new conversations run+on. Provider connections themselves (add, edit, delete) are F11.++Source: `src/routes/llm-settings.tsx`, `src/components/features/settings/llm-profiles/`, `src/components/shared/modals/settings/model-selector.tsx`, `src/components/features/settings/llm-settings/openai-subscription-auth-card.tsx`, `src/components/features/settings/sdk-settings/`, `src/api/profiles-service/profiles-service.api.ts`.++## Sub-features++- `F10.list`: the "Available Profiles" list shows each row's name, model, a `Default` badge on the active profile and a `...` menu, sorted by name; reachable from the sidebar, the direct URL and the command menu.+- `F10.list-empty`: with no profiles the list reads `No profiles saved yet. Add a profile to save your LLM configurations.` and both Add buttons stay available.+- `F10.list-states`: a spinner shows while profiles load; a load failure shows `Failed to load profiles`.+- `F10.list-grouped`: once any profile links to a provider connection, rows group under the connection's name, with unlinked rows last under `Not linked`; with no linked rows the list is flat again.+- `F10.broken-link`: a profile whose linked connection no longer exists shows a warning `Broken link` badge whose tooltip says to edit the profile to re-link it; its editor offers the orphaned id in the Provider connection selector so it can be cleared.+- `F10.actions-menu`: the row menu offers Edit, Rename, Duplicate, Set as default (disabled on the Default row) and Delete; it focuses Edit on open (mouse or Enter), arrows cycle over the enabled items (skipping a disabled Set as default), and Escape, Tab or an outside click close it.+- `F10.set-default`: Set as default toasts `Switched to profile "<name>"`, moves the badge, persists and becomes the agent's active LLM.+- `F10.duplicate`: Duplicate saves `<name>-copy`, then `<name>-copy-1`, with the same model and stored key; the copy is not Default.+- `F10.rename`: the Rename modal is prefilled and focused; invalid names disable Rename; an unchanged name or Cancel just closes; Enter submits; success toasts and persists, and the Default badge follows a renamed default.+- `F10.rename-conflict`: renaming onto an existing name is refused with the server's message (`Profile '<name>' already exists`) and the modal stays open.+- `F10.delete`: Delete asks `Are you sure you want to delete the profile "<name>"? This action cannot be undone.` with Cancel focused; Cancel keeps the row, Delete removes it with a toast.+- `F10.delete-default`: deleting the Default profile promotes another remaining profile to Default.+- `F10.create`: Add LLM Profile → provider, model and API key → Save shows `Validating...` then `Saving...`, toasts `Profile "<name>" created` and returns to the list; the first profile on an empty list becomes Default.+- `F10.create-prefill`: a new editor prefills the backend default model with a blank key, base URL and connection; the other LLM options it shows come from the agent's current LLM settings, i.e. the last applied Default profile (the editor opens on the tab they need), and Save stores what the form shows.+- `F10.api-key-help`: under the API key field (Basic and Advanced), `Don't know your API key? Click here for instructions` opens the OpenHands docs on getting an API key in a new tab.+- `F10.name-autofill`: the Profile Name is auto-filled from the chosen model and follows later model changes until the user types a name; clearing the field resumes it.+- `F10.name-validation`: a name that breaks the rule (letter or digit first; letters, digits, `.`, `_`, `-`; max 64) disables Save and turns the rule text red; a name that already exists also disables Save.+- `F10.create-validation`: a Save whose validation call fails toasts the provider error and keeps the editor open with nothing saved.+- `F10.custom-model`: the Advanced tab takes a free-text model and Base URL; an empty model is refused with `Model is required`.+- `F10.model-picker`: the Basic provider and model comboboxes group options as Verified Models and Other Models; changing provider clears the model; the OpenHands provider shows account and key help.+- `F10.edit`: Edit loads the profile (`Editing profile "<name>" - save to apply changes`) with the stored key masked; Save stays disabled until something changes; a changed name renames before saving; the stored key is kept.+- `F10.edit-default-reapply`: saving the Default profile re-applies it to the agent's LLM settings.+- `F10.editor-discard`: Back and Cancel return to the list without saving and without an unsaved-changes prompt.+- `F10.schema-validation`: bad values in schema fields (Temperature over 2, Top P over 1, invalid JSON) are refused with a toast naming the field.+- `F10.connection-link`: with connections present the editor shows a Provider connection selector; linking hides API key and Base URL, skips validation on Save and regroups the row; None restores the key field.+- `F10.add-models`: "Add from provider connections" (or a connection row's **Bulk add**) creates one linked or keyless profile per checked model; models that already have a profile of that name are hidden.+- `F10.subscription`: Authentication → ChatGPT subscription swaps the model fields for a subscription model list and a device-login card (code, sign-in link, poll, cancel); switching back restores the API-key model.+- `F10.schema-unavailable`: a backend without the settings-schema endpoints shows `SDK settings schema unavailable.` with an upgrade or session-key hint.+- `F10.cloud-readonly`: Cloud org members without edit rights see the list read-only (no Add buttons, no row menus, no Provider connections section).+- `F10.phone`: list, row menu and editor fit a 390 px viewport without horizontal overflow.+- `F10.default-used`: a conversation started after creating a profile in the UI runs on the Default profile's model.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`, opens `/settings/agents`), then **LLM** in the settings navigation (`sidebar-settings-/settings/llm`).+- Direct URL `/settings/llm`.+- Command menu (`Control+k` or `Meta+k`, or `command-menu-trigger` in the sidebar): search "LLM", choose **LLM profiles** ("Manage models, providers, and API keys.").+- On the list: **Add LLM Profile** (`add-llm-profile`), **Add from provider connections** (`add-models-from-provider`), each row's `...` (`profile-menu-trigger`), and a provider connection row's `...` → **Bulk add** (`provider-connection-add-models`).+- The create/edit editor has no URL of its own: it replaces the list in place at `/settings/llm`; **Back** (`back-to-profiles`) and **Cancel** (`cancel-profile-btn`) return to the list.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done). Do not run `llm preset deepseek` first: a fresh run has no profiles, which the empty state and "first profile becomes Default" need.+- A DeepSeek key for real saves, either in the environment as `DEEPSEEK_API_KEY` or in a file. Pass it only with `browser fill ... --value-env DEEPSEEK_API_KEY` or `--value-file <key file>`; never on the command line.+- No profile or connection named `QA_*`, `deepseek-chat` or `deepseek-v3` exists (`control-openhands api GET /api/profiles`, `control-openhands api GET /api/llm/provider-connections`).+- Select a row by exact name with the CSS form `'[data-testid=profile-row]:has([title="<name>"])'`; `has-text=QA_pro` also matches `QA_pro-copy`.+- Read toasts with `control-openhands browser wait-text '<text>'` (or `browser toasts`) right after the click; they disappear after a few seconds.+- Blocked here: completing `F10.subscription` sign-in (needs a ChatGPT Plus/Pro account), `F10.cloud-readonly` (needs a Cloud org member account), `F10.schema-unavailable` (needs an agent server without the schema endpoints, for example an older `launch --sdk-ref`), and the `F10.list-states` error (needs `/api/profiles` to fail while the rest of the agent server answers).++- **Empty list (`F10.list-empty`).** On a fresh run, navigate from the sidebar: `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings'`, `control-openhands browser click 'testid=sidebar-settings-/settings/llm' --expect-url '/settings/llm'`, then `control-openhands browser text 'testid=profiles-empty'`. The text is `No profiles saved yet. Add a profile to save your LLM configurations.` and `control-openhands browser testids main` lists `add-llm-profile`, `add-models-from-provider` and `profiles-empty`.+- **Open the editor (`F10.create`).** Run `control-openhands browser click 'testid=add-llm-profile'`. `control-openhands browser text 'testid=profile-editor-title'` is `Add LLM Profile`, `control-openhands browser text 'testid=profile-editor-description'` is `Configure your LLM settings below, then click Save to create this profile.`, and the form opens on the Basic tab with provider `OpenAI` and model `gpt-5.6-sol` (`browser value 'testid=llm-provider-input'`, `browser value 'testid=llm-model-input'`).+- **API key help link (`F10.api-key-help`).** In that editor run `control-openhands browser click 'testid=sdk-section-basic-toggle'` (a new editor opens on All once the agent's LLM settings carry a non-default option; see `F10.create-prefill`), then `control-openhands browser text 'testid=llm-api-key-help-anchor'` is `Don't know your API key? Click here for instructions`; its link has `target` `_blank` (`browser eval "document.querySelector('[data-testid=llm-api-key-help-anchor] a, a[data-testid=llm-api-key-help-anchor]').target"`). Run `control-openhands browser click 'testid=llm-api-key-help-anchor >> role=link'`, then `control-openhands browser tabs` (rerun once if it still lists one page): page 1 is `https://docs.openhands.dev/.../local-setup#getting-an-api-key`. Return with `control-openhands browser close-tab 1` and `control-openhands browser tab 0`. The Advanced tab shows the same link as `testid=llm-api-key-help-anchor-advanced`.+- **Provider and model lists (`F10.model-picker`).** Run `control-openhands browser click 'testid=llm-provider-input'` and `control-openhands browser snapshot 'role=listbox'`: groups `Verified Models` (OpenHands, Anthropic, OpenAI, Mistral AI, Gemini, deepseek, Moonshot, minimax, glm, nvidia, qwen) and `Other Models`. Pick DeepSeek with `control-openhands browser fill 'testid=llm-provider-input' deepseek` and `control-openhands browser click 'testid=provider-item-deepseek'`; `browser value 'testid=llm-model-input'` is now empty. `control-openhands browser click 'testid=llm-model-input'` and `browser snapshot 'role=listbox'` list `deepseek-chat`, `deepseek-v4-pro`, … as Verified and `deepseek-coder`, `deepseek-flash`, … under Other. For the OpenHands provider (`browser fill 'testid=llm-provider-input' openhands`, `browser click 'testid=provider-item-openhands'`), `control-openhands browser text 'testid=openhands-account-help'` is `Need an OpenHands Account? Click here`; after `control-openhands browser click 'role=option[name="claude-sonnet-5"][exact]'` in the model list, `control-openhands browser text 'testid=openhands-api-key-help'` starts `You can find your OpenHands Provider LLM Key in the OpenHands LLM Key section of OpenHands Cloud`. Screenshot: `browser screenshot --feature F10.model-picker --name openhands-provider`.+- **Create the first profile (`F10.create`, `F10.name-autofill`).** In a fresh editor pick deepseek as above, then `control-openhands browser click 'testid=llm-model-input'` and `control-openhands browser click 'testid=model-item-deepseek-flash'`. `control-openhands browser value 'testid=profile-name-input'` now follows the model: `deepseek-flash` (right after the provider pick, while the model is still empty, it still reads `gpt-5.6-sol`). Run `control-openhands browser fill 'testid=profile-name-input' QA_flash`, `control-openhands browser fill 'testid=llm-api-key-input' --value-file <key file>` (or `--value-env DEEPSEEK_API_KEY`), `control-openhands browser click 'testid=save-profile-btn' --observe 'testid=save-profile-btn' --observe-ms 4000` and `control-openhands browser wait-text 'Profile "QA_flash" created' --timeout 60000`. The observed button states are `Save`, `Validating...`, `Saving...`, then the editor closes. After `control-openhands browser reload`, `control-openhands browser text '[data-testid=profile-row]:has([title="QA_flash"])'` reads `QA_flash`, `deepseek/deepseek-flash`, `Default`, and `control-openhands api GET /api/profiles` has `active_profile` `QA_flash`.+- **A typed name sticks; a cleared one follows again (`F10.name-autofill`).** In a fresh editor (`control-openhands browser click 'testid=add-llm-profile'`) run `control-openhands browser fill 'testid=profile-name-input' QA_typed`, then pick deepseek as above, `control-openhands browser click 'testid=llm-model-input'` and `control-openhands browser click 'role=option[name="deepseek-v4-pro"][exact]'`; `browser value 'testid=profile-name-input'` stays `QA_typed`. Run `control-openhands browser fill 'testid=profile-name-input' ''`, then `browser click 'testid=llm-model-input'` and `browser click 'testid=model-item-deepseek-flash'`: the name is `deepseek-flash`; pick `role=option[name="deepseek-v4-pro"][exact]` again and it is `deepseek-v4-pro`.+- **Name rules (`F10.name-validation`).** In the editor run `control-openhands browser fill 'testid=profile-name-input' 'QA bad'`; `control-openhands browser enabled 'testid=save-profile-btn'` is `false` and `control-openhands browser attr 'testid=profile-name-input' aria-invalid` is `true` (the same for `-QA` and a 65-character name), and the rule text under the field turns red. An existing name (`QA_flash`) also gives `enabled` `false`, but `aria-invalid` stays `false` and nothing says why (see Gotchas). `QA_flash2` gives `true`.+- **Validation failure (`F10.create-validation`).** In a fresh editor choose deepseek / `model-item-deepseek-flash`, fill `profile-name-input` with `QA_nokey`, leave the API key empty and run `control-openhands browser click 'testid=save-profile-btn' --observe 'testid=save-profile-btn' --observe-ms 3000` (states `Save`, `Validating...`, `Save`). `control-openhands browser wait-text 'Authentication Fails'` finds the toast `litellm.AuthenticationError: AuthenticationError: DeepseekException - Authentication Fails (...)`; `browser text 'testid=profile-editor-title'` is still `Add LLM Profile` and `control-openhands api GET /api/profiles` has no `QA_nokey`.+- **Custom model (`F10.custom-model`).** In that editor run `control-openhands browser click 'testid=sdk-section-advanced-toggle'`. `browser value 'testid=llm-custom-model-input'` carries the Basic choice (`deepseek/deepseek-flash`; placeholder `openai/gpt-5.6-sol`), and `browser attr 'testid=base-url-input' placeholder` is `https://api.openai.com`. Run `control-openhands browser fill 'testid=llm-custom-model-input' ''`, `control-openhands browser fill 'testid=profile-name-input' QA_adv`, `control-openhands browser click 'testid=save-profile-btn'` and `control-openhands browser wait-text 'Model is required'`. Then `control-openhands browser fill 'testid=llm-custom-model-input' deepseek/deepseek-flash`, `control-openhands browser fill 'testid=base-url-input' https://api.deepseek.com`, fill the key as in Create, Save, and `control-openhands browser wait-text 'Profile "QA_adv" created' --timeout 60000`. `api GET /api/profiles` shows `QA_adv` with `base_url` `https://api.deepseek.com`.+- **Second profile from a verified model.** Repeat Create choosing `control-openhands browser click 'role=option[name="deepseek-v4-pro"][exact]'` (verified models have no `model-item-*` test ID) and the name `QA_pro`. The toast reads `Profile "QA_pro" created`; the row `QA_pro deepseek/deepseek-v4-pro` has no badge.+- **Row menu (`F10.actions-menu`).** Run `control-openhands browser click '[data-testid=profile-row]:has([title="QA_flash"]) >> testid=profile-menu-trigger'` and `control-openhands browser snapshot 'testid=profile-actions-menu'`: menuitems Edit, Rename, Duplicate, `Set as default [disabled]`, Delete on the Default row (all enabled on other rows). `control-openhands browser eval "document.activeElement.dataset.testid"` is `profile-edit`: focus moves into the menu on open. Run `control-openhands browser press ArrowDown` and that eval four times: `profile-rename`, `profile-duplicate`, `profile-delete` (the disabled Set as default is skipped), `profile-edit` (wraps); `control-openhands browser press ArrowUp` twice gives `profile-delete`, `profile-duplicate`. `control-openhands browser press Tab` closes the menu (`browser count 'testid=profile-actions-menu'` is `0`) and moves focus on to the next row's trigger: the row-aware eval `control-openhands browser eval "(()=>{const a=document.activeElement;const r=a.closest('[data-testid=profile-row]');return a.dataset.testid+'@'+(r?r.querySelector('[title]').title:'-')})()"` is `profile-menu-trigger@QA_pro`. Reopen the `QA_flash` menu and `control-openhands browser press Escape`: count `0`, and the row-aware eval is `profile-menu-trigger@QA_flash` (focus is back on its own trigger). Reopen it and `control-openhands browser click 'role=heading[name="Available Profiles"]'` closes it too. Keyboard open: `control-openhands browser focus '[data-testid=profile-row]:has([title="QA_pro"]) >> testid=profile-menu-trigger'` and `control-openhands browser press Enter` put focus on `profile-edit`; on this non-default row `control-openhands browser snapshot 'testid=profile-actions-menu'` lists the same five menuitems with none `[disabled]`, and `control-openhands browser screenshot --feature F10.actions-menu --name menu-nondefault` shows them with the focus ring on Edit. Five `ArrowDown`s walk `profile-rename`, `profile-duplicate`, `profile-set-active`, `profile-delete`, `profile-edit`. `control-openhands browser press Escape` closes it, and the row-aware eval is `profile-menu-trigger@QA_pro`.+- **Set as default (`F10.set-default`).** Run `control-openhands browser click '[data-testid=profile-row]:has([title="QA_pro"]) >> testid=profile-menu-trigger'`, `control-openhands browser click 'testid=profile-actions-menu >> testid=profile-set-active'` and `control-openhands browser wait-text 'Switched to profile "QA_pro"'`. After `control-openhands browser reload`, `control-openhands browser count 'testid=profile-active-badge'` is `1` and `control-openhands browser count '[data-testid=profile-row]:has([title="QA_pro"]) >> testid=profile-active-badge'` is `1`; `control-openhands api GET /api/profiles` has `active_profile` `QA_pro` and `control-openhands llm show` reports `active.model` `deepseek/deepseek-v4-pro`.+- **Duplicate (`F10.duplicate`).** From the `QA_pro` row menu click `testid=profile-actions-menu >> testid=profile-duplicate` and `control-openhands browser wait-text 'Profile duplicated as "QA_pro-copy"'`; repeat on `QA_pro` for `Profile duplicated as "QA_pro-copy-1"`, and on `QA_pro-copy` for `Profile duplicated as "QA_pro-copy-copy"`. After a reload `control-openhands browser text 'testid=profile-row >> has-text=QA_pro-copy-1'` reads `QA_pro-copy-1 deepseek/deepseek-v4-pro`, the badge stays on `QA_pro`, and `api GET /api/profiles` has `api_key_set: true` on every copy.+- **Rename (`F10.rename`).** Open the `QA_pro-copy-copy` row menu and click `testid=profile-actions-menu >> testid=profile-rename`. `control-openhands browser value 'testid=rename-profile-input'` is `QA_pro-copy-copy` and `browser eval "document.activeElement.dataset.testid"` is `rename-profile-input`. `control-openhands browser fill 'testid=rename-profile-input' '-bad'` makes `control-openhands browser enabled 'role=dialog[name="Rename Profile"] >> role=button[name="Rename"]'` `false` and `control-openhands browser attr 'testid=rename-profile-rule' class` contains `text-red-400`. Filling the old name and clicking Rename closes the modal with no toast (`browser count 'testid=rename-profile-modal'` is `0`); `control-openhands browser click 'role=dialog[name="Rename Profile"] >> role=button[name="Cancel"]'` also closes it. To rename, reopen, fill `QA_renamed`, `control-openhands browser press Enter`, `control-openhands browser wait-text 'Profile renamed to "QA_renamed"'`, reload, and the count of `'[data-testid=profile-row]:has([title="QA_renamed"])'` is `1` while the old name's is `0`. Renaming the Default row (`QA_pro` → `QA_pro2`, submit with `testid=rename-profile-submit`) keeps its badge (`browser text '[data-testid=profile-row]:has([data-testid=profile-active-badge])'` reads `QA_pro2 … Default`) and `active_profile` follows.+- **Rename onto an existing name (`F10.rename-conflict`).** The Rename step above already renamed `QA_pro-copy-copy` and `QA_pro`, so use the remaining fixtures: open the `QA_pro-copy` row menu, click `testid=profile-actions-menu >> testid=profile-rename`, fill `testid=rename-profile-input` with `QA_pro2` and click `testid=rename-profile-submit`. The modal stays open (`count 'testid=rename-profile-modal'` is `1`), `control-openhands browser toasts` has the server's message `Profile 'QA_pro2' already exists` (no `HTTP request failed` prefix, no JSON), and `browser screenshot --feature F10.rename-conflict --name toast` shows that toast above the open modal. Close it with `control-openhands browser click 'role=dialog[name="Rename Profile"] >> role=button[name="Cancel"]'`.+- **Edit (`F10.edit`).** Open the `QA_renamed` row menu and click `testid=profile-actions-menu >> testid=profile-edit`. `browser text 'testid=profile-editor-title'` is `Edit LLM Profile`, `browser text 'testid=profile-editor-description'` is `Editing profile "QA_renamed" - save to apply changes`, `browser attr 'testid=llm-api-key-input' placeholder` is `<hidden>`, `browser count 'testid=set-indicator'` is `1` and `browser enabled 'testid=save-profile-btn'` is `false` (screenshot `--feature F10.edit --name loaded`). Run `control-openhands browser click 'testid=llm-model-input'`, `control-openhands browser click 'testid=model-item-deepseek-flash'` (Save turns `true`), `control-openhands browser fill 'testid=profile-name-input' QA_edited`, Save, and `control-openhands browser wait-text 'Profile "QA_edited" updated' --timeout 60000`. After a reload `browser text '[data-testid=profile-row]:has([title="QA_edited"])'` reads `QA_edited deepseek/deepseek-flash` and `QA_renamed` is gone. The save passed validation without retyping the key, which proves the stored key was kept.+- **Leave without saving (`F10.editor-discard`).** Edit `QA_adv`, `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser fill 'testid=sdk-settings-llm.top_p' 0.5` (Save turns enabled), then `control-openhands browser click 'testid=back-to-profiles'`. The list returns at once (`browser count 'testid=add-llm-profile'` is `1`) with no prompt (`control-openhands browser events --kinds dialog` is empty), and reopening Edit → All shows `top_p` empty. `testid=cancel-profile-btn` behaves the same.+- **Schema field validation and re-apply (`F10.schema-validation`, `F10.edit-default-reapply`).** Edit the Default profile and run `control-openhands browser click 'testid=sdk-section-all-toggle'`. `control-openhands browser fill 'testid=sdk-settings-llm.temperature' 5`, Save, then `control-openhands browser wait-text 'must be at most 2'` (toast `Temperature must be at most 2`). Clear it, fill `testid=sdk-settings-llm.top_p` with `3`: `Top P must be at most 1`. Clear it, fill `testid=sdk-settings-llm.extra_headers` with `{bad`: `Invalid JSON for Extra Headers`. Clear that, fill temperature `0.3`, Save, and `wait-text 'Profile "<name>" updated'`. `control-openhands api GET /api/settings` then has `agent_settings.llm.temperature` `0.3`, and reopening Edit → All shows `0.3`.+- **New profile prefill (`F10.create-prefill`).** With that Default (temperature `0.3`) run `control-openhands browser click 'testid=add-llm-profile'`. The editor opens on All (`browser eval "[...document.querySelectorAll('[role=tab]')].map(t=>t.innerText+':'+t.getAttribute('aria-selected')).join(',')"` is `Basic:false,Advanced:false,All:true`), `browser value 'testid=llm-custom-model-input'` is the backend default `openai/gpt-5.6-sol`, and `browser value 'testid=sdk-settings-llm.temperature'` is `0.3`, inherited from the Default. Run `control-openhands browser fill 'testid=llm-custom-model-input' deepseek/deepseek-flash`, `browser fill 'testid=profile-name-input' QA_inherit`, fill the key as in Create, Save and `wait-text 'Profile "QA_inherit" created' --timeout 60000`. Expected: the saved profile has the temperature the form showed. Actual today: `control-openhands api GET /api/profiles/QA_inherit` has `config.temperature` `null`, and after `browser reload` Edit `QA_inherit` → All shows the temperature empty (`fail`; the create path saves dirty fields only, so the shown inherited values are dropped). Screenshot `--feature F10.create-prefill --name edit-after-create`.+- **Link to a provider connection (`F10.connection-link`, `F10.list-grouped`).** Arrange a connection through the F11 form: `control-openhands browser click 'testid=add-provider-connection'`, `control-openhands browser fill 'testid=provider-connection-name-input' QA_ds_conn`, `control-openhands browser click 'testid=provider-connection-provider-input'`, `control-openhands browser fill 'testid=provider-connection-provider-input' deepseek`, `control-openhands browser click 'testid=provider-item-deepseek'`, `control-openhands browser fill 'testid=provider-connection-api-key-input' --value-file <key file>`, `control-openhands browser click 'testid=provider-connection-submit'` and `control-openhands browser wait-text 'Connection "QA_ds_conn" created'`. Edit `QA_adv`, click `testid=sdk-section-basic-toggle`, run `control-openhands browser click 'testid=llm-provider-connection-input'` (options `None`, `QA_ds_conn`) and `control-openhands browser click 'role=option[name="QA_ds_conn"]'`; `browser count 'testid=llm-api-key-input'` is `0`, and on the Advanced tab `browser count 'testid=base-url-input'` is `0`. Picking `role=option[name="None"]` brings the key field back (`1`). Re-select `QA_ds_conn`, then `control-openhands browser click 'testid=save-profile-btn' --observe 'testid=save-profile-btn' --observe-ms 3000`: states `Save`, `Saving...` (no `Validating...`), and `wait-text 'Profile "QA_adv" updated'`. After a reload `control-openhands browser eval "[...document.querySelectorAll('[data-testid=profile-group-header]')].map(e=>e.innerText).join(' | ')"` is `QA_DS_CONN | NOT LINKED` (CSS upper-case) and `control-openhands browser count 'div:has(> [data-testid=profile-group-header]:text-is("QA_ds_conn")) [data-testid=profile-row]:has([title="QA_adv"])'` is `1` (screenshot `--feature F10.list-grouped --name grouped`).+- **Add models from a provider (`F10.add-models`).** Run `control-openhands browser click 'testid=add-models-from-provider'`; `browser enabled 'testid=add-models-submit'` is `false`. Keyless: `control-openhands browser select 'testid=add-models-provider' moonshot` and `control-openhands browser wait 'testid=add-models-select-all'`; `browser text 'testid=add-models-keyless-note'` is `No connection — profiles will need a key added later`, rows start unchecked (`Add 0 profiles`), and `control-openhands browser check 'testid=add-models-select-all'` makes `browser text 'testid=add-models-submit'` read `Add 12 profiles`; uncheck it again. Linked: `control-openhands browser select 'testid=add-models-provider' deepseek`; the connection field (`testid=add-models-connection-field`, options `No connection (keyless)` and `QA_ds_conn`) is pre-bound to `QA_ds_conn`. Run `control-openhands browser check 'testid=add-models-check-deepseek/deepseek-chat'`, `control-openhands browser check 'testid=add-models-check-deepseek/deepseek-v3'`, `control-openhands browser click 'testid=add-models-submit'` and `control-openhands browser wait-text 'Added 2'` (toast `Added 2 profiles`). The modal closes; after a reload `deepseek-chat` and `deepseek-v3` sit under the `QA_DS_CONN` header and `api GET /api/profiles` shows both with a `provider_connection_id`. Preselect entry: `control-openhands browser click 'testid=provider-connection-row >> has-text=QA_ds_conn >> testid=provider-connection-menu-trigger'` (menu: Bulk add, Edit, Delete), `control-openhands browser click 'testid=provider-connection-actions-menu >> testid=provider-connection-add-models'`; provider `deepseek` and the connection are preset, every remaining row is checked (`Add 10 profiles`), and `browser count 'testid=add-models-row-deepseek/deepseek-chat'` is `0` (already added). Close with `control-openhands browser click 'role=dialog[name="Add models as profiles"] >> role=button[name="Cancel"]'`.+- **Broken link (`F10.broken-link`).** The local server refuses to delete a referenced connection (row menu → `testid=provider-connection-delete` → `testid=delete-provider-connection-confirm` toasts `Provider connection cannot be deleted while it is referenced by LLM profile(s): ...`), so arrange the state directly: `control-openhands api POST /api/profiles/QA_broken --write --data '{"llm":{"model":"deepseek/deepseek-chat","provider_connection_id":"00000000000000000000000000000000"},"include_secrets":false}'`. Then `control-openhands browser reload` and `control-openhands browser text '[data-testid=profile-row]:has([title="QA_broken"])'` reads `QA_broken deepseek/deepseek-chat Broken link`; `control-openhands browser attr '[data-testid=profile-row]:has([title="QA_broken"]) >> testid=profile-broken-connection-badge' title` is `The linked provider connection was deleted. Edit this profile to re-link it.` (screenshot `--feature F10.broken-link --name badge`). Edit it: `browser value 'testid=llm-provider-connection-input'` is the orphaned id and the listbox offers `None`, `QA_ds_conn` and that id. The row's group header shows the raw id, not a name (see Gotchas).+- **ChatGPT subscription, pre-auth (`F10.subscription`).** In a fresh editor run `control-openhands browser click 'testid=sdk-section-basic-toggle'` first (after the schema step the Default profile has a temperature, so a new editor opens on All; see `F10.create-prefill`), then `control-openhands browser click 'testid=llm-auth-type-input'` (options `API key`, `ChatGPT subscription`) and `control-openhands browser click 'role=option[name="ChatGPT subscription"]'`. `browser text 'testid=subscription-status'` is `ChatGPT subscription not connected`, `browser value 'testid=llm-subscription-model-input'` is `gpt-5.5` (list: gpt-5.5, gpt-5.6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-6-astra), and `llm-provider-input` and `llm-api-key-input` are gone (count `0`). `control-openhands browser click 'testid=subscription-connect'` and `control-openhands browser wait 'testid=subscription-user-code'`: the card shows the code, `Open sign-in page`, `I've finished signing in` (`subscription-poll`) and Cancel, and `control-openhands browser tabs` lists a second page on `auth.openai.com` (it opens a second or two after the code appears; rerun `browser tabs` if it lists one page). The card polls on its own, so `Sign-in is not complete yet. ...` can already show before you click poll. Close it with `control-openhands browser close-tab 1` and `control-openhands browser tab 0`. `control-openhands browser click 'testid=subscription-poll'` leaves `Sign-in is not complete yet. Finish the browser flow and try again.` on the card, and `control-openhands browser click 'testid=subscription-cancel'` removes the code (`count 'testid=subscription-user-code'` `0`). Switching back with `role=option[name="API key"]` restores provider `OpenAI` and model `gpt-5.6-sol`. Completing sign-in is blocked (needs a ChatGPT Plus/Pro account).+- **Delete (`F10.delete`, `F10.delete-default`).** Run `control-openhands browser click '[data-testid=profile-row]:has([title="QA_pro-copy"]) >> testid=profile-menu-trigger'` and `control-openhands browser click 'testid=profile-actions-menu >> testid=profile-delete'`. `control-openhands browser snapshot 'role=dialog'` shows `Delete Profile` with `Are you sure you want to delete the profile "QA_pro-copy"? This action cannot be undone.`, and `browser eval "document.activeElement.innerText"` is `Cancel`. `control-openhands browser click 'role=dialog[name="Delete Profile"] >> role=button[name="Cancel"]'` keeps the row (count `1`). Repeat, then `control-openhands browser click 'testid=delete-profile-confirm'`, `control-openhands browser wait-text 'Profile "QA_pro-copy" deleted'`, reload, and the count is `0`. Deleting the Default row the same way leaves exactly one `profile-active-badge` on another profile (`browser text '[data-testid=profile-row]:has([data-testid=profile-active-badge])'`), and `api GET /api/profiles` names it in `active_profile`.+- **Command menu and direct URL (`F10.list`).** Run `control-openhands browser goto /` (the bullets above end on `/settings/llm`, where the URL wait would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' LLM` and `control-openhands browser snapshot 'testid=command-menu'`: two options, `LLM profiles` ("Manage models, providers, and API keys.") and `Model Router` (F12; its keywords include "llm"). Hovering an option selects it, so which one Enter runs depends on where the mouse rests: click the option instead, `control-openhands browser click 'testid=command-menu >> role=option[name="LLM profiles"]' --expect-url '/settings/llm(\?|$)'`. `browser count 'testid=add-llm-profile'` is `1` on arrival. `control-openhands browser goto /settings/llm` shows the same list (`browser count 'testid=profile-row'`, one `profile-active-badge`; screenshot `--feature F10.list --name list`).+- **Phone layout (`F10.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/llm`, `control-openhands browser bbox 'testid=add-llm-profile'`, `control-openhands browser bbox 'testid=profile-row >> nth=0'` and `control-openhands browser screenshot --feature F10.phone --name list`: `insideViewport` `true`, `pageHorizontalOverflow` `false`. Open a row menu: `browser bbox 'testid=profile-actions-menu'` is inside the viewport. Open Edit: `browser bbox 'testid=profile-name-input'` is 348 px wide inside the 390 px viewport and `pageHorizontalOverflow` is `false` (`llm-settings-screen` may report `insideViewport` `false` when the edited profile's form is taller than the screen; only the overflow flag matters). Return with `control-openhands browser click 'testid=cancel-profile-btn'` and `control-openhands browser viewport desktop`.+- **Default profile drives a conversation (`F10.default-used`).** Make a profile with a distinct model Default through the row menu (for example `QA_pro-copy-1`, `deepseek/deepseek-v4-pro`, then `wait-text 'Switched to profile "QA_pro-copy-1"'`), and run `control-openhands conversation start --prompt "Reply with exactly the word: pong" --wait --timeout 180`. The JSON has `"status": "finished"` and `"model": "deepseek/deepseek-v4-pro"`. The browser is now on the conversation page: `control-openhands browser goto /settings/llm` before driving this family again.+- **Persistence across a restart (`F10.list`).** `control-openhands restart`, `control-openhands doctor`, `control-openhands browser goto /settings/llm`: the same rows and the same Default badge are back.+- **Load error (`F10.list-states`, blocked).** `control-openhands service stop agent-server` and `control-openhands browser reload` do not reach `testid=profiles-load-error`: the whole app is replaced by the disconnected-backend screen (`testid=agent-server-onboarding-screen`, toasts `HTTP request failed (502 Bad Gateway) ...`). The list error needs `/api/profiles` alone to fail. Bring the stack back with `control-openhands restart`.+- **Cleanup.** Run `control-openhands browser goto /settings/llm` (the Load error bullet left the disconnected-backend screen), then delete every `QA_*`, `deepseek-chat` and `deepseek-v3` profile through the row menu, linked ones first; `control-openhands browser count 'testid=profile-group-header'` drops to `0` once no linked row is left (`F10.list-grouped`). Then delete `QA_ds_conn` (`testid=provider-connection-row >> has-text=QA_ds_conn >> testid=provider-connection-menu-trigger`, `testid=provider-connection-actions-menu >> testid=provider-connection-delete`, `testid=delete-provider-connection-confirm`; toast `Connection "QA_ds_conn" deleted`). With no profiles left, `testid=profiles-empty` returns and `api GET /api/profiles` is `{"profiles":[],"active_profile":null}`.++## Gotchas++- Save always runs a real completion against the provider (except for connection-linked profiles). A bad or missing key fails fast with the provider's message; budget one tiny call per Save.+- The editor's starting tab is inferred from the values it loads. Edit opens on whichever tab the profile's non-default values need (`QA_renamed` and `QA_adv` opened on Basic, `QA_broken` on All). A new editor opens on Basic only while the agent's LLM settings are all defaults: once the Default profile has a temperature (the schema step) it opens on All, and this survives deleting every profile, because the agent settings keep the last applied values. Click the tab you need before touching its fields, or `llm-provider-input` / `llm-custom-model-input` / `llm-api-key-help-anchor` will not exist.+- `control-openhands service stop agent-server` cannot show this page's error states: the whole app switches to the disconnected-backend screen.+- In Edit, `llm-api-key-input` holds the stored *encrypted* key token (about 140 masked characters), not an empty field. Never run `browser value` on it: it prints the token. Leave it untouched to keep the key.+- Provider and model options render in a portal outside the editor and modals: select `testid=provider-item-<name>` unscoped. Only verified providers have `provider-item-*` IDs and only Other models have `model-item-*` IDs; use `role=option[name="..."][exact]` for the rest. `browser testids --filter model-item` lists only items scrolled into view; `browser count` finds the rest.+- The auto-filled Profile Name never reuses an existing profile's name: picking a model whose name is already a profile's (for example `deepseek-flash` after `llm preset deepseek`) empties the field, which disables Save. Recipes fill `profile-name-input` with a `QA_*` name anyway.+- A duplicate profile name disables Save silently: no message, and `aria-invalid` stays `false` (#17938). Check `browser enabled 'testid=save-profile-btn'`, not the field styling.+- The Rename modal does not check duplicates client-side (Rename stays enabled); the server's 409 comes back as the toast `Profile '<name>' already exists`, and `browser errors --app-only` counts one `http-error` and one `console.error` for it.+- Set as default (and deleting the Default) rewrites the agent's active LLM settings (`control-openhands llm show`). Deleting every profile leaves the last applied model and key in agent settings.+- Profiles created by Add models are named from the model (`deepseek-chat`, …), not `QA_*`. The chooser hides a model when a profile with that *name* exists, not when a profile uses that model. Clean them up before the connection: the server refuses to delete a connection while profiles reference it.+- A profile linked to a missing connection is grouped under a header showing the raw connection id (`00000000…`) instead of a name.+- The All tab logs many `[i18n] Missing translation for key "SCHEMA$LLM$..."` console warnings; they are not page errors.+- The list follows the server's order, which sorts by profile file name: `QA_pro-copy-1` lists before `QA_pro-copy` (`-` sorts before `.json`'s `.`). Do not assert a strict alphabetical order on names that are prefixes of each other.+- Toasts last only a few seconds. A `browser screenshot` taken after a slow command can miss them, so assert with `browser wait-text` or `browser toasts`.+- Known issue #17955: a new profile is saved without the inherited LLM options the editor shows, such as temperature (`F10.create-prefill`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F11-provider-connections.md b/.agents/skills/verify-openhands/references/feature-map/F11-provider-connections.mdnew file mode 100644index 0000000000..79100b6624--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F11-provider-connections.md@@ -0,0 +1,93 @@+# F11 — Provider connections++A provider connection is a named, shared credential (provider, API key,+optional base URL) that many LLM profiles link to instead of carrying their own+key. Under Settings → LLM, below **Available Profiles**, a user lists+connections with their linked-model count, adds them, edits them (rename,+provider, base URL, key rotation with a blank key meaning "keep"), bulk-adds+linked profiles from a row's menu, and deletes them; the server refuses to+delete a connection that a profile or the active settings still reference.++Source: `src/components/features/settings/llm-profiles/provider-connections-manager.tsx`, `src/components/features/settings/llm-profiles/provider-connection-row.tsx`, `src/components/features/settings/llm-profiles/provider-connection-actions-menu.tsx`, `src/components/features/settings/llm-profiles/provider-connection-modal.tsx`, `src/components/features/settings/llm-profiles/delete-provider-connection-modal.tsx`, `src/components/features/settings/llm-profiles/llm-profiles-manager.tsx`, `src/api/provider-connections-service/`.++## Sub-features++- `F11.list-empty`: with no connections the section shows the heading `Provider connections`, the subline `Share one API key across multiple models.`, **Add connection** and `No provider connections yet. Add one to share an API key across models.`+- `F11.list`: each row shows the name, the provider, `<n> model(s)` (profiles linked to it), a green key-set icon and a `...` menu labelled `Provider connection menu`; the section is reachable from the settings nav, the command menu and the URL.+- `F11.create-validation`: in **Add provider connection** focus starts on Name; Save stays disabled until Name, a picked Provider and API Key are non-blank (whitespace does not count); a provider typed but not picked is cleared; Enter does not submit.+- `F11.provider-picker`: the Provider combobox lists `Verified Models` (OpenHands, Anthropic, OpenAI, …, deepseek, …) and `Other Models` groups and filters as you type.+- `F11.create`: Save creates the connection (toast `Connection "<name>" created`); the row persists after a reload and a backend restart; the key is stored but never shown.+- `F11.create-cancel`: Cancel, Escape and a backdrop click close the modal without creating anything; reopening starts empty.+- `F11.create-error`: a server rejection (for example a name over 128 characters) keeps the modal open and toasts a readable message.+- `F11.row-menu`: the `...` menu offers **Bulk add**, **Edit**, **Delete**; Escape, a click outside or a second trigger click close it; ArrowUp/ArrowDown move and wrap; Tab closes it.+- `F11.row-menu-focus`: opening the menu moves focus to its first item (**Bulk add**).+- `F11.edit`: **Edit** opens `Edit provider connection` prefilled (key blank with placeholder `<hidden>` and hint `Leave blank to keep the current key.`); rename, provider and base URL changes persist (toast `Connection "<name>" updated`), a cleared base URL is stored as none, a blank name disables Save, and a rename shows in the linked profiles' group header.+- `F11.add-models`: **Bulk add** opens `Add models as profiles` with the row's provider and connection preselected; the profiles it adds are linked and the row's count goes up.+- `F11.agent-uses-connection`: a conversation on a profile linked to the connection runs with the connection's key; an Edit with the key left blank keeps it working.+- `F11.rotate`: typing a new key rotates it for new conversations: an invalid key makes the next conversation fail with the provider's authentication error and no reply; rotating back restores replies.+- `F11.delete`: **Delete** asks `Are you sure you want to delete the connection "<name>"?` (focus on Cancel); Cancel and Escape keep it; Delete removes it (toast `Connection "<name>" deleted`).+- `F11.delete-referenced`: deleting a connection that profiles or the active settings reference is refused with the server's message naming them; the dialog stays open and the row stays.+- `F11.delete-stale-reference`: once its last linked profile is deleted (row shows `0 model(s)`) the connection can be deleted, or the UI says how to clear the remaining reference.+- `F11.phone`: at 390 px the rows, the row menu and the modals fit without horizontal overflow.+- `F11.load-error`: if listing connections fails (for example an unreadable connections store, `GET /api/llm/provider-connections` 400), the section shows `Failed to load provider connections.` (`provider-connections-load-error`) in red while the profiles list and **Add connection** still render.+- `F11.long-name`: a name at the 128-character limit is accepted; the row truncates the name and provider with an ellipsis, shows the full name as a hover tooltip (`title`) and keeps the `...` trigger in view at desktop and phone width.+- `F11.edit-unlisted-provider`: a connection whose provider is not in the provider catalog (created through the API) opens in Edit with that provider preselected and listed under `Other Models`, and saving keeps it.+- `F11.cloud`: on Cloud the section appears only with an organization bound and for members allowed to manage profiles; local users always see it.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`), then **LLM** in the settings navigation (`sidebar-settings-/settings/llm`); the section sits below **Available Profiles**.+- Direct URL `/settings/llm`.+- Command menu (`Control+k`/`Meta+k`, or `command-menu-trigger`): search `LLM`, choose **LLM profiles**. Searching `provider connection` finds nothing.+- **Add connection** (`add-provider-connection`) opens the create modal; each row's `...` (`provider-connection-menu-trigger`) opens **Bulk add** / **Edit** / **Delete**.+- Elsewhere (other families): Model Router's editor has its own **Add connection** (`meta-profile-add-provider-connection`, see F12); the LLM profile editor links a profile to a connection and **Add from provider connections** bulk-adds without a preselected connection (see F10).++## Driving it with control-openhands++Preconditions:++- A fresh `control-openhands launch --new`, doctored, `onboard --skip` done, desktop viewport. Do not run `llm preset deepseek` before this family: the recipes need no LLM profile and no connection (`control-openhands api GET /api/profiles` lists none, `control-openhands api GET /api/llm/provider-connections` is `[]`), so the profile added in Bulk add becomes the active one.+- A DeepSeek key in a file (`<key file>`). Pass it only with `browser fill ... --value-file <key file>`; never on the command line.+- `F11.agent-uses-connection` and `F11.rotate` start three tiny conversations on `deepseek/deepseek-flash`.+- `F11.load-error` is arranged by making the run's own connections store unreadable (a shell arrange step that writes only `$OH_VERIFY_RUN/private/provider-connections/provider_connections.json`, restored afterwards); `service stop agent-server` does not work because it replaces the whole page with `agent-server-onboarding-screen`.+- Blocked here: `F11.cloud` (needs a Cloud account with and without an organization, as owner and as member).++- **Empty state (`F11.list-empty`).** Run `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings'`, `control-openhands browser click 'testid=sidebar-settings-/settings/llm' --expect-url '/settings/llm'`, then `control-openhands browser text 'testid=provider-connections-empty'` and `control-openhands browser snapshot main`. The text is `No provider connections yet. Add one to share an API key across models.`; the snapshot shows heading `Provider connections`, paragraph `Share one API key across multiple models.` and button `Add connection` (screenshot `--feature F11.list-empty --name empty`).+- **Other entry points (`F11.list`).** Run `control-openhands browser goto /` (Empty state ends on `/settings/llm`, where the URL wait would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' LLM` (`browser snapshot 'testid=command-menu'` shows the selected option `LLM profiles Manage models, providers, and API keys. Go`), `control-openhands browser press Enter`, `control-openhands browser wait-url '/settings/llm'`, then `control-openhands browser count 'testid=add-provider-connection'` (`1`). `control-openhands browser goto /settings/llm` shows the same section.+- **Validation and provider picker (`F11.create-validation`, `F11.provider-picker`).** Run `control-openhands browser click 'testid=add-provider-connection'`; `control-openhands browser snapshot 'role=dialog'` shows `Add provider connection` with Name, Provider, API Key, `Base URL Optional` and `Save` [disabled], and `control-openhands browser eval "document.activeElement.getAttribute('data-testid')"` is `provider-connection-name-input`. Fill `control-openhands browser fill 'testid=provider-connection-name-input' QA_conn`; `control-openhands browser enabled 'testid=provider-connection-submit'` stays `false`. Run `control-openhands browser click 'testid=provider-connection-provider-input'` and `control-openhands browser snapshot 'role=listbox'`: groups `Verified Models` (OpenHands, Anthropic, OpenAI, Mistral AI, Gemini, deepseek, Moonshot, minimax, glm, nvidia, qwen) and `Other Models`. `control-openhands browser fill 'testid=provider-connection-provider-input' deep` narrows it to `deepseek` (verified) and `deepgram`, `DeepInfra`; then `control-openhands browser click 'testid=provider-item-deepseek'` and `control-openhands browser value 'testid=provider-connection-provider-input'` is `deepseek`. Save is still disabled; `control-openhands browser fill 'testid=provider-connection-api-key-input' ' '` keeps it disabled, and a name of only spaces does too. A provider typed but not picked is cleared: `control-openhands browser fill 'testid=provider-connection-provider-input' deepse`, `control-openhands browser click 'testid=provider-connection-name-input'`, then `browser value 'testid=provider-connection-provider-input'` is empty (pick deepseek again afterwards). Enter does not submit: with every field valid (`enabled` `true`), `control-openhands browser press Enter` in the Name field leaves `browser count 'testid=provider-connection-modal'` at `1` and creates nothing (`api GET /api/llm/provider-connections`).+- **Create (`F11.create`).** In the same modal run `control-openhands browser fill 'testid=provider-connection-api-key-input' --value-file <key file>` (`enabled` turns `true`, `browser attr 'testid=provider-connection-api-key-input' type` is `password`), `control-openhands browser click 'testid=provider-connection-submit'` and `control-openhands browser wait-text 'Connection "QA_conn" created'`. `control-openhands browser count 'testid=provider-connection-modal'` is `0`. After `control-openhands browser reload`, `control-openhands browser text 'testid=provider-connection-row >> has-text=QA_conn'` is `QA_conn\ndeepseek\n0 model(s)` and `control-openhands api GET /api/llm/provider-connections` lists it with `"api_key_set": true` and `"base_url": null` (the key itself is never returned).+- **Row (`F11.list`).** Run `control-openhands browser count 'testid=provider-connection-row >> has-text=QA_conn >> testid=set-indicator'` (`1`), `control-openhands browser attr 'testid=provider-connection-row >> has-text=QA_conn >> testid=provider-connection-menu-trigger' aria-label` (`Provider connection menu`) and `control-openhands browser screenshot 'testid=provider-connection-row' --feature F11.list --name row` (name, muted provider, `0 model(s)`, green check, vertical dots).+- **Cancel (`F11.create-cancel`).** Run `control-openhands browser click 'testid=add-provider-connection'`, `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'`; `browser count 'testid=provider-connection-modal'` is `0`. Reopen, `control-openhands browser fill 'testid=provider-connection-name-input' QA_escape`, `control-openhands browser press Escape` (count `0`); reopen: `control-openhands browser value 'testid=provider-connection-name-input'` is empty; `control-openhands browser mouse-click 50 500` closes it too. `api GET /api/llm/provider-connections` lists no `QA_escape`.+- **Server error (`F11.create-error`).** Run `control-openhands browser click 'testid=add-provider-connection'`, `control-openhands browser fill 'testid=provider-connection-name-input' "QA_$(printf 'x%.0s' $(seq 1 127))"` (130 characters), pick deepseek as above, `control-openhands browser fill 'testid=provider-connection-api-key-input' dummy-key-3`, `control-openhands browser click 'testid=provider-connection-submit'`, then `control-openhands browser toasts` and `control-openhands browser count 'testid=provider-connection-modal'`. Expected: the modal stays open (`1`) and the toast reads like `String should have at most 128 characters`. Today the toast is the raw response, `HTTP request failed (422 Unprocessable Entity): {"detail":[{"type":"string_too_long",...` (fail, screenshot `--feature F11.create-error --name toast`). Close with `role=dialog >> role=button[name="Cancel"]`.+- **Second connection.** Create `QA_spare` the same way with `dummy-key-2` as key and `control-openhands browser fill 'testid=provider-connection-base-url-input' 'not a url'` (accepted: base URLs are not validated). Toast `Connection "QA_spare" created`.+- **Row menu (`F11.row-menu`, `F11.row-menu-focus`).** Run `control-openhands browser click 'testid=provider-connection-row >> has-text=QA_spare >> testid=provider-connection-menu-trigger'` and `control-openhands browser snapshot 'testid=provider-connection-actions-menu'`: menuitems `Bulk add`, `Edit`, `Delete` (screenshot `--feature F11.row-menu --name open`). `control-openhands browser eval "document.activeElement.getAttribute('data-testid')"` should be `provider-connection-add-models`; today it stays `provider-connection-menu-trigger` (fail) and ArrowDown does nothing until `control-openhands browser press Tab` moves focus to Bulk add. From there `browser press ArrowDown` focuses `provider-connection-edit`, two `ArrowUp` wrap to `provider-connection-delete`, and `browser press Tab` closes the menu (`browser count 'testid=provider-connection-actions-menu'` `0`). Reopen and `browser press Escape` (`0`); reopen and click the trigger again (`0`); reopen and `control-openhands browser click 'text=Share one API key across multiple models.'` (`0`).+- **Edit (`F11.edit`).** Run the trigger click above, then `control-openhands browser click 'testid=provider-connection-actions-menu >> testid=provider-connection-edit'` and `control-openhands browser snapshot 'role=dialog'`: `Edit provider connection`, Name `QA_spare`, Provider `deepseek`, `API Key Leave blank to keep the current key.` with placeholder `<hidden>`, Base URL `not a url`; `browser value 'testid=provider-connection-api-key-input'` is empty and Save is enabled. Run `control-openhands browser fill 'testid=provider-connection-name-input' QA_edited`, `control-openhands browser fill 'testid=provider-connection-base-url-input' 'https://api.deepseek.com'`, `control-openhands browser click 'testid=provider-connection-submit'` and `control-openhands browser wait-text 'Connection "QA_edited" updated'`. After `browser reload` the row reads `QA_edited\ndeepseek\n0 model(s)`, the `QA_spare` count is `0`, and `api GET /api/llm/provider-connections` shows `base_url` `https://api.deepseek.com` and `api_key_set` `true`. Edit again: fill the name with `' '` (`browser enabled 'testid=provider-connection-submit'` `false`), restore `QA_edited`, `control-openhands browser fill 'testid=provider-connection-base-url-input' ''`, Save, `browser wait 'testid=provider-connection-modal' --state detached`; the API shows `base_url` `null`.+- **Bulk add (`F11.add-models`).** Run `control-openhands browser click 'testid=provider-connection-row >> has-text=QA_conn >> testid=provider-connection-menu-trigger'` and `control-openhands browser click 'testid=provider-connection-actions-menu >> testid=provider-connection-add-models'`. The dialog `Add models as profiles` has provider `deepseek` selected, `control-openhands browser eval "[...document.querySelectorAll('[data-testid=add-models-connection] option')].map(o=>o.textContent+'='+o.selected).join(' | ')"` is `No connection (keyless)=false | QA_conn=true | QA_edited=false`, and `browser text 'testid=add-models-submit'` is `Add 12 profiles` (every model checked). Run `control-openhands browser uncheck 'testid=add-models-select-all'` (`Add 0 profiles`), `control-openhands browser check 'testid=add-models-check-deepseek/deepseek-flash'` (`Add 1 profiles`), `control-openhands browser click 'testid=add-models-submit'` and `control-openhands browser wait-text 'Added 1'`. After `browser reload` the `QA_conn` row reads `QA_conn\ndeepseek\n1 model(s)` (`QA_edited` stays `0 model(s)`), and `api GET /api/profiles` shows `deepseek-flash` with `provider_connection_id` and `"active_profile": "deepseek-flash"`.+- **The agent uses the connection's key (`F11.agent-uses-connection`).** Open Edit on `QA_conn` (as above), leave the key blank, click `testid=provider-connection-submit` and `browser wait-text 'Connection "QA_conn" updated'`. Run `control-openhands conversation start --prompt "Reply with exactly the word: pong" --wait --timeout 180` (prints `<id>`, `"model": "deepseek/deepseek-flash"`, status `finished`), then `control-openhands conversation events <id> --kinds ConversationErrorEvent,MessageEvent`: the agent message is `pong` and there is no `ConversationErrorEvent`.+- **Rotate the key (`F11.rotate`).** Run `control-openhands browser goto /settings/llm`, open Edit on `QA_conn`, `control-openhands browser fill 'testid=provider-connection-api-key-input' sk-qa-invalid-0000`, Save and `browser wait-text 'Connection "QA_conn" updated'`. Run `control-openhands conversation start --prompt "Reply with exactly the word: ping" --wait --timeout 180` and `control-openhands conversation events <id> --kinds ConversationErrorEvent,MessageEvent`. Expected: a `ConversationErrorEvent` and no agent reply. Today the conversation shows the banner `litellm.BadRequestError: DeepseekException - ... Authentication Fails, Your api key: ****0000 is invalid` (so the new key was used), yet the agent still answers `ping` in the same turn (fail, screenshot `--feature F11.rotate --name bad-key`). Rotate back: `browser goto /settings/llm`, Edit `QA_conn`, `control-openhands browser fill 'testid=provider-connection-api-key-input' --value-file <key file>`, Save; a new `conversation start --prompt "Reply with exactly the word: pong" --wait --timeout 180` has `pong` and no `ConversationErrorEvent`.+- **Rename a linked connection (`F11.edit`).** Run `control-openhands browser goto /settings/llm`, Edit `QA_conn`, fill the name with `QA_shared`, Save and `browser wait-text 'Connection "QA_shared" updated'`. After `browser reload`, `control-openhands browser text 'testid=profile-group-header'` is `QA_SHARED` (CSS upper-case).+- **Delete is refused while referenced (`F11.delete-referenced`).** Run `control-openhands browser click 'testid=provider-connection-row >> has-text=QA_shared >> testid=provider-connection-menu-trigger'`, `control-openhands browser click 'testid=provider-connection-actions-menu >> testid=provider-connection-delete'`, `control-openhands browser click 'testid=delete-provider-connection-confirm'`, then `control-openhands browser toasts`: `Provider connection cannot be deleted while it is referenced by LLM profile(s): deepseek-flash and referenced by the active agent settings. Update those references before deleting it.` The dialog stays open (`browser count 'role=dialog'` > `0`); close it with `role=dialog >> role=button[name="Cancel"]`; after `browser reload` the row is still there.+- **Delete (`F11.delete`).** Run `control-openhands browser click 'testid=provider-connection-row >> has-text=QA_edited >> testid=provider-connection-menu-trigger'`, `control-openhands browser click 'testid=provider-connection-actions-menu >> testid=provider-connection-delete'` and `control-openhands browser snapshot 'role=dialog'`: `Delete provider connection`, `Are you sure you want to delete the connection "QA_edited"?`, buttons `Cancel` and `Delete`; `browser eval "document.activeElement.textContent"` is `Cancel` (screenshot `--feature F11.delete --name confirm`). `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps the row; reopen and `browser press Escape` keeps it too. Reopen, `control-openhands browser click 'testid=delete-provider-connection-confirm'`, `control-openhands browser wait-text 'Connection "QA_edited" deleted'`, `browser reload`: `browser count 'testid=provider-connection-row >> has-text=QA_edited'` is `0`.+- **Phone layout (`F11.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser scroll 'testid=add-provider-connection'`, `control-openhands browser bbox 'testid=provider-connection-row >> nth=0'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `browser screenshot --feature F11.phone --name list`. Open the `QA_shared` row menu: `browser bbox 'testid=provider-connection-actions-menu'` is inside the viewport. Click `testid=provider-connection-actions-menu >> testid=provider-connection-edit`: `browser bbox 'testid=provider-connection-modal'` and `browser bbox 'testid=provider-connection-submit'` are inside the viewport (screenshot `--name edit-modal`). Cancel, then `control-openhands browser viewport desktop`.+- **Long name and provider change (`F11.long-name`, `F11.edit`).** Create a connection named `"QA_long$(printf 'x%.0s' $(seq 1 121))"` (128 characters) with deepseek and `dummy-key-5` as above: toast `Connection "QA_long…" created`, modal closed. `control-openhands browser tooltip 'testid=provider-connection-row >> has-text=QA_long >> span[title]'` returns the full 128-character name (`source` `title attribute`), `browser eval` on that span shows `scrollWidth > clientWidth` with `text-overflow: ellipsis`, and `browser bbox 'testid=provider-connection-row >> has-text=QA_long'` is `insideViewport` `true`, `pageHorizontalOverflow` `false` (screenshot `--feature F11.long-name --name row`). At `browser viewport phone` after `browser scroll 'testid=add-provider-connection'`, `browser bbox 'testid=provider-connection-row >> has-text=QA_long >> testid=provider-connection-menu-trigger'` is inside the viewport with no horizontal overflow (screenshot `--name phone`); back to `browser viewport desktop`. Open Edit on `QA_long`: `browser count 'testid=provider-connection-modal >> testid=set-indicator'` is `1` (green key-set check beside API Key). `control-openhands browser choose 'testid=provider-connection-provider-input' Anthropic`, Save, `browser wait 'testid=provider-connection-modal' --state detached`, `browser reload`: the row reads `QA_long…\nanthropic\n0 model(s)` and `api GET /api/llm/provider-connections` shows `"provider": "anthropic"`.+- **Persistence across a backend restart (`F11.create`).** Run `control-openhands restart` and `control-openhands browser reload`; `browser eval "[...document.querySelectorAll('[data-testid=provider-connection-row]')].map(r=>r.innerText.replace(/\n/g,'|')).join(' ; ')"` lists the same rows and counts as before (for example `QA_shared|deepseek|1 model(s) ; QA_long…|anthropic|0 model(s)`).+- **Unlisted provider (`F11.edit-unlisted-provider`).** Arrange (not proof) `control-openhands api POST /api/llm/provider-connections --data '{"display_name":"QA_custom","provider":"qa_unlisted","api_key":"dummy-key-6","base_url":null}' --write` (201), then `browser reload`: the row reads `QA_custom\nqa_unlisted\n0 model(s)`. Open Edit on `QA_custom`: `browser value 'testid=provider-connection-provider-input'` is `qa_unlisted`; `browser click` that input, `browser fill ... qa_` and `browser snapshot 'role=listbox'` shows only group `Other Models` with option `qa_unlisted` [selected]. Click `'role=option[name="qa_unlisted"]'`, fill the name with `QA_custom2`, Save: toast `Connection "QA_custom2" updated` and the API still shows `"provider": "qa_unlisted"`. Delete `QA_custom2` and `QA_long` through their row menus and `testid=delete-provider-connection-confirm` (wait for the confirm button `--state detached` between them); `api GET /api/llm/provider-connections` lists only `QA_shared`.+- **Stale reference and cleanup (`F11.delete-stale-reference`).** Delete the linked profile (F10): `control-openhands browser click '[data-testid=profile-row]:has([title="deepseek-flash"]) >> testid=profile-menu-trigger'`, `control-openhands browser click 'testid=profile-actions-menu >> testid=profile-delete'`, `control-openhands browser click 'testid=delete-profile-confirm'` (toast `Profile "deepseek-flash" deleted`). After `browser reload` the `QA_shared` row reads `0 model(s)`. Delete `QA_shared` through its row menu and `testid=delete-provider-connection-confirm`. Expected: it is deleted. Today the toast is `Provider connection cannot be deleted while it is referenced by the active agent settings. Update those references before deleting it.` and nothing on the page clears that reference (fail, screenshot `--feature F11.delete-stale-reference --name refused`). To finish cleanup, close the dialog, arrange an unlinked active profile with `control-openhands llm preset deepseek --api-key-file <key file>` (this is the arrange step, not proof), `browser reload`, delete `QA_shared` through the row menu (toast `Connection "QA_shared" deleted`), `browser reload`: `testid=provider-connections-empty` is back and `api GET /api/llm/provider-connections` is `[]`.+- **Load error (`F11.load-error`).** With the baseline restored (connections `[]`), run the shell arrange step (it writes only this run's state) `F=$OH_VERIFY_RUN/private/provider-connections/provider_connections.json; cp $F $F.bak; printf '{not json' > $F`. `control-openhands api GET /api/llm/provider-connections` is now `400` (`Provider connections file is unreadable: ...`) while `api GET /api/profiles` is `200`. Run `control-openhands browser reload`, `control-openhands browser text 'testid=provider-connections-load-error'` (`Failed to load provider connections.`), `browser count 'testid=add-provider-connection'` (`1`) and `browser count 'testid=profile-row'` (> `0`; screenshot `--feature F11.load-error --name error`). Restore with `cp $F.bak $F && rm $F.bak`, `browser reload`: `testid=provider-connections-empty` is back and `provider-connections-load-error` count is `0`.+- **Errors sweep.** `control-openhands browser errors --app-only` shows `pageErrors` `0`; the HTTP errors are the deliberate `POST 422` (long name), two `DELETE 409` (referenced, then the stale reference) and the `GET 400` from the load-error arrange, all on `/api/llm/provider-connections`. Run `browser errors --clear` afterwards.++## Gotchas++- Select the Provider by clicking an option (`testid=provider-item-<name>` exists only for verified providers; use `'role=option[name="<label>"]'` for the others), or with `browser choose 'testid=provider-connection-provider-input' <label>`. `browser fill` alone types a filter that is cleared on blur and leaves Save disabled.+- `browser fill ... --value-file <key file>` needs no positional value and prints only the length; keep keys out of commands and screenshots (the field is a password input).+- Duplicate display names are accepted (two rows called `QA_conn`), and so is any base URL text; rows then differ only by order (`'testid=provider-connection-row >> nth=1'`). Keep fixture names unique.+- Edit's Save is enabled even with no changes, and a blank key on Edit is omitted from the request (the stored key is kept); there is no way to clear a key.+- The delete spinner (`aria-busy`) lasts under 100 ms on a local stack; `--observe` sees only `Delete` then `<absent>`.+- `role=dialog` matches two nested elements in these modals; count `> 0`, do not expect `1`.+- The first profile added on a run with no profiles becomes the active one. Activating a linked profile copies the resolved key into the active agent settings, which keep the connection id: that is why the server still counts a reference after every linked profile is gone (see `F11.delete-stale-reference`) (OpenHands/software-agent-sdk#5498).+- Delete a connection's linked profiles before the connection; then also make an unlinked profile active, or the delete is refused.+- Rotation results are read from the conversation (`conversation events ... --kinds ConversationErrorEvent,MessageEvent` and the banner in the chat), not from the settings page, which never shows the key.+- Model Router's **Add connection** reuses this modal (F12); its toasts and fields are the same.+- `F11.load-error` needs a real server failure: the recipe corrupts this run's own `provider_connections.json` and restores it. Always restore it (keep the `.bak`), or every later family on the run sees the error; never touch another run's state.+- At phone width a long name squeezes the provider column to one letter (`d…`); the full values stay in the API and the name's `title`.+- Known issue OpenHands/software-agent-sdk#5497: after a key rotation, new conversations still run agent steps on the old key; only title generation uses the new one (`F11.rotate`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F12-model-router.md b/.agents/skills/verify-openhands/references/feature-map/F12-model-router.mdnew file mode 100644index 0000000000..a667bd6e71--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F12-model-router.md@@ -0,0 +1,99 @@+# F12 — Model router (meta-LLM profiles)++A model router (the UI also calls it a "meta-profile") names a classifier LLM+profile, a prompt template and a model table. While a router is active, every+new conversation gets a `route_task_to_model` tool: the classifier picks one+saved LLM profile from the table and the agent switches to it (the chat shows+`Switched to profile <name>`). With **Run on first message** on, the agent is+told to route the first user message before doing anything else. Users create+routers from the Router Pro / Router Flash templates or from scratch, can have+the missing router LLM profiles created from a provider connection, and+activate, edit and delete routers under Settings → Model Router.++Source: `src/routes/meta-llm-settings.tsx`, `src/components/features/settings/meta-llm-profiles/`, `src/api/meta-profiles-service/meta-profiles-service.api.ts`, `src/api/agent-server-adapter.ts` (`buildRouterAtStartSystemSuffix`), `src/constants/settings-nav.tsx`.++## Sub-features++- `F12.page`: Settings → **Model Router** opens `/settings/meta-llm` with the subtitle `Meta-profiles that route each task to the right LLM profile.`; the command menu offers a **Model Router** command that opens it, like the other settings pages.+- `F12.empty-states`: with no LLM profiles the page says `Create LLM profiles first — meta-profiles route between your saved LLM profiles.`; with no routers it says `No meta-profiles yet. Add one to route tasks across your LLM profiles.` and **Run on first message** is off and disabled.+- `F12.load-error`: when only the meta-profile request fails, a red generic error shows under the header.+- `F12.unsupported`: an agent server without `/api/meta-profiles` (404) shows `This backend doesn't support model routing yet. Update the agent server to manage meta-profiles.`+- `F12.cloud`: a Cloud backend without an organization shows `Meta-profiles are only available for local backends.`; an organization-bound Cloud backend shows the full page.+- `F12.template-chooser`: **Add Model Router** opens `Choose Model Router template` (Add OpenHands Router Pro, Add OpenHands Router Flash, Custom, Cancel); Cancel, Escape and a backdrop click close it; Pro and Flash prefill the name, classifier `minimax-m3`, their own long routing prompt and the same 11-model table.+- `F12.template-custom`: **Custom** opens a blank editor; the placeholders show an example prompt and a two-line example model table.+- `F12.editor-validation`: Save stays disabled until the name is valid, a classifier is set and the prompt contains `{{ instance_text }}` (spaces inside the braces optional).+- `F12.duplicate-name`: a new router cannot take an existing router's name (`A meta-profile with this name already exists...`, Save disabled).+- `F12.add-connection`: **Add connection** in the create editor opens `Add provider connection`; saving it selects the new connection in the picker.+- `F12.add-connection-cancel`: **Cancel** in `Add provider connection` closes it without creating a connection and keeps the editor's values and picker choice.+- `F12.editor-cancel`: while the create or edit editor is open it replaces the list, **Add Model Router** and the switch; **Cancel** returns to the list without saving anything.+- `F12.router-profiles`: with a connection picked under **Create missing router LLM profiles using**, Save creates an LLM profile `<provider>/<name>` linked to that connection for every model-table name (and the classifier) that does not exist yet; **Don't create profiles** creates none.+- `F12.create-first`: saving the first router lists it, makes it Active and turns **Run on first message** on.+- `F12.create-more`: saving another router lists it and leaves the Active badge where it was.+- `F12.list`: each row shows the name, `<classifier> · Direct prompt`, an **Active** badge on the active router and a `...` menu; routers and the active choice survive a stack restart.+- `F12.row-menu`: the row menu offers Edit, Set active (disabled on the active row) and Delete, and closes on Escape.+- `F12.activate`: **Set active** toasts `Meta-profile "<name>" activated` and moves the badge.+- `F12.edit`: **Edit** opens `Edit meta-profile` with the name locked and no connection picker; changes persist.+- `F12.delete`: **Delete** asks `Are you sure you want to delete "<name>"? This cannot be undone.`; Cancel keeps the row, Delete removes it.+- `F12.delete-active`: deleting the active router leaves no router active; the switch shows off and disabled, and new conversations get neither the tool nor the first-message instruction.+- `F12.run-first-message-toggle`: the switch saves immediately (no Save button, no toast) and survives a reload.+- `F12.route-first-message`: with a router active and the switch on, a new conversation routes its first message (`route_task_to_model` action, `Switched to profile <name>` in the chat); with the switch off the tool is still attached but the instruction is absent.+- `F12.light-theme`: in a light colour theme the list heading and router names are readable.+- `F12.phone`: the list, template modal, editor and row menu fit a 390 px viewport without horizontal overflow.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`), then **Model Router** in the settings navigation (`sidebar-settings-/settings/meta-llm`, between LLM and Condenser). Used by `F12.page`.+- Direct URL `/settings/meta-llm`. Used by most recipes (`browser goto`).+- Command menu (`Control+k` or `Meta+k`, or `command-menu-trigger` in the sidebar): search "Model Router" (or "router", "meta"), choose **Model Router** ("Meta-profiles that route each task to the right LLM profile."). Used by `F12.page`.+- Per-router actions: the row `...` button (`meta-profile-menu-trigger-<name>`), then Edit / Set active / Delete.+- The effect of a router is seen in a conversation started from the home composer (`F12.route-first-message`; see F05/F06 for the composer and activity rendering).++## Driving it with control-openhands++Preconditions:++- `F12.empty-states` needs a fresh `launch --new` with `onboard --skip` done and **before** `llm preset deepseek` (no LLM profiles, no routers).+- Everything after it needs `control-openhands llm preset deepseek --api-key-file <key file>` (profiles `deepseek-flash` and `deepseek-pro`), no meta-profile named `QA_*` (`control-openhands api GET /api/meta-profiles`), no provider connection (`control-openhands api GET /api/llm/provider-connections` is `[]`) and no LLM profile named `deepseek-chat` (`control-openhands api GET /api/profiles`).+- `F12.add-connection` and `F12.route-first-message` use the DeepSeek key file; never print it.+- Blocked here: `F12.unsupported` (needs an agent server older than software-agent-sdk #3744, for example `launch --new --sdk-ref <older release>`), `F12.cloud` (needs a Cloud account, with and without an organization) and `F12.load-error` (needs `/api/meta-profiles` to fail while the rest of the agent server answers; `service stop agent-server` swaps the whole app for the Manage backends card instead).+- Desktop viewport unless a bullet says otherwise.++- **Open from navigation (`F12.page`).** From `/` run `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings'`, `control-openhands browser click 'testid=sidebar-settings-/settings/meta-llm' --expect-url '/settings/meta-llm(\?|$)'`, `control-openhands browser text 'testid=settings-page-subtitle'` and `control-openhands browser attr 'testid=sidebar-settings-/settings/meta-llm' aria-current`. The subtitle is `Meta-profiles that route each task to the right LLM profile.` and `aria-current` is `page`.+- **Command menu (`F12.page`).** Run `control-openhands browser goto /` (the previous bullet ends on `/settings/meta-llm`, where the URL wait would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' 'Model Router'` and `control-openhands browser snapshot 'testid=command-menu'`: the only option is `Model Router Meta-profiles that route each task to the right LLM profile. Go` [selected]. `control-openhands browser fill 'testid=command-menu >> role=combobox' router` (and then `meta`) keeps that single option (`control-openhands browser count 'testid=command-menu >> role=option'` is `1`). Run `control-openhands browser press Enter` and `control-openhands browser wait-url '/settings/meta-llm(\?|$)'`; `browser text 'testid=settings-page-subtitle'` is the subtitle above.+- **Empty states (`F12.empty-states`).** On the fresh run run `control-openhands browser goto /settings/meta-llm`, `control-openhands browser text 'testid=meta-profile-no-llm-profiles'`, `control-openhands browser text 'testid=meta-profile-empty'` and `control-openhands browser eval "(()=>{const i=document.querySelector('[data-testid=meta-profile-run-at-conversation-start-switch]');return {checked:i.checked,disabled:i.disabled}})()"`. The texts are the two messages in Sub-features and the switch is `{checked:false, disabled:true}`. `control-openhands browser screenshot --feature F12.empty-states --name no-llm-profiles` shows both messages above a greyed switch.+- **Template chooser (`F12.template-chooser`).** Run `control-openhands browser click 'testid=add-meta-profile'` and `control-openhands browser snapshot 'role=dialog'`: dialog `Choose Model Router template` with buttons `Add OpenHands Router Pro`, `Add OpenHands Router Flash`, `Custom`, `Cancel`. `control-openhands browser click 'testid=meta-profile-template-cancel'` then `control-openhands browser count 'testid=meta-profile-template-modal'` is `0`; reopen and `control-openhands browser press Escape` gives `0` too. Reopen, `control-openhands browser click 'testid=meta-profile-template-router-pro'`, then `control-openhands browser value 'testid=meta-profile-name-input'` (`openhands-router-pro`), `control-openhands browser value 'testid=meta-profile-classifier-input'` (`minimax-m3`), `control-openhands browser eval "document.querySelector('[data-testid=meta-profile-model-table]').value.split('\n').length"` (`11`), `control-openhands browser eval "document.querySelector('[data-testid=meta-profile-prompt-template]').value.includes('{{ instance_text }}')"` (`true`), `control-openhands browser value 'testid=meta-profile-router-connection'` (`Don't create profiles` while no connection exists) and `control-openhands browser enabled 'testid=meta-profile-save'` (`true`). Leave with `control-openhands browser click 'testid=meta-profile-cancel'`. The Flash template (`testid=meta-profile-template-router-flash`) gives `openhands-router-flash`, the same classifier and identical table, and a different prompt (about 5,900 characters against Pro's 5,000; compare with `browser eval "document.querySelector('[data-testid=meta-profile-prompt-template]').value.length"`). A backdrop click also closes the chooser: reopen it and `control-openhands browser mouse-click 20 980`, then `count` is `0`.+- **Custom template (`F12.template-custom`).** Run `control-openhands browser click 'testid=add-meta-profile'`, `control-openhands browser click 'testid=meta-profile-template-custom'`, then `control-openhands browser value` on `testid=meta-profile-name-input`, `testid=meta-profile-classifier-input`, `testid=meta-profile-prompt-template` and `testid=meta-profile-model-table` (all `""`), `control-openhands browser enabled 'testid=meta-profile-save'` (`false`) and `control-openhands browser eval "document.querySelector('[data-testid=meta-profile-model-table]').placeholder.split('\n')"`: two example rows, `["- GPT-5.4: strong for coding and reasoning", "- MiniMax-M3: efficient fallback"]`, joined by a real line break (#18035), and `control-openhands browser screenshot --feature F12.template-custom --name custom-empty` shows them on two lines under the prompt placeholder, which breaks lines the same way.+- **Validation (`F12.editor-validation`).** In that Custom editor run `control-openhands browser fill 'testid=meta-profile-name-input' 'QA router!'`, `control-openhands browser fill 'testid=meta-profile-classifier-input' qa-classifier`, `control-openhands browser fill 'testid=meta-profile-prompt-template' 'Pick a model for: {{ instance_text }}'` and `control-openhands browser enabled 'testid=meta-profile-save'` (`false`: bad name). `control-openhands browser fill 'testid=meta-profile-name-input' QA_router` turns it `true`; `control-openhands browser fill 'testid=meta-profile-prompt-template' 'Pick a model for: {{ task }}'` turns it `false`; `'Pick a model for: {{instance_text}}'` turns it `true` again; `control-openhands browser fill 'testid=meta-profile-classifier-input' ''` turns it `false`. Keep the editor open.+- **Add a connection (`F12.add-connection`).** Run `control-openhands browser click 'testid=meta-profile-add-provider-connection'`, `control-openhands browser fill 'testid=provider-connection-name-input' QA_deepseek`, `control-openhands browser fill 'testid=provider-connection-provider-input' deepseek`, `control-openhands browser click 'role=option[name="deepseek"]'`, `control-openhands browser fill 'testid=provider-connection-api-key-input' --value-file <key file>`, `control-openhands browser click 'testid=provider-connection-submit'` and `control-openhands browser wait 'testid=provider-connection-modal' --state detached`. `control-openhands browser toasts` has `Connection "QA_deepseek" created` and `control-openhands browser value 'testid=meta-profile-router-connection'` is `QA_deepseek (deepseek)`.+- **Create the first router (`F12.create-first`, `F12.router-profiles`).** Write the prompt and table to files: `printf 'You route tasks. Reply only with JSON {"model": "<name>", "reason": "<short>"} using one name from this table:\n{{ model_table }}\n\nTask:\n{{ instance_text }}' > <prompt file>` and `printf -- '- deepseek-flash: cheap, for simple tasks\n- deepseek-pro: stronger, for hard tasks\n- deepseek-chat: general chat' > <table file>`. Run `control-openhands browser click 'testid=meta-profile-classifier-input'`, `control-openhands browser click 'role=option[name="deepseek-flash"]'`, `control-openhands browser fill 'testid=meta-profile-name-input' QA_router`, `control-openhands browser fill 'testid=meta-profile-prompt-template' --value-file <prompt file>`, `control-openhands browser fill 'testid=meta-profile-model-table' --value-file <table file>`, `control-openhands browser click 'testid=meta-profile-save'` and `control-openhands browser wait-text 'Meta-profile "QA_router" saved'`. After `control-openhands browser reload`: `control-openhands browser text 'testid=meta-profile-row-QA_router'` is `QA_router\ndeepseek-flash · Direct prompt\nActive`, the switch `eval` above returns `{checked:true, disabled:false}`, `control-openhands api GET /api/meta-profiles` has `active_meta_profile` `QA_router`, `control-openhands api GET /api/settings` has `"run_router_at_conversation_start": true`, and `control-openhands api GET /api/profiles` has a new `deepseek-chat` (`deepseek/deepseek-chat`, `provider_connection_id` set) while `deepseek-flash`/`deepseek-pro` are unchanged. `control-openhands browser screenshot --feature F12.create-first --name list-after-create` shows the row with the gold Active badge and the switch on.+- **Duplicate name (`F12.duplicate-name`).** Run `control-openhands browser click 'testid=add-meta-profile'`, `control-openhands browser click 'testid=meta-profile-template-custom'`, `control-openhands browser fill 'testid=meta-profile-name-input' QA_router`, `control-openhands browser text 'testid=meta-profile-name-taken'` (`A meta-profile with this name already exists. Choose a different name, or edit the existing one.`), pick classifier `deepseek-pro` as above, fill the prompt with `'Route: {{ instance_text }}'`, and `control-openhands browser enabled 'testid=meta-profile-save'` (`false`). `control-openhands browser fill 'testid=meta-profile-name-input' QA_router_2` makes `control-openhands browser count 'testid=meta-profile-name-taken'` `0` and Save `true`. Click `testid=meta-profile-cancel`; `control-openhands browser count 'testid=meta-profile-row-QA_router_2'` is `0`.+- **"Don't create profiles" in a template (`F12.router-profiles`).** Run `control-openhands browser click 'testid=add-meta-profile'`, `control-openhands browser click 'testid=meta-profile-template-router-pro'`, `control-openhands browser value 'testid=meta-profile-router-connection'` (`QA_deepseek (deepseek)`, preselected), `control-openhands browser click 'testid=meta-profile-router-connection'` and `control-openhands browser click "role=option[name=\"Don't create profiles\"]" --observe 'testid=meta-profile-router-connection' --observe-ms 1500`. The picker stays on `Don't create profiles`: the observed states are `QA_deepseek (deepseek)` at 0 ms and `Don't create profiles` about 300 ms later, with nothing after it, and `control-openhands browser value 'testid=meta-profile-router-connection'` is `Don't create profiles`. Cancel the editor (`control-openhands browser click 'testid=meta-profile-cancel'`); `F12.create-more` saves a template with this choice. The Custom template starts on `Don't create profiles` even with a connection present; there, pick `role=option[name="QA_deepseek (deepseek)"]` first and then `Don't create profiles`: the second pick sticks. Cancel the editor.+- **Create another router without new profiles (`F12.create-more`, `F12.router-profiles`).** Run `control-openhands browser click 'testid=add-meta-profile'`, `control-openhands browser click 'testid=meta-profile-template-router-flash'`, `control-openhands browser value 'testid=meta-profile-router-connection'` (`QA_deepseek (deepseek)`, preselected), `control-openhands browser fill 'testid=meta-profile-name-input' QA_router_flash`, `control-openhands browser click 'testid=meta-profile-router-connection'`, `control-openhands browser click "role=option[name=\"Don't create profiles\"]"` and `control-openhands browser value 'testid=meta-profile-router-connection'` (`Don't create profiles`). Then `control-openhands browser click 'testid=meta-profile-save'` and `control-openhands browser wait-text 'Meta-profile "QA_router_flash" saved'`. After `control-openhands browser reload`, `control-openhands browser text 'testid=meta-profile-list'` is `QA_router\ndeepseek-flash · Direct prompt\nActive\nQA_router_flash\nminimax-m3 · Direct prompt` and `control-openhands browser count 'testid=meta-profile-active-badge'` is `1`. `control-openhands api GET /api/profiles` still lists only `deepseek-chat`, `deepseek-flash` and `deepseek-pro`: none of the template's 11 models became a profile, so `QA_router_flash` names a classifier (`minimax-m3`) that does not exist, which saving allows (see Gotchas).+- **Row menu and activate (`F12.row-menu`, `F12.activate`).** Run `control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router'` and `control-openhands browser snapshot 'testid=meta-profile-actions-menu'` (`menuitem "Edit"`, `menuitem "Set active" [disabled]`, `menuitem "Delete"`); `control-openhands browser press Escape` closes it (`count` `0`). Then `control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router_flash'`, `control-openhands browser click 'testid=meta-profile-actions-menu >> testid=meta-profile-set-active'` and `control-openhands browser wait-text 'Meta-profile "QA_router_flash" activated'`. After `control-openhands browser reload`, `control-openhands browser count 'testid=meta-profile-row-QA_router_flash >> testid=meta-profile-active-badge'` is `1`, the total badge count is `1`, and `api GET /api/meta-profiles` agrees.+- **Edit (`F12.edit`).** Run `control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router'`, `control-openhands browser click 'testid=meta-profile-actions-menu >> testid=meta-profile-edit'`, `control-openhands browser text 'testid=meta-profile-editor >> role=heading'` (`Edit meta-profile`), `control-openhands browser enabled 'testid=meta-profile-name-input'` (`false`), `control-openhands browser count 'testid=meta-profile-router-connection'` (`0`). Pick classifier `deepseek-pro`, fill `testid=meta-profile-model-table` with the first two table lines only, click `testid=meta-profile-save` and `control-openhands browser wait-text 'Meta-profile "QA_router" saved'`. After a reload the row reads `QA_router\ndeepseek-pro · Direct prompt`, the badge stays on `QA_router_flash`, and `control-openhands api GET /api/meta-profiles/QA_router` shows the new classifier and table.+- **Cancel the connection dialog (`F12.add-connection-cancel`).** Run `control-openhands browser click 'testid=add-meta-profile'`, `control-openhands browser click 'testid=meta-profile-template-custom'`, `control-openhands browser fill 'testid=meta-profile-name-input' QA_router_cancel`, `control-openhands browser click 'testid=meta-profile-add-provider-connection'`, `control-openhands browser fill 'testid=provider-connection-name-input' QA_unused`, `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` (the Cancel button has no test id) and `control-openhands browser wait 'testid=provider-connection-modal' --state detached`. `browser value 'testid=meta-profile-name-input'` is still `QA_router_cancel`, the picker still reads `Don't create profiles`, and `control-openhands api GET /api/llm/provider-connections` has no `QA_unused` (`display_name` is the field).+- **Leave the editor (`F12.editor-cancel`).** In that editor `control-openhands browser count` on `testid=meta-profile-list`, `testid=add-meta-profile` and `testid=meta-profile-run-at-conversation-start` is `0` each. Pick classifier `deepseek-flash`, fill the prompt `'Pick: {{ instance_text }}'`, click `testid=meta-profile-cancel`: `count 'testid=meta-profile-list'` is `1`, `count 'testid=meta-profile-row-QA_router_cancel'` is `0` and `api GET /api/meta-profiles` has no `QA_router_cancel`. In edit mode (row menu → Edit on `QA_router`), `control-openhands browser fill 'testid=meta-profile-prompt-template' 'Changed: {{ instance_text }}'` then Cancel leaves `control-openhands api GET /api/meta-profiles/QA_router` with its saved `prompt_template`.+- **Run on first message (`F12.run-first-message-toggle`).** Run `control-openhands browser click 'testid=meta-profile-run-at-conversation-start >> text=Run on first message'`, then `control-openhands browser reload` and the switch `eval`: `checked` flips and stays flipped; `api GET /api/settings` shows `run_router_at_conversation_start` with the same value; `control-openhands browser toasts` is empty. Click again to restore `true`.+- **Routing in a conversation (`F12.route-first-message`).** Make `QA_router` active (row menu → Set active, `wait-text 'Meta-profile "QA_router" activated'`) with the switch on. Run `control-openhands conversation start --prompt "Run echo routed in the terminal and tell me its output." --wait --timeout 300`, then `control-openhands conversation events <id> --kinds ActionEvent,ObservationEvent,MessageEvent` (`<id>` from the start output). The first action is `route_task_to_model`, its observation starts `Classified task as 'model: deepseek-flash' and switched to LLM profile 'deepseek-flash'`, then the terminal runs `echo routed`. On the conversation page `control-openhands browser wait-text 'Switched to profile'` succeeds and `control-openhands browser screenshot --feature F12.route-first-message --name conversation` shows the `Switched to profile deepseek-flash` line above the answer. `control-openhands api GET "/api/conversations/<id>/events/search?limit=1" --max-bytes 200000` (the system prompt) contains `ROUTE_AT_CONVERSATION_START` and `"route_task_to_model"`. Switch **Run on first message** off (`control-openhands browser goto /settings/meta-llm` first: the browser is on the conversation), start `--prompt "Reply with only the word pong."`, and the same GET contains `"route_task_to_model"` but no `ROUTE_AT_CONVERSATION_START`; there is no route action.+- **Delete (`F12.delete`).** Run `control-openhands browser goto /settings/meta-llm`, `control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router_flash'`, `control-openhands browser click 'testid=meta-profile-actions-menu >> testid=meta-profile-delete'` and `control-openhands browser snapshot 'role=dialog'` (`Delete meta-profile`, `Are you sure you want to delete "QA_router_flash"? This cannot be undone.`, Cancel, Delete). `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps the row (`count` `1`). Repeat the menu click, then `control-openhands browser click 'testid=delete-meta-profile-confirm'`, `control-openhands browser wait-text 'Meta-profile "QA_router_flash" deleted'`, `control-openhands browser reload`; `control-openhands browser count 'testid=meta-profile-row-QA_router_flash'` is `0`.+- **Delete the active router (`F12.delete-active`).** With `QA_router` active and the switch on, delete it the same way (`wait-text 'Meta-profile "QA_router" deleted'`). After a reload `testid=meta-profile-empty` is back, the switch `eval` is `{checked:false, disabled:true}` and `api GET /api/meta-profiles` has `active_meta_profile` `null`, while `api GET /api/settings` still has `"run_router_at_conversation_start": true`. A new `conversation start --prompt "Reply with only the word pong." --wait` has neither `"route_task_to_model"` nor `ROUTE_AT_CONVERSATION_START` in its events/search output.+- **Light theme (`F12.light-theme`).** No router is left after `F12.delete-active`, whose last `conversation start` left the browser on a conversation: run `control-openhands browser goto /settings/meta-llm` and create one through Custom as in `F12.phone` (name `QA_router_light`, classifier `deepseek-flash`, prompt `'Pick one model for: {{ instance_text }}'`, `wait-text 'Meta-profile "QA_router_light" saved'`), then `control-openhands browser goto /settings/app`, `control-openhands browser click 'testid=color-theme-input'`, `control-openhands browser click 'role=option[name="Light+"]'`, `control-openhands browser goto /settings/meta-llm` and `control-openhands browser eval "(()=>{const h=[...document.querySelectorAll('h2')].find(e=>e.textContent.includes('Available meta-profiles'));const n=document.querySelector('[data-testid^=meta-profile-row-] span');return {heading:getComputedStyle(h).color,rowName:getComputedStyle(n).color,bg:getComputedStyle(document.body).backgroundColor}})()"`. It returns `{heading: "rgb(31, 31, 31)", rowName: "rgb(31, 31, 31)", bg: "rgb(255, 255, 255)"}`: dark text, the same ink as LLM profile names on `/settings/llm`. `control-openhands browser screenshot --feature F12.light-theme --name list` shows the heading `Available meta-profiles` and the name `QA_router_light` next to its summary and Active badge. Restore with `role=option[name="OpenHands-Neutral"]` the same way, then delete `QA_router_light` through its row menu (`wait-text 'Meta-profile "QA_router_light" deleted'`) so `F12.phone` starts on a router-less page.+- **Phone (`F12.phone`, also re-proves `F12.create-first` on a router-less page).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/meta-llm`, `control-openhands browser click 'testid=add-meta-profile'` and `control-openhands browser bbox 'testid=meta-profile-template-modal'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`). Choose Custom, fill `QA_router_phone`, classifier `deepseek-flash` and prompt `'Pick one model for: {{ instance_text }}'`; `control-openhands browser bbox 'testid=meta-profile-editor'` has no page overflow (taller than the screen, scrolls). Save, reload, then `control-openhands browser bbox 'testid=meta-profile-row-QA_router_phone'` and, after `control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router_phone'`, `control-openhands browser bbox 'testid=meta-profile-actions-menu'` are inside the viewport without page overflow. `control-openhands browser screenshot --feature F12.phone --name list` shows `QA_route…` truncated, the summary, the badge and the switch on. Return with `control-openhands browser viewport desktop`.+- **Restart persistence (`F12.list`).** Run `control-openhands restart`, `control-openhands doctor`, `control-openhands browser goto /settings/meta-llm` and `control-openhands browser count 'testid=meta-profile-row-QA_router_phone >> testid=meta-profile-active-badge'`; it is `1`.+- **Cleanup.** Switch **Run on first message** off through its label first (it disables once no router is left), then delete each `QA_*` router through the row menu. Remove the arranged LLM profile and connection with `control-openhands api DELETE /api/profiles/deepseek-chat --write` and `control-openhands api DELETE /api/llm/provider-connections/<connection id> --write` (`<connection id>` from `control-openhands api GET /api/llm/provider-connections`), or through Settings → LLM (F10).++## Gotchas++- Settings nav test ids embed the route: quote `'testid=sidebar-settings-/settings/meta-llm'` as written.+- The empty-state hint about LLM profiles only exists before any profile is saved: drive `F12.empty-states` first on a fresh run.+- The first router you create is activated and turns **Run on first message** on by itself; later routers do neither. Any recipe that creates a router on an empty list changes both.+- `Run on first message` is a hidden `<input>` (#17900): click the label text inside `testid=meta-profile-run-at-conversation-start` and read `.checked`/`.disabled` with `browser eval`. The stored preference (`misc_settings.app_preferences.run_router_at_conversation_start`) is independent of what the disabled switch shows; with no active router it may still be `true`. Turn it off before deleting the last router, or a later "first router" will not re-enable it because it is already on.+- Router templates name 11 models (`gpt-5.4` … `claude-sonnet-4-5`) that will not exist in a sandbox. With a provider connection present, a template preselects it, and saving creates all 11 as LLM profiles linked to that connection unless you pick **Don't create profiles** first (`F12.create-more` does). If a run created them, remove them with `for p in gpt-5.4 gpt-5.5 minimax-m3 claude-opus-4-6 claude-opus-4-7 claude-opus-4-8 claude-fable-5 kimi-k2.5 kimi-k2.6 deepseek-v3.2-reasoner claude-sonnet-4-5; do control-openhands api DELETE /api/profiles/$p --write; done` (they live in the run's private state and only add rows to Settings → LLM).+- Profile matching is case-insensitive and exact by name: table rows are `- <profile name>: description`; existing `deepseek-flash`/`deepseek-pro` are not re-created, and the endpoint is derived as `<provider lowercased>/<name>`.+- The classifier and the model table refer to LLM *profile names*, not model ids. A router whose classifier profile does not exist (for example a template's `minimax-m3` without a connection) saves fine and only fails when a conversation tries to route.+- The agent decides whether to call `route_task_to_model`: a prompt that conflicts with routing (`Reply with only the word pong.`) made deepseek-flash skip the call even with the instruction present. Use a task-like prompt for the positive check and assert the system prompt via `events/search` for the instruction itself.+- `conversation events` does not print the system prompt; read it with `control-openhands api GET "/api/conversations/<id>/events/search?limit=1" --max-bytes 200000` and grep the output.+- `service stop agent-server` does not show this page's error state: the whole app switches to the Manage backends card (F02). Run `control-openhands restart` afterwards.+- The selection in the classifier and connection pickers is a combobox: open it with a click on the input, then click `role=option[name="..."]`; `browser fill` on the classifier sets a free-text value (allowed) instead of picking a profile.+- At 390 px the row truncates the name (`QA_route…`) and summary; read names with `browser text`, not the screenshot.+- The Model table placeholder showed a literal `\n` on one line until #18035 (closed #17939); a checkout without that fix still does (`F12.template-custom`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F13-agent-profiles.md b/.agents/skills/verify-openhands/references/feature-map/F13-agent-profiles.mdnew file mode 100644index 0000000000..cc324f9cfb--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F13-agent-profiles.md@@ -0,0 +1,91 @@+# F13 — Agent profiles++Settings → Agent is a library of named agent profiles. Each profile is either an+OpenHands agent (an LLM profile plus sub-agents, the LLM-switch tool, parallel+tool calls, and MCP-server and secret scopes) or an ACP external agent (a preset+such as Claude Code, Codex or Gemini CLI, its launch command, a model and+provider credentials). One profile is active; new conversations started from+Home launch from it.++Source: `src/routes/agent-profiles-settings.tsx`, `src/routes/agent-settings.tsx`, `src/components/features/settings/agent-profiles/`, `src/components/features/settings/acp-credentials-section.tsx`, `src/constants/acp-providers.ts`, `src/hooks/mutation/use-create-conversation.ts`.++## Sub-features++- `F13.list`: under **Available Profiles**, rows (sorted by name) show the profile name, then its LLM profile (OpenHands) or `ACP (external subprocess)`, a **Default** badge on the active profile and a `...` menu (Edit, Set as active, Delete).+- `F13.create`: **Add agent profile** opens the editor; Save toasts `Profile "<name>" created` and the row is listed after a reload.+- `F13.name-validation`: an empty or malformed name marks the field invalid (red rule) and disables Save; a duplicate name disables Save without a message.+- `F13.editor-no-llm`: with no LLM profiles, an OpenHands profile shows `Create an LLM profile first to define an OpenHands agent.` and Save toasts `Select an LLM profile for this agent.` without creating anything.+- `F13.openhands-options`: OpenHands profiles offer an LLM profile dropdown, **Enable sub-agents** (off by default), **Let the agent switch LLM profiles** (on by default) and **Parallel tool calls** (default 1, minimum 1); values persist and reopen.+- `F13.edit`: Edit reopens the stored values with Save disabled until something changes; renaming keeps the profile id; Back and Cancel leave without saving.+- `F13.stale-llm-ref`: editing a profile whose LLM profile no longer exists preselects the active LLM profile and enables Save, so saving heals the reference.+- `F13.set-active`: **Set as active** toasts `Switched to profile "<name>"`, moves the Default badge and is disabled on the active row.+- `F13.active-drives-conversation`: a conversation started from Home after activation launches from that profile (its id and settings are stamped on the conversation).+- `F13.llm-pill-precedence`: when the active profile pins a different LLM profile than the Home LLM pill, the launch uses the pill's model and not the profile's other settings (by design).+- `F13.mcp-scope`: **MCP servers** offers **All servers** (every configured server listed, switched on and disabled) or **Choose servers** (a switch per configured server); the choice persists; a chosen server that was removed stays listed with a red warning, and launching with it is refused.+- `F13.secrets-scope`: **Secrets** offers **No profile restriction** (every switch on and disabled) or **Choose secrets**; on an ACP profile, Choose preselects that provider's secret names; the selection persists.+- `F13.acp-form`: choosing **ACP (external subprocess)** shows Preset, Command and Model; each preset prefills its command and model, **Custom** empties the command and disables Save until one is typed, typing a preset's exact command selects that preset, and the Model list's **Custom** opens a free-text model field.+- `F13.acp-credentials`: built-in presets show a Credentials section (password fields), an auth banner (signed in / configured), a conflict warning for mutually exclusive Claude credentials, and `Already saved — leave blank to keep` for stored values. Credentials are saved as global secrets.+- `F13.acp-preset-credentials`: the Credentials fields follow the preset: Claude Code `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL`; Codex `OPENAI_API_KEY`, `CODEX_AUTH_JSON` (multi-line), `OPENAI_BASE_URL`; Gemini CLI `GOOGLE_APPLICATION_CREDENTIALS_JSON` (multi-line), `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION`, `GOOGLE_GENAI_USE_VERTEXAI`, `GEMINI_API_KEY`, `GEMINI_BASE_URL`; **Custom** has no Credentials section. With no host login and no stored credential (Gemini here) no auth banner shows.+- `F13.menu-keyboard`: opening the row's `...` menu focuses Edit; ArrowDown/ArrowUp move focus between the enabled items (wrapping, and skipping the disabled **Set as active** on the active row), Enter runs the focused item, and Tab, Escape or a click outside close the menu.+- `F13.delete`: Delete asks for confirmation; Cancel keeps the row, Delete removes it. Deleting the active profile leaves none active; deleting the last profile makes the server re-seed `default`.+- `F13.phone`: the list, row menu and editor fit a 390 px viewport without horizontal overflow.+- `F13.acp-conversation`: a conversation launched from an active ACP profile runs the external agent. Blocked without an approved provider account.+- `F13.cloud-read-only`: on a Cloud backend, organization members see rows without the `...` menu or **Add agent profile**. Blocked without a Cloud account.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`): on desktop `/settings` redirects to `/settings/agents`. In the settings navigation, **Agent** (`sidebar-settings-/settings/agents`).+- Direct URL `/settings/agents`; the retired `/settings/agent` redirects there.+- Command menu (`Control+k`/`Meta+k` or `command-menu-trigger`): **Agent settings**.+- Getting-started checklist **Customize your agent** and the composer **+** → **Switch agent profile** → **Manage agent profiles** (both mapped in F09/F05).+- On Home, the composer **+** → **Switch agent profile** list activates a profile like **Set as active** (F05.agent-profile-switch).+- All per-profile actions are in the row's `...` menu (`agent-profile-menu-trigger`). The editor has no route: it replaces the list in place.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) on a **fresh** run. `F13.editor-no-llm` must run before `control-openhands llm preset deepseek`; everything from `F13.stale-llm-ref` on needs the preset (`deepseek-flash` active, `deepseek-pro`).+- A fresh run has one profile, `default`, active, whose LLM profile is `default` (which does not exist). `control-openhands api GET /api/agent-profiles` shows it.+- `F13.mcp-scope` needs two configured MCP servers. Arrange them with `control-openhands api POST /api/settings/mcp/qa_mcp_a --data '{"transport":"stdio","command":"qa-no-such-command","enabled":false}' --write` and the same for `qa_mcp_b`.+- `F13.acp-conversation` needs the provider's agent CLI and an approved account; `F13.cloud-read-only` needs a Cloud organization member login. Both are blocked here.+- Dropdowns are autocompletes. Pick an option with `control-openhands browser choose 'testid=<testid>' '<label>'` (proven on `agent-type-selector`, `agent-preset-selector`, `agent-model-selector` (`Custom`), `agent-profile-llm-selector`, `agent-settings-mcp-mode` and `agent-settings-secrets-mode`). The manual opener, `control-openhands browser click 'div:has(> div > input[data-testid=<testid>]) >> role=button[name="Show suggestions"]'` then `browser click 'role=option[name="<label>"]'`, works for most of them but is flaky right after an editor opens (see Gotchas); clicking the input itself can open an empty, filtered list.++- **List (`F13.list`).** From `/` run `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings'`, then `control-openhands browser url` (`/settings/agents`) and `control-openhands browser text 'testid=agent-profile-row'`: `default`, its LLM profile `default`, `Default` on three lines. `control-openhands browser count 'testid=agent-profile-active-badge'` is `1`; `control-openhands browser screenshot --feature F13.list --name list`. Command menu: run `control-openhands browser goto /` (the browser is on `/settings/agents`, where the URL wait would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' 'Agent settings'`, `control-openhands browser press Enter`, `control-openhands browser wait-url '/settings/agents(\?|$)'`. Legacy URL: `control-openhands browser goto /settings/agent` returns `.../settings/agents`.+- **No LLM profile (`F13.editor-no-llm`).** Before the preset, run `control-openhands browser click 'testid=add-agent-profile'`, then `control-openhands browser text 'testid=agent-profile-no-llm'`: `Create an LLM profile first to define an OpenHands agent.` `control-openhands browser text 'testid=agent-profile-editor-title'` is `Add agent profile` and `control-openhands browser text 'testid=agent-profile-editor-description'` is `Configure the agent below, then click Save to create this profile.` (agent copy, not the LLM page's hint, since #18035). Run `control-openhands browser fill 'testid=agent-profile-name-input' QA_NoLlm`; Save turns enabled (`control-openhands browser enabled 'testid=save-agent-profile-btn'`). Click `testid=save-agent-profile-btn` and run `control-openhands browser toasts`: `Select an LLM profile for this agent.` `api GET /api/agent-profiles` lists no `QA_NoLlm`. Leave with `control-openhands browser click 'testid=cancel-agent-profile-btn'`.+- **Name rules (`F13.name-validation`).** In the Add editor, fill `testid=agent-profile-name-input` with `''`, `default`, `'bad name!'` and `QA_ok` in turn; after each run `control-openhands browser attr 'testid=agent-profile-name-input' aria-invalid` and `control-openhands browser enabled 'testid=save-agent-profile-btn'`. Results: `''` → `true`/`false`; `default` (duplicate) → `false`/`false`, and nothing explains why; `'bad name!'` → `true`/`false`; `QA_ok` → `false`/`true`. The rule under the field is always shown (grey) and turns red (`text-red-400`) while the name is invalid; it reads `Profile name must start with a letter or digit, and contain only letters, digits, dots, underscores, or hyphens (max 64 characters)`. Take `control-openhands browser screenshot --feature F13.name-validation --name duplicate` with `default` filled.+- **ACP form (`F13.acp-form`).** In the Add editor run `control-openhands browser click 'testid=agent-type-selector'` and `control-openhands browser click 'role=option[name="ACP (external subprocess)"]'`. `control-openhands browser value 'testid=agent-preset-selector'` is `Claude Code`, `browser value 'testid=agent-command-input'` is `npx -y --prefer-offline @agentclientprotocol/[email protected]` and `browser value 'testid=agent-model-selector'` is `Claude Opus (1M)`; `agent-profile-no-llm` is gone (ACP needs no LLM profile). Pick `Codex` and `Gemini CLI` from `testid=agent-preset-selector`: the command becomes `npx -y --prefer-offline @agentclientprotocol/[email protected]` / `npx -y --prefer-offline @google/[email protected] --acp` and the model `GPT-5.5` / `Gemini 2.5 Pro`. Pick `Custom`: the command is empty and Save is disabled. `control-openhands browser fill 'testid=agent-command-input' 'npx -y qa-custom-acp --stdio'` enables Save. Filling the exact Codex command flips the preset to `Codex`; appending ` --verbose` flips it back to `Custom`. Model override: with a built-in preset, run `control-openhands browser choose 'testid=agent-model-selector' 'Custom'` (or open the model list with its toggle button and `control-openhands browser click 'role=option[name="Custom"][exact]'`); `control-openhands browser count 'testid=agent-model-input'` is `1` and empty. The **Custom** preset shows `agent-model-input` directly (no model list).+- **Create an ACP profile (`F13.create`).** With preset `Custom`, fill `testid=agent-profile-name-input` with `QA_acp_custom`, `testid=agent-command-input` with `'npx -y qa-custom-acp --stdio'` and `testid=agent-model-input` with `qa-model`, click `testid=save-agent-profile-btn`, then `control-openhands browser wait-text 'Profile "QA_acp_custom" created' --timeout 10000`, `control-openhands browser reload` and `control-openhands browser text 'testid=agent-profile-row >> has-text=QA_acp_custom'`: `QA_acp_custom` / `ACP (external subprocess)`. `control-openhands api GET /api/agent-profiles/QA_acp_custom` shows `acp_server` `custom`, the command and `acp_model` `qa-model`.+- **Edit and rename (`F13.edit`).** Run `control-openhands browser click 'testid=agent-profile-row >> has-text=QA_acp_custom >> testid=agent-profile-menu-trigger'`; `control-openhands browser snapshot 'testid=agent-profile-actions-menu'` lists `Edit`, `Set as active`, `Delete`. Click `testid=agent-profile-edit`: the title is `Edit agent profile`, the description `Editing profile "QA_acp_custom" - save to apply changes`, the type/preset/command/model values are the stored ones, and Save is disabled. Note the `id` from `api GET /api/agent-profiles`, fill the name with `QA_acp_renamed`, click Save, `control-openhands browser wait-text 'Profile "QA_acp_renamed" updated' --timeout 10000` and `browser reload`: `browser count 'testid=agent-profile-row >> has-text=QA_acp_custom'` is `0`, the renamed row is `1` and `api GET /api/agent-profiles` shows the same id under the new name. Back/Cancel: open any editor, change a field, click `testid=back-to-agent-profiles` (or `testid=cancel-agent-profile-btn`); `browser count 'testid=add-agent-profile'` is `1` and the API is unchanged.+- **Credentials (`F13.acp-credentials`).** In a new ACP editor with preset `Claude Code`, `control-openhands browser testids --hidden --filter acp` lists `settings-acp-secret-CLAUDE_CODE_OAUTH_TOKEN`, `-ANTHROPIC_API_KEY`, `-ANTHROPIC_BASE_URL` and one banner (`settings-acp-auth-detected` when the agent-server machine has a Claude CLI login, as this sandbox does: `You're already signed in to Claude Code — you can leave the fields below blank.`). `control-openhands browser attr 'testid=settings-acp-secret-ANTHROPIC_API_KEY' type` is `password`. Fill `settings-acp-secret-CLAUDE_CODE_OAUTH_TOKEN` with `qa-dummy-oauth` and `settings-acp-secret-ANTHROPIC_API_KEY` with `qa-dummy-key`; `control-openhands browser text 'testid=acp-credential-conflict-warning'` is `Setting ANTHROPIC_API_KEY alongside CLAUDE_CODE_OAUTH_TOKEN breaks its authentication — leave one of them blank.` (screenshot `--feature F13.acp-credentials --name conflict` after `browser scroll 'testid=acp-credential-conflict-warning'`). Cancel; `api GET /api/settings/secrets` gains nothing. Saved credential: new profile `QA_codex`, ACP, preset `Codex`, fill `testid=settings-acp-secret-OPENAI_API_KEY` with `qa-dummy-openai`, Save (`Profile "QA_codex" created`); `api GET /api/settings/secrets` now lists `OPENAI_API_KEY` and the profile has `acp_server` `codex`, `acp_command` `null`, `acp_model` `gpt-5.5`. Reopen it: `control-openhands browser testids --hidden --filter settings-acp-auth` shows `settings-acp-auth-configured` (`Credentials for Codex are configured — you can leave the fields below blank.`) and `control-openhands browser attr 'testid=settings-acp-secret-OPENAI_API_KEY' placeholder` is `Already saved — leave blank to keep` with an empty value.+- **Secrets scope (`F13.secrets-scope`).** In the `QA_codex` editor, `control-openhands browser eval "[...document.querySelectorAll('[data-testid=agent-settings-secret-list] input')].map(i=>i.closest('li').innerText.split('\n')[0]+'='+i.checked+(i.disabled?'(disabled)':''))"` shows every name `=true(disabled)` under `No profile restriction`. Open `testid=agent-settings-secrets-mode`, `control-openhands browser click 'role=option[name="Choose secrets"]'` and rerun the eval: `OPENHANDS_AUTOMATION_API_KEY=false`, `OPENAI_API_KEY=true`, `CODEX_AUTH_JSON=true`, `OPENAI_BASE_URL=true`. Save (`Profile "QA_codex" updated`); `api GET /api/agent-profiles/QA_codex` has those three in `secret_refs`, and after `browser reload` and Edit the mode and switches are the same. On an OpenHands profile, Choose starts with nothing selected; a switch toggles by its name: in the Add editor pick `Choose secrets`, then `control-openhands browser click 'testid=agent-settings-secret-list >> text=OPENHANDS_AUTOMATION_API_KEY'` turns `document.querySelector('[data-testid=agent-settings-secret-OPENHANDS_AUTOMATION_API_KEY]').checked` from `false` to `true`.+- **Stale LLM reference (`F13.stale-llm-ref`).** After `control-openhands llm preset deepseek`, run `control-openhands browser reload`, open `testid=agent-profile-row >> has-text=default >> testid=agent-profile-menu-trigger` → `testid=agent-profile-edit`, `control-openhands browser wait 'testid=agent-profile-llm-selector'`. `browser value 'testid=agent-profile-llm-selector'` is `deepseek-flash (deepseek/deepseek-flash)` and Save is enabled although nothing was touched. Save (`Profile "default" updated`), `browser reload`: the row reads `default` / `deepseek-flash` / `Default` and `api GET /api/agent-profiles/default` has `llm_profile_ref` `deepseek-flash` with the same id. Screenshot `--feature F13.stale-llm-ref --name fallback` before saving.+- **OpenHands options (`F13.openhands-options`, `F13.create`).** Click `testid=add-agent-profile`, fill the name `QA_oh`. Defaults: `browser value 'testid=agent-profile-llm-selector'` is the active LLM profile, `control-openhands browser eval "document.querySelector('[data-testid=agent-settings-enable-sub-agents]').checked"` is `false`, the same for `agent-settings-enable-switch-llm-tool` is `true`, `browser value 'testid=sdk-settings-tool_concurrency_limit'` is `1`. Click `'testid=agent-settings-screen >> text=Enable sub-agents'` and `'testid=agent-settings-screen >> text=Let the agent switch LLM profiles'` (the checks flip). Fill `testid=sdk-settings-tool_concurrency_limit` with `0` and click Save: `browser toasts` shows `Parallel tool calls must be at least 1` and `browser eval "document.querySelector('[data-testid=sdk-settings-tool_concurrency_limit]').validationMessage"` is `Value must be greater than or equal to 1.` Fill `2`, `control-openhands browser choose 'testid=agent-profile-llm-selector' 'deepseek-pro (deepseek/deepseek-v4-pro)'`, Save (`Profile "QA_oh" created`), `browser reload`: the row reads `QA_oh` / `deepseek-pro`, and `api GET /api/agent-profiles/QA_oh` has `llm_profile_ref` `deepseek-pro`, `enable_sub_agents` `true`, `enable_switch_llm_tool` `false`, `tool_concurrency_limit` `2`. Reopening shows the same values with Save disabled.+- **Set as active (`F13.set-active`).** Run `control-openhands browser click 'testid=agent-profile-row >> has-text=QA_oh >> testid=agent-profile-menu-trigger'`, `control-openhands browser click 'testid=agent-profile-set-active'` and `control-openhands browser wait-text 'Switched to profile "QA_oh"' --timeout 10000`. After `browser reload`, `browser count 'testid=agent-profile-row >> has-text=QA_oh >> testid=agent-profile-active-badge'` and `browser count 'testid=agent-profile-active-badge'` are both `1`. Reopen the QA_oh menu: `browser enabled 'testid=agent-profile-set-active'` is `false` (screenshot `--feature F13.set-active --name menu`); `control-openhands browser press Escape` closes it (`browser count 'testid=agent-profile-actions-menu'` is `0`).+- **Pill wins over a pinned LLM (`F13.llm-pill-precedence`).** With `QA_oh` active (pinned to `deepseek-pro`) and the Home pill on `deepseek-flash` (`browser text 'testid=chat-input-llm-profile'` on `/`), run `control-openhands conversation start --prompt "Reply with only: qa-profile-ok" --wait --timeout 240`. The output's `model` is `deepseek/deepseek-flash`, and `control-openhands api GET /api/conversations/<id>` (id from that output) has `"launched_agent_profile": null` and `tool_concurrency_limit` `1`: the profile was not applied.+- **Active profile drives the launch (`F13.active-drives-conversation`).** Run `control-openhands browser goto /settings/agents` (the previous `conversation start` left the browser on the conversation), edit `QA_oh`, run `control-openhands browser choose 'testid=agent-profile-llm-selector' 'deepseek-flash (deepseek/deepseek-flash)'` (the toggle-button opener failed 5 of 5 times here: see Gotchas), check `browser value 'testid=agent-profile-llm-selector'`, Save (`Profile "QA_oh" updated`). Run the same `conversation start` again; `api GET /api/conversations/<id>` now has `launched_agent_profile.agent_profile_id` equal to QA_oh's id from `api GET /api/agent-profiles` and `tool_concurrency_limit` `2`; `control-openhands conversation events <id> --kinds MessageEvent` contains `qa-profile-ok`.+- **MCP scope (`F13.mcp-scope`).** With `qa_mcp_a` and `qa_mcp_b` arranged, `browser goto /settings/agents`, Edit `QA_oh`: `browser value 'testid=agent-settings-mcp-mode'` is `All servers` and the eval below (with `+(i.disabled?'(disabled)':'')` appended) shows both `=true(disabled)`. Pick `Choose servers` from `testid=agent-settings-mcp-mode`; `control-openhands browser eval "[...document.querySelectorAll('[data-testid=agent-settings-mcp-list] input')].map(i=>i.dataset.testid+'='+i.checked)"` shows both `=true`. Run `control-openhands browser click 'testid=agent-settings-mcp-list >> text=qa_mcp_b'` (now `false`), Save; `api GET /api/agent-profiles/QA_oh` has `mcp_server_refs` `["qa_mcp_a"]`. Dangling: arrange `control-openhands api DELETE /api/settings/mcp/qa_mcp_a --write`, `browser reload`, Edit `QA_oh`: `control-openhands browser text 'testid=agent-settings-mcp-dangling'` is `qa_mcp_a is no longer configured. Saving with it selected will stop this agent from starting — clear it or re-add the server.` (screenshot `--feature F13.mcp-scope --name dangling`). Leave without saving, `browser goto /`, `browser reload`, `control-openhands browser fill 'testid=chat-input' 'Reply with only: qa-dangling'`, `control-openhands browser click 'testid=submit-button'` and `control-openhands browser toasts`: the launch is refused (`POST /api/conversations` 422 in `browser errors --app-only`) with `MCP server ref(s) not present in the user's MCP config: 'qa_mcp_a'` in the toast. Clear it: `control-openhands browser goto /settings/agents`, Edit `QA_oh`, `browser click 'testid=agent-settings-mcp-list >> text=qa_mcp_a'` (the warning count drops to `0`), pick `All servers`, Save; `mcp_server_refs` is `null`.+- **Credential fields per preset (`F13.acp-preset-credentials`).** In the Add editor, `control-openhands browser choose 'testid=agent-type-selector' 'ACP (external subprocess)'`, then for each of `Codex`, `Gemini CLI` and `Custom` run `control-openhands browser choose 'testid=agent-preset-selector' '<preset>'` and `control-openhands browser testids --hidden --filter settings-acp`: Codex lists `settings-acp-secret-OPENAI_API_KEY` (input), `-CODEX_AUTH_JSON` (textarea), `-OPENAI_BASE_URL`; Gemini CLI lists `-GOOGLE_APPLICATION_CREDENTIALS_JSON` (textarea), `-GOOGLE_CLOUD_PROJECT`, `-GOOGLE_CLOUD_LOCATION`, `-GOOGLE_GENAI_USE_VERTEXAI`, `-GEMINI_API_KEY`, `-GEMINI_BASE_URL`; Custom lists nothing and `browser eval "document.body.innerText.includes('Credentials')"` is `false`. For Gemini, `control-openhands browser wait 'testid=settings-acp-auth-checking' --state detached --timeout 15000`, then `browser testids --hidden --filter settings-acp-auth` has count `0` (no login, no stored credential); `browser eval "document.querySelector('[data-testid=settings-acp-secret-GEMINI_API_KEY]').type"` is `password`, `GOOGLE_CLOUD_PROJECT` is `text`. Screenshot `--feature F13.acp-preset-credentials --name gemini` after `browser scroll 'testid=settings-acp-secret-GOOGLE_APPLICATION_CREDENTIALS_JSON'`. Cancel (Codex shows `settings-acp-auth-configured` instead while `OPENAI_API_KEY` from `F13.acp-credentials` is still saved).+- **Menu keyboard (`F13.menu-keyboard`).** Run `control-openhands browser goto /settings/agents`. It needs a non-active row: run `control-openhands browser click 'testid=add-agent-profile'`, `control-openhands browser fill 'testid=agent-profile-name-input' QA_kb`, `control-openhands browser click 'testid=save-agent-profile-btn'` and `control-openhands browser wait-text 'Profile "QA_kb" created' --timeout 10000`. Open its menu with `control-openhands browser click 'testid=agent-profile-row >> has-text=QA_kb >> testid=agent-profile-menu-trigger'` and right away run `control-openhands browser eval "document.activeElement?.dataset?.testid"`, then `control-openhands browser press ArrowDown` and the same eval. Expected: `agent-profile-edit`, then `agent-profile-set-active` (opening the menu moves focus to its first item, as the LLM profile menu does in `F10.actions-menu`). Known failure: both evals read `agent-profile-menu-trigger`; focus stays on the trigger and ArrowDown does nothing (#18060). Then run `control-openhands browser focus 'testid=agent-profile-edit'`, and `control-openhands browser press ArrowDown` followed by that eval four times: `agent-profile-set-active`, `agent-profile-delete`, `agent-profile-edit`, `agent-profile-set-active`; `browser press ArrowUp` returns to `agent-profile-edit`. `control-openhands browser press Escape` closes the menu (`control-openhands browser count 'testid=agent-profile-actions-menu'` is `0`); reopen it, run `control-openhands browser focus 'testid=agent-profile-delete'` and `control-openhands browser press Tab`: closed; reopen it and run `control-openhands browser mouse-click 900 600`: closed. Active row: open its menu with `control-openhands browser click '[data-testid=agent-profile-row]:has([data-testid=agent-profile-active-badge]) >> testid=agent-profile-menu-trigger'` (`control-openhands browser snapshot 'testid=agent-profile-actions-menu'` shows `menuitem "Set as active" [disabled]`), run `control-openhands browser focus 'testid=agent-profile-edit'`, then `control-openhands browser press ArrowDown` and the eval, then `control-openhands browser press ArrowUp` and the eval. Expected: `agent-profile-delete` (the disabled **Set as active** is skipped), then `agent-profile-edit`. Known failure: `agent-profile-edit` (ArrowDown tries to focus the disabled item, which cannot take focus), then `agent-profile-delete` (ArrowUp wraps) (#18060). With the menu still open, run `control-openhands browser focus 'testid=agent-profile-edit'` and `control-openhands browser press Enter`: `control-openhands browser text 'testid=agent-profile-editor-title'` is `Edit agent profile`. Leave the editor with `control-openhands browser click 'testid=cancel-agent-profile-btn'` (`browser count 'testid=add-agent-profile'` is `1`). Delete `QA_kb`: reopen its menu, `control-openhands browser click 'testid=agent-profile-delete'`, `control-openhands browser click 'testid=delete-agent-profile-confirm'` and `control-openhands browser wait-text 'Profile "QA_kb" deleted' --timeout 10000`.+- **Delete (`F13.delete`).** Run `control-openhands browser click 'testid=agent-profile-row >> has-text=QA_acp_renamed >> testid=agent-profile-menu-trigger'`, `control-openhands browser click 'testid=agent-profile-delete'`; `control-openhands browser text 'role=dialog'` reads `Delete Profile` and `Are you sure you want to delete the profile "QA_acp_renamed"? This action cannot be undone.` `control-openhands browser click 'role=dialog >> role=button[name="Cancel"]'` keeps the row (count `1`). Repeat and `control-openhands browser click 'testid=delete-agent-profile-confirm'`, `browser wait-text 'Profile "QA_acp_renamed" deleted' --timeout 10000`, `browser reload`: count `0`. Delete the active `QA_oh` the same way: after `browser reload`, `browser count 'testid=agent-profile-active-badge'` is `0` and `api GET /api/agent-profiles` has `active_agent_profile_id` `null`. Delete `QA_codex` and `default`: the list again shows one row, `default` / `deepseek-flash` / `Default`, with a new id (the server re-seeds it).+- **Phone (`F13.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/agents`, `control-openhands browser bbox 'testid=agent-profile-row'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `browser screenshot --feature F13.phone --name list`. Open the row menu: `browser bbox 'testid=agent-profile-actions-menu'` is inside the viewport. `browser press Escape`, click `testid=add-agent-profile`: `browser bbox 'testid=agent-settings-screen'` is 348 px wide at x 16 with no page overflow (`insideViewport` is `false` only because the form is taller than the screen). Switch to ACP, `browser scroll 'testid=settings-acp-secret-ANTHROPIC_API_KEY'` and screenshot `--name acp-credentials`. Cancel and `control-openhands browser viewport desktop`.+- **Errors.** After the family, `control-openhands browser errors --app-only` shows no page errors and no `[i18n] Missing translation` warnings (the Parallel tool calls label and description are translated since #18035), only the deliberate 422s from the dangling-MCP launch.+- **Blocked (`F13.acp-conversation`, `F13.cloud-read-only`).** Record `control-openhands evidence add --feature F13.acp-conversation --result blocked ...` naming the missing provider CLI/account, and the same for `F13.cloud-read-only` naming the Cloud member login.+- **Cleanup.** Delete the `OPENAI_API_KEY` credential through Secrets: `control-openhands browser goto /settings/secrets`, `control-openhands browser click 'testid=secret-item >> has-text=OPENAI_API_KEY >> testid=delete-secret-button'`, `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`. Remove `qa_mcp_b` with `control-openhands api DELETE /api/settings/mcp/qa_mcp_b --write`. Leave `default` active.++## Gotchas++- The editor is not a route: `browser url` stays `/settings/agents` and `browser reload` drops unsaved edits back to the list. The settings page header (`settings-page-subtitle`) is hidden while it is open.+- Autocomplete dropdowns: clicking an input that already shows a value can open an empty listbox (the text filters it), and an option click then times out. The toggle-button opener does not always open the list either: on the Edit editor's `agent-profile-llm-selector` (bottom of the form) the option click timed out 5 of 5 times right after opening the editor, and the model list's `Custom` option once detached mid-click after a preset change. `browser choose` was reliable on every dropdown. A listbox also closes if you spend a command (snapshot, eval) in between, so click the option right after opening.+- `Save` is disabled for a duplicate name with no message and no red rule (`aria-invalid` stays `false`) (#17938); check the name before suspecting the form.+- Switch rows are `<input>`s inside labels (#17900): click the label text (`'testid=agent-settings-screen >> text=Enable sub-agents'`, `'testid=agent-settings-mcp-list >> text=<name>'`) and read `.checked` with `browser eval`. A bare `label` selector segment is parsed as `label=`, not CSS.+- The Default badge, the **Set as active** item and the `Switched to profile` toast all refer to the same active pointer; the wording differs from the LLM page (**Set as default**).+- The OpenHands row's grey text is the LLM profile name, not the kind. A fresh run's `default` shows `default` there although no LLM profile of that name exists until it is edited (`F13.stale-llm-ref`).+- Home launches follow the LLM pill: a named profile pinned to another LLM profile launches through the legacy settings path, so its sub-agent, concurrency and MCP settings do not apply (`F13.llm-pill-precedence`). To prove a profile's settings, pin it to the active LLM profile, and read `launched_agent_profile` on the conversation.+- The ACP auth probe runs the provider CLI on the agent-server machine. On this sandbox the host's Claude CLI is logged in, so Claude Code shows "already signed in". Never launch an ACP conversation on that login.+- ACP credentials are global secrets, not profile fields: cancelling the editor saves nothing, but saving any ACP profile with a typed credential writes it to Settings → Secrets (F14) for every conversation.+- **Choose secrets** on an ACP profile also selects provider secret names that are not saved (`CODEX_AUTH_JSON`, `OPENAI_BASE_URL`); they show as switches without descriptions.+- The empty state (`agent-profiles-empty`) and the load-error state (`agent-profiles-load-error`) are not reachable on a local backend: deleting the last profile re-seeds `default`, and with the agent-server stopped the app swaps to **Manage backends** after a reload, or keeps the cached list without one.+- A launch refused for a dangling MCP ref shows two identical raw-JSON toasts for one submit and clears the composer, so the typed prompt is lost (reported as a product bug; see the evidence under `F13.mcp-scope`) (#17936).+- Row-menu keyboard: on the active row, ArrowDown from **Edit** keeps focus on Edit because the handler moves focus to the next item without skipping the disabled **Set as active**, and a disabled button cannot take focus; reach **Delete** with ArrowUp. Opening the menu also leaves focus on the trigger (`F13.menu-keyboard`, an accessibility bug). Both are open as #18060. The LLM profile menu on Settings → LLM had the same defects: #18019 fixed only that menu (`F10.actions-menu`) and closed #17934, so #17934 being closed says nothing about this menu.+- #18035 (closed #17939) gave the Add editor its own description and translated the Parallel tool calls field. A checkout without it shows the LLM page's `Configure your LLM settings below, then click Save to create this profile.` and logs `[i18n] Missing translation for key "SCHEMA$TOOL_CONCURRENCY_LIMIT$LABEL"` / `$DESCRIPTION` whenever the editor renders.diff --git a/.agents/skills/verify-openhands/references/feature-map/F14-secrets.md b/.agents/skills/verify-openhands/references/feature-map/F14-secrets.mdnew file mode 100644index 0000000000..62a06b4d52--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F14-secrets.md@@ -0,0 +1,64 @@+# F14 — Secrets++Secrets are named values the agent can use during conversations. A user lists,+adds, edits and deletes them under Settings → Secrets; saved values are never+shown again, and every new conversation receives them as environment variables.++Source: `src/routes/secrets-settings.tsx`, `src/components/features/settings/secrets-settings/`, `src/api/secrets-service.ts`.++## Sub-features++- `F14.list`: the Secrets page lists each secret's name and description with Edit and Delete actions; the launcher-seeded `OPENHANDS_AUTOMATION_API_KEY` is always present.+- `F14.create`: adding a secret persists it; it is listed after a reload.+- `F14.create-validation`: duplicate names, names that break `^[a-zA-Z][a-zA-Z0-9_]{0,63}$` and empty values are refused with a message.+- `F14.edit`: editing the description with the value left blank keeps the stored value; Save stays disabled until something changes.+- `F14.delete`: deleting asks for confirmation; Cancel keeps the row, Confirm removes it for good.+- `F14.agent-access`: a conversation started after the secret was saved sees it as an environment variable.+- `F14.phone`: the page and its forms fit a 390 px viewport without horizontal overflow.+- `F14.form-back`: the Add and Edit forms replace the list with an **Add a Secret** / **Edit a Secret** title and a **Back** button; Back (like Cancel) returns to the list and discards the draft.+- `F14.rename`: the Edit form's name is editable; renaming with the value left blank keeps the stored value under the new name, and renaming onto an existing name is refused with `Secret already exists`.+- `F14.edit-value`: typing a value in the Edit form (labelled "Secret Value (leave blank to preserve the existing value)") replaces the stored value for new conversations.+- `F14.delete-escape`: Escape closes the delete confirmation without deleting.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`), then **Secrets** in the settings navigation (`sidebar-settings-/settings/secrets`).+- Direct URL `/settings/secrets`.+- Command menu (`Control+k` or `Meta+k`, or `command-menu-trigger` in the sidebar): search "Secrets", choose **Secrets settings**.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done).+- No secret named `QA_TMP_SECRET`, `QA_AGENT_SECRET`, `QA_RENAMED_SECRET` or `QA_BACK_SECRET` exists (`control-openhands api GET /api/settings/secrets`).+- `F14.agent-access`, `F14.rename` and `F14.edit-value` need an active LLM profile (`control-openhands llm preset deepseek`).++- **Open the list (`F14.list`).** Navigate from the sidebar. Run `control-openhands browser click 'testid=backend-selector-settings-link'`, `control-openhands browser click 'testid=sidebar-settings-/settings/secrets'`, then `control-openhands browser count 'testid=secret-item >> has-text=OPENHANDS_AUTOMATION_API_KEY'`. The count is `1` and the URL is `/settings/secrets`.+- **Command-menu entry (`F14.list`).** Run `control-openhands browser goto /` (the previous bullet left `/settings/secrets`, which would make the URL check pass vacuously), then `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Secrets`, `control-openhands browser press Enter`, then `control-openhands browser url`. The URL ends in `/settings/secrets`.+- **Create (`F14.create`).** Run `control-openhands browser click 'testid=add-secret-button'`, `control-openhands browser fill 'testid=add-secret-form >> testid=name-input' QA_TMP_SECRET`, `control-openhands browser fill 'testid=add-secret-form >> testid=value-input' dummy-value-123`, `control-openhands browser fill 'testid=add-secret-form >> testid=description-input' 'QA dummy'`, `control-openhands browser click 'testid=add-secret-form >> testid=submit-button'`, then `control-openhands browser reload` and `control-openhands browser count 'testid=secret-item >> has-text=QA_TMP_SECRET'`. The count is `1` after the reload.+- **Duplicate name (`F14.create-validation`).** Run `control-openhands browser click 'testid=add-secret-button'`, fill `name-input` with `QA_TMP_SECRET` and `value-input` with `other` as above, click `testid=add-secret-form >> testid=submit-button`, then `control-openhands browser snapshot 'testid=add-secret-form'`. The snapshot shows the paragraph `Secret already exists` and the form stays open.+- **Invalid name (`F14.create-validation`).** In the same form run `control-openhands browser fill 'testid=add-secret-form >> testid=name-input' 'bad name!'`, click submit, then `control-openhands browser eval "document.querySelector('[data-testid=add-secret-form] [data-testid=name-input]').validationMessage"`. The value is the browser's pattern message (`Please match the requested format.` in Chromium) and no secret is created (`api GET /api/settings/secrets`). Close with `control-openhands browser click 'testid=add-secret-form >> testid=cancel-button'`.+- **Empty value (`F14.create-validation`).** Run `control-openhands browser click 'testid=add-secret-button'`, fill `testid=add-secret-form >> testid=name-input` with `QA_EMPTY_VALUE` and leave `value-input` empty. `control-openhands browser enabled 'testid=add-secret-form >> testid=submit-button'` is `false`, and `control-openhands browser eval "document.querySelector('[data-testid=add-secret-form] [data-testid=value-input]').validationMessage"` is `Please fill out this field.` Close with `testid=add-secret-form >> testid=cancel-button`; `api GET /api/settings/secrets` lists no `QA_EMPTY_VALUE`.+- **Edit keeps the value (`F14.edit`).** Run `control-openhands browser click 'testid=secret-item >> has-text=QA_TMP_SECRET >> testid=edit-secret-button'`, `control-openhands browser value 'testid=edit-secret-form >> testid=value-input'` (empty) and `control-openhands browser enabled 'testid=edit-secret-form >> testid=submit-button'` (`false`). Fill `testid=edit-secret-form >> testid=description-input` with `QA dummy edited`; `enabled` turns `true`. Click `testid=edit-secret-form >> testid=submit-button`, `control-openhands browser reload`, then `control-openhands browser text 'testid=secret-item >> has-text=QA_TMP_SECRET'`. The row text is `QA_TMP_SECRET` and `QA dummy edited` separated by a tab (`"QA_TMP_SECRET\tQA dummy edited"` in the JSON output).+- **Delete with confirmation (`F14.delete`).** Run `control-openhands browser click 'testid=secret-item >> has-text=QA_TMP_SECRET >> testid=delete-secret-button'`; the dialog `testid=confirmation-modal` reads `Are you sure you want to delete this key?`. Run `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'`; the row count stays `1`. Repeat the delete click, then `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`, `control-openhands browser reload` and `control-openhands browser count 'testid=secret-item >> has-text=QA_TMP_SECRET'`. The count is `0`.+- **Agent receives the secret (`F14.agent-access`).** Create `QA_AGENT_SECRET` with value `qa-dummy-4821` through the form as in Create. Run `control-openhands conversation start --prompt "Run exactly this command and reply with only its output: python3 -c \"import os; print(os.environ.get('QA_AGENT_SECRET') == 'qa-dummy-4821')\"" --wait --timeout 240`, then `control-openhands conversation events <id> --kinds ObservationEvent`. The terminal observation's text is `True`. Assert the observation, not the agent's reply: deepseek-flash often declines to echo anything about a secret (see Gotchas). Keep `QA_AGENT_SECRET` for Rename and Replace value below; they delete it.+- **Phone layout (`F14.phone`).** Run `control-openhands browser goto /settings/secrets` (`conversation start` left the browser on the conversation), `control-openhands browser viewport phone`, `control-openhands browser bbox 'testid=secrets-settings-screen'` and `control-openhands browser screenshot --feature F14.phone --name list`. `insideViewport` is `true` and `pageHorizontalOverflow` is `false`; the screenshot shows the table with Edit and Delete icons. Then `control-openhands browser click 'testid=add-secret-button'`, `control-openhands browser bbox 'testid=add-secret-form'` (`insideViewport` `true`, no page overflow) and `control-openhands browser screenshot --feature F14.phone --name add-form`; cancel the form. Return with `control-openhands browser viewport desktop`.+- **Back discards the draft (`F14.form-back`).** On `/settings/secrets` run `control-openhands browser click 'testid=add-secret-button'` and `control-openhands browser text 'testid=secret-editor-title'` (`Add a Secret`). Fill `testid=add-secret-form >> testid=name-input` with `QA_BACK_SECRET` and `value-input` with `dummy`, then `control-openhands browser click 'testid=back-to-secrets'`. `control-openhands browser count 'testid=add-secret-form'` is `0`, the list is back (`browser count 'testid=secret-item'` > `0`) and `control-openhands api GET /api/settings/secrets` lists no `QA_BACK_SECRET`. Reopening Add shows an empty `name-input` (`browser value`); leave with `testid=back-to-secrets`. The Edit form shows `Edit a Secret` in the same `secret-editor-title`.+- **Rename keeps the value (`F14.rename`).** Needs `QA_AGENT_SECRET` from Agent receives the secret. Run `control-openhands browser goto /settings/secrets`, `control-openhands browser click 'testid=secret-item >> has-text=QA_AGENT_SECRET >> testid=edit-secret-button'`, fill `testid=edit-secret-form >> testid=name-input` with `OPENHANDS_AUTOMATION_API_KEY` and click `testid=edit-secret-form >> testid=submit-button`: `control-openhands browser snapshot 'testid=edit-secret-form'` shows the paragraph `Secret already exists` and the form stays open. Fill `name-input` with `QA_RENAMED_SECRET` (value left blank), click submit, `control-openhands browser reload`; `browser count 'testid=secret-item >> has-text=QA_RENAMED_SECRET'` is `1`, the `QA_AGENT_SECRET` count is `0`, and `api GET /api/settings/secrets` lists only the new name. Then run `control-openhands conversation start --prompt "Run exactly this command and reply with only its output: python3 -c \"import os; print(os.environ.get('QA_RENAMED_SECRET') == 'qa-dummy-4821', 'QA_AGENT_SECRET' in os.environ)\"" --wait --timeout 240` and `control-openhands conversation events <id> --kinds ObservationEvent`: the observation is `True False`.+- **Replace the value (`F14.edit-value`).** Run `control-openhands browser goto /settings/secrets`, `control-openhands browser click 'testid=secret-item >> has-text=QA_RENAMED_SECRET >> testid=edit-secret-button'` and `control-openhands browser snapshot 'testid=edit-secret-form'` (the value textbox is named `Secret Value (leave blank to preserve the existing value)`). Fill `testid=edit-secret-form >> testid=value-input` with `qa-dummy-7350`; `browser enabled 'testid=edit-secret-form >> testid=submit-button'` is `true`. Click submit; `browser count 'testid=edit-secret-form'` is `0`. Start a conversation with the prompt `Run exactly this command and reply with only its output: python3 -c "import os; print(os.environ.get('QA_RENAMED_SECRET') == 'qa-dummy-7350')"` (quoted as above) and read its `ObservationEvent`: `True`.+- **Escape cancels delete (`F14.delete-escape`).** Run `control-openhands browser goto /settings/secrets`, `control-openhands browser click 'testid=secret-item >> has-text=QA_RENAMED_SECRET >> testid=delete-secret-button'`, `control-openhands browser press Escape`, then `control-openhands browser count 'testid=confirmation-modal'` (`0`) and `browser count 'testid=secret-item >> has-text=QA_RENAMED_SECRET'` (`1`). Clean up: delete `QA_RENAMED_SECRET` with `delete-secret-button` → `testid=confirmation-modal >> testid=confirm-button`, `browser reload`; `api GET /api/settings/secrets` lists only `OPENHANDS_AUTOMATION_API_KEY`.++## Gotchas++- Settings nav test ids embed the route, slashes included: `sidebar-settings-/settings/secrets`. Quote the selector as written.++- The value editor is a plain `textarea`, not a password field: use dummy values only, and never ask the agent to print a real secret.+- Edit forms intentionally show an empty value; that is not data loss.+- The invalid-name check is native browser validation. It shows a tooltip that screenshots do not capture, and it leaves any earlier `Secret already exists` paragraph on screen. Assert with `validationMessage` and the API, not the paragraph.+- The model is the weak link in the agent checks, not the product: asked to print a secret's length or last characters, deepseek-flash replies "I can't run that one" and runs nothing, and even for the equality check it may refuse to repeat `True` in its reply. Use the equality prompt and read the terminal `ObservationEvent`; `conversation events` truncates message text to about 160 characters.+- The conversation Overview has a Secrets drawer (`conversation-overview-secrets-panel`, `conversation-overview-secrets-add-button`) built on the same form, but no UI opens it: the Overview "..." menu (`conversation-overview-ellipsis`) offers Workspace and Git sections only. It is not a user entry point today.+- There is no empty state to reach safely: `secrets-empty` renders only with zero secrets, which means deleting the launcher-seeded key (see below).+- Secrets reach only conversations started after the save. Reuse an older conversation and the variable is missing.+- At 390 px the name column truncates long names (`OPEN…`); use `browser text` on the row rather than the screenshot to read a name.+- `OPENHANDS_AUTOMATION_API_KEY` is seeded by the launcher for automations; deleting it breaks F18/F19 runs in the same stack.diff --git a/.agents/skills/verify-openhands/references/feature-map/F15-agent-behavior-settings.md b/.agents/skills/verify-openhands/references/feature-map/F15-agent-behavior-settings.mdnew file mode 100644index 0000000000..baa53b36db--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F15-agent-behavior-settings.md@@ -0,0 +1,102 @@+# F15 — Condenser, agent context and verification settings++Three settings pages are generated from the Agent Server's settings schemas:+**Condenser** (summarize long chats), **Agent Context** (persistent agent+memory) and **Verification** (confirmation mode, security analyzer and the+critic). Each page shows the schema's fields in Basic/Advanced/All tiers (only+the tiers that have fields), hides fields whose parent switch is off, and saves+through one **Save Changes** button that stays disabled until a value differs+from the stored one.++Source: `src/routes/condenser-settings.tsx`, `src/routes/agent-context-settings.tsx`, `src/routes/verification-settings.tsx`, `src/components/features/settings/sdk-settings/`, `src/utils/sdk-settings-schema.ts`.++## Sub-features++- `F15.condenser-page`: Condenser shows its subtitle, Basic and All tabs (no Advanced), and in Basic only the **Enable Memory Condensation** switch.+- `F15.condenser-all-view`: the All tab lists the eight condenser fields with Title Case labels, plain descriptions and their stored values (Max Size `240`, Keep First Events `2`, …).+- `F15.condenser-save`: changing Max Size and saving shows **Saving...**, then the saved toast; after a reload the page opens on All with the new value.+- `F15.condenser-dependents`: turning condensation off hides the six size/reset fields (Condenser Kind stays); turning it back on un-dirties Save.+- `F15.condenser-kind`: Condenser Kind is a dropdown (**LLM Summarizer**, **None**, stored as `llm_summarizing` and `no_op`); the choice persists, and switching back restores the summarizer defaults.+- `F15.save-dirty-state`: Save is disabled on load, enabled after an edit, and disabled again when the edit is reverted by hand.+- `F15.save-errors`: a non-integer Max Size is refused in the browser with a toast; a negative one is refused by the server with a 422 toast; nothing is stored.+- `F15.view-scoped-save`: saving from a narrower tier keeps the stored values of fields that tier does not show.+- `F15.agent-context-page`: Agent Context shows a single **Persistent Agent Memory** switch with its help text and no tab bar.+- `F15.agent-context-save`: toggling Persistent Agent Memory and saving persists after reload.+- `F15.verification-page`: Verification shows Basic, Advanced and All tabs; with defaults every tier shows only **Confirmation Mode** and **Enable Critic**.+- `F15.verification-critic-fields`: Confirmation Mode reveals Security Analyzer (Advanced); Enable Critic reveals Iterative Refinement and Critic API Key (Basic) plus mode, server URL and model (All); Iterative Refinement reveals threshold and max iterations.+- `F15.confirmation-mode-save`: Confirmation Mode and Security Analyzer (conversation settings) persist after reload, alongside the agent-settings fields on the same page.+- `F15.confirmation-mode-effect`: with Confirmation Mode on and Security Analyzer **None**, a new conversation stops before its first command with **Do you want to continue with this action?** and Cancel/Continue; Continue runs it.+- `F15.critic-tuning`: Critic Mode is a dropdown (`Finish and Message`, `All Actions`); the mode, Critic Threshold and Max Refinement Iterations persist after reload, and an out-of-range threshold (`1.5`) is refused with the 422 toast.+- `F15.critic-save`: critic text fields persist after reload; the Critic API Key comes back masked; clearing the fields and turning the critic off restores the defaults.+- `F15.agent-context-effect`: with Persistent Agent Memory on, a new conversation's system prompt carries the `.openhands/memory/` instructions; with it off, it does not.+- `F15.tier-after-save`: after a save the tab bar re-derives the tier from the stored values without a reload: saving the last minor field back to its default moves the page from All to Basic.+- `F15.unsaved-navigation`: leaving a page with unsaved edits shows no prompt and discards them.+- `F15.command-menu`: the command menu offers **Condenser settings**, **Agent Context** and **Verification settings**, and each opens its page.+- `F15.direct-url`: each page renders when opened by URL.+- `F15.phone`: at 390 px the fields stack in one column without horizontal overflow.+- `F15.schema-unavailable`: a backend without the settings-schema endpoints shows `SDK settings schema unavailable.` with an upgrade hint instead of the form (blocked: needs such a backend).++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`, lands on `/settings/agents`), then **Condenser**, **Agent Context** or **Verification** in the settings navigation (`sidebar-settings-/settings/condenser`, `sidebar-settings-/settings/agent-context`, `sidebar-settings-/settings/verification`).+- Direct URLs `/settings/condenser`, `/settings/agent-context`, `/settings/verification`.+- Command menu (`Control+k` or `Meta+k`, or `command-menu-trigger` in the sidebar): **Condenser settings**, **Agent Context** and **Verification settings**; "memory" finds both Condenser settings and Agent Context.+- The effects show up in new conversations only: the confirmation prompt in the chat, and the memory instructions in the conversation's system prompt.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done). No LLM is needed for the settings pages.+- `F15.confirmation-mode-effect` and `F15.agent-context-effect` need an active LLM profile (`control-openhands llm preset deepseek`).+- `F15.schema-unavailable` needs an agent server that serves `/api/settings` but answers 404 for `/api/settings/agent-schema` (an older release via `launch --new --sdk-ref <old>`); not available in this checkout's pinned stack.+- Stored values are the defaults: `control-openhands api GET /api/settings` shows `agent_settings.condenser.enabled` `true`, `max_size` `240`, `condenser_kind` `llm_summarizing`; `agent_context.load_memory` `false`; `verification.critic_enabled` `false`; `conversation_settings.confirmation_mode` `false`.++- **Open Condenser from the sidebar (`F15.condenser-page`).** Run `control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings/agents(\?|$)'`, `control-openhands browser click 'testid=sidebar-settings-/settings/condenser' --expect-url '/settings/condenser(\?|$)'`, `control-openhands browser text 'testid=settings-page-subtitle'` (`Summarize long chats to stay within context limits.`) and `control-openhands browser snapshot 'testid=condenser-settings-screen'`. The snapshot shows tabs `Basic` [selected] and `All`, the text `Enable Memory Condensation` and `button "Save Changes" [disabled]`; `control-openhands browser count 'testid=sdk-section-advanced-toggle'` is `0`. Read the switch with `control-openhands browser eval "document.querySelector('[data-testid=\"sdk-settings-condenser.enabled\"]').checked"` (`true`).+- **All tier (`F15.condenser-all-view`).** Run `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser count 'testid=condenser-settings-screen >> input'` (`8`) and `control-openhands browser value 'testid=sdk-settings-condenser.max_size'` (`240`). `control-openhands browser snapshot 'testid=condenser-settings-screen'` labels the fields `Enable Memory Condensation`, `Max Size`, `Condenser Kind` (combobox value `LLM Summarizer`), `Max Tokens`, `Keep First Events`, `Minimum Progress`, `Hard Reset Retries` and `Hard Reset Scaling`, each with a plain-language paragraph and all but the switch marked `Optional` (Condenser Kind: `How the condenser shortens long conversations. LLM Summarizer replaces older events with a summary written by the LLM; None keeps the full history.`).+- **Dirty state (`F15.save-dirty-state`).** On the All tier: `control-openhands browser enabled 'testid=save-button'` is `false`; `control-openhands browser fill 'testid=sdk-settings-condenser.max_size' 120` makes it `true`; `control-openhands browser fill 'testid=sdk-settings-condenser.max_size' 240` makes it `false` again.+- **Save and reload (`F15.condenser-save`).** Fill Max Size with `120`, then `control-openhands browser click 'testid=save-button' --observe 'testid=save-button' --observe-ms 3000` (observed states `Save Changes` → `Saving...` → `Save Changes`) and `control-openhands browser toasts` (`Settings saved. For old conversations, you will need to stop and restart the conversation to see the changes.`). `control-openhands browser enabled 'testid=save-button'` is `false`. Run `control-openhands browser reload`, `control-openhands browser snapshot 'role=tablist'` (`All` [selected]: the page opens on the tier that shows the overridden field) and `control-openhands browser value 'testid=sdk-settings-condenser.max_size'` (`120`). `control-openhands api GET /api/settings` shows `max_size` `120`. Keep it for the next bullet.+- **Dependent fields (`F15.condenser-dependents`).** On the All tier run `control-openhands browser click 'testid=condenser-settings-screen >> text=Enable Memory Condensation'`; the switch reads `false` and `control-openhands browser count 'testid=condenser-settings-screen >> input'` is `2` (the switch and Condenser Kind). Click the label again: the count is `8` and `browser enabled 'testid=save-button'` is `false`.+- **Basic save keeps hidden fields (`F15.view-scoped-save`).** With Max Size stored as `120`, run `control-openhands browser click 'testid=sdk-section-basic-toggle'`, `control-openhands browser click 'testid=condenser-settings-screen >> text=Enable Memory Condensation'` and `control-openhands browser click 'testid=save-button'`. `control-openhands api GET /api/settings` now shows `enabled` `false` and `max_size` `120`. Known failure (reproduced 2026-10-06): `max_size` is `240`, because the save sends defaults for every field Basic does not show (#18049). After `browser reload` the page opens on Basic with the switch off. Restore: click the label again, `browser click 'testid=save-button'`, `browser reload`; the switch reads `true` and the API shows `enabled` `true` (with `max_size` `240` today, from the reset above).+- **Invalid values (`F15.save-errors`).** On the All tier run `control-openhands browser fill 'testid=sdk-settings-condenser.max_size' 1.5`, `control-openhands browser click 'testid=save-button'` and `control-openhands browser toasts` (`Expected an integer value, received: 1.5`; no request is sent). Then wait for the toast to close, fill `-5`, `control-openhands browser network --clear`, `control-openhands browser click 'testid=save-button' --observe 'testid=save-button' --observe-ms 2500` (`Saving...` for about 1.5 s), `control-openhands browser toasts` (`HTTP request failed (422 Unprocessable Entity): {"detail":"Settings validation failed"}`) and `control-openhands browser network` (three `PATCH /api/settings`). The API still shows `max_size` `240`; `browser reload` drops the bad draft.+- **Condenser Kind (`F15.condenser-kind`).** On the All tier run `control-openhands browser click 'testid=sdk-settings-condenser.condenser_kind'`, `control-openhands browser snapshot 'role=listbox'` (options `LLM Summarizer` [selected] and `None`), `control-openhands browser click 'role=listbox >> role=option[name="None"]'` and `control-openhands browser click 'testid=save-button'`. After `browser reload` the page opens on All, `browser value 'testid=sdk-settings-condenser.condenser_kind'` is `None`, and `control-openhands api GET /api/settings --pick agent_settings.condenser` is just `{"enabled": true, "condenser_kind": "no_op"}` (the labels are Canvas copy; the stored values are unchanged). The summarizer fields should hide while **None** is selected. Known failure (reproduced 2026-10-06): Max Size, Max Tokens, Keep First Events, Minimum Progress, Hard Reset Retries and Hard Reset Scaling stay with their defaults, and `browser fill 'testid=sdk-settings-condenser.max_size' 100` then Save gives `Settings saved` while the API still shows only `enabled` and `condenser_kind` and a reload shows `240` again (#18049; `browser screenshot --feature F15.condenser-kind --name none-shows-summarizer-fields`). Restore by choosing `LLM Summarizer` the same way and saving: after reload the page opens on Basic and the API shows all eight defaults again (`condenser_kind` `llm_summarizing`).+- **Agent Context (`F15.agent-context-page`).** Run `control-openhands browser click 'testid=sidebar-settings-/settings/agent-context' --expect-url '/settings/agent-context(\?|$)'`, `control-openhands browser text 'testid=settings-page-subtitle'` (`Let the agent keep notes and recall them in new conversations.`), `control-openhands browser count 'role=tablist'` (`0`) and `control-openhands browser snapshot 'testid=agent-context-settings-screen'` (text `Persistent Agent Memory`, the paragraph about `.openhands/memory/`, `button "Save Changes" [disabled]`).+- **Persistent memory persists (`F15.agent-context-save`).** Run `control-openhands browser click 'testid=agent-context-settings-screen >> text=Persistent Agent Memory'`, `control-openhands browser click 'testid=save-button'`, `control-openhands browser reload` and `control-openhands browser eval "document.querySelector('[data-testid=\"sdk-settings-agent_context.load_memory\"]').checked"` (`true`; API `agent_context.load_memory` `true`). Restore: click the label, save, reload; the value is `false`.+- **Verification (`F15.verification-page`).** Run `control-openhands browser click 'testid=sidebar-settings-/settings/verification' --expect-url '/settings/verification(\?|$)'`, `control-openhands browser text 'testid=settings-page-subtitle'` (`Confirmation prompts and security checks on actions.`) and `control-openhands browser snapshot 'testid=verification-settings-screen'`: tabs `Basic` [selected], `Advanced`, `All`; texts `Confirmation Mode` and `Enable Critic`. `control-openhands browser count 'testid=verification-settings-screen >> input'` is `2` on Advanced and on All too.+- **Critic and analyzer fields (`F15.verification-critic-fields`).** On All run `control-openhands browser click 'testid=verification-settings-screen >> text=Confirmation Mode'`, `control-openhands browser click 'testid=verification-settings-screen >> text="Enable Critic"'` and `control-openhands browser click 'testid=verification-settings-screen >> text="Enable Iterative Refinement"'`. `control-openhands browser testids 'testid=verification-settings-screen' --hidden` now lists `sdk-settings-security_analyzer`, `sdk-settings-verification.critic_mode`, `sdk-settings-verification.critic_threshold` (`0.6`), `sdk-settings-verification.max_refinement_iterations` (`3`), `sdk-settings-verification.critic_server_url`, `sdk-settings-verification.critic_model_name`, `sdk-settings-verification.critic_api_key` and `help-link-verification.critic_api_key`. `control-openhands browser attr 'testid=sdk-settings-verification.critic_api_key' type` is `password`; `control-openhands browser eval "document.querySelector('[data-testid=\"help-link-verification.critic_api_key\"] a')?.href"` is `https://app.all-hands.dev/settings/api-keys`. `control-openhands browser screenshot --feature F15.verification-critic-fields --name all-critic-on` shows the API key spanning both columns. Basic (`sdk-section-basic-toggle`) keeps `confirmation_mode`, `critic_enabled`, `enable_iterative_refinement` and `critic_api_key`; Advanced adds `security_analyzer`. The three switches are an unsaved draft that survives tab switches: run `control-openhands browser reload` before the next bullet, otherwise its Confirmation Mode click turns the switch off again and the save stores the critic draft.+- **Confirmation mode persists (`F15.confirmation-mode-save`).** On `/settings/verification` (Basic) run `control-openhands browser click 'testid=verification-settings-screen >> text=Confirmation Mode'`, `control-openhands browser click 'testid=save-button'`, `control-openhands browser reload` and `control-openhands browser eval "document.querySelector('[data-testid=\"sdk-settings-confirmation_mode\"]').checked"` (`true`). Then `control-openhands browser click 'testid=sdk-section-advanced-toggle'`, `control-openhands browser click 'testid=sdk-settings-security_analyzer'`, `control-openhands browser snapshot 'role=listbox'` (options `LLM` [selected], `None`), `control-openhands browser click 'role=listbox >> role=option[name="None"]'`, `control-openhands browser click 'testid=save-button'` and `control-openhands browser reload`: the tab bar shows `Advanced` [selected] and `control-openhands browser value 'testid=sdk-settings-security_analyzer'` is `None`. `control-openhands api GET /api/settings` shows `conversation_settings.confirmation_mode` `true`, `security_analyzer` `none`. Keep both for the next bullet.+- **Confirmation stops the agent (`F15.confirmation-mode-effect`).** Run `control-openhands conversation start --prompt "Run this shell command: echo qa-f15-confirm" --wait --until waiting_for_confirmation,finished,idle,error --timeout 180`; the status is `waiting_for_confirmation`. `control-openhands browser wait-text 'Do you want to continue with this action?' --timeout 15000` succeeds and `control-openhands browser screenshot --feature F15.confirmation-mode-effect --name awaiting` shows **Cancel ⇧⌘⌫** and **Continue ⌘↩** under the pending command. Run `control-openhands browser click 'testid=action-confirm-button'`, `control-openhands conversation wait <id> --until finished,idle,error --timeout 120` (`<id>` from the start output) and `control-openhands conversation events <id> --kinds ObservationEvent`: the terminal observation is `qa-f15-confirm`. If the status is still `waiting_for_confirmation` the agent asked again (see Gotchas): confirm again. Restore on `/settings/verification` (`control-openhands browser goto /settings/verification`; the browser is on the conversation): `browser click 'testid=sdk-section-basic-toggle'`, click the Confirmation Mode label, `browser click 'testid=save-button'`; the Basic save also resets Security Analyzer to `llm` (API `confirmation_mode` `false`, `security_analyzer` `llm`).+- **Critic values persist (`F15.critic-save`).** On the All tier click `testid=verification-settings-screen >> text="Enable Critic"`, run `control-openhands browser fill 'testid=sdk-settings-verification.critic_model_name' qa-critic-model`, `control-openhands browser fill 'testid=sdk-settings-verification.critic_api_key' qa-dummy-critic-key`, `control-openhands browser click 'testid=save-button'` and `control-openhands browser reload`. The page opens on `All`; `browser value 'testid=sdk-settings-verification.critic_model_name'` is `qa-critic-model` and `browser value 'testid=sdk-settings-verification.critic_api_key'` is `**********`. Restore on All: fill both fields with `''`, click `text="Enable Critic"` again, save, reload: the page opens on Basic and the API shows `critic_enabled` `false`, `critic_model_name` and `critic_api_key` `null`.+- **Critic mode, threshold and iterations (`F15.critic-tuning`).** On `/settings/verification` run `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser click 'testid=verification-settings-screen >> text="Enable Critic"'`, `control-openhands browser click 'testid=sdk-settings-verification.critic_mode'` and `control-openhands browser snapshot 'role=listbox'` (options `Finish and Message` [selected], `All Actions`). Run `control-openhands browser click 'role=listbox >> role=option[name="All Actions"]'`, `control-openhands browser click 'testid=verification-settings-screen >> text="Enable Iterative Refinement"'`, `control-openhands browser fill 'testid=sdk-settings-verification.critic_threshold' 0.75`, `control-openhands browser fill 'testid=sdk-settings-verification.max_refinement_iterations' 5`, `control-openhands browser click 'testid=save-button'` and `control-openhands browser reload`: the page opens on `All`, `browser value` reads `All Actions`, `0.75` and `5`, and `control-openhands api GET /api/settings --pick agent_settings.verification` shows `critic_mode` `all_actions`, `critic_threshold` `0.75`, `max_refinement_iterations` `5`. Then `browser fill 'testid=sdk-settings-verification.critic_threshold' 1.5`, `browser network --clear`, `browser click 'testid=save-button'`, `browser toasts` (`HTTP request failed (422 Unprocessable Entity): {"detail":"Settings validation failed"}`, three `PATCH /api/settings` with 422 in `browser network`); the API still shows `0.75`. Restore: `browser reload`, `browser click 'testid=sdk-section-basic-toggle'`, click `text="Enable Iterative Refinement"` and `text="Enable Critic"` off, `browser click 'testid=save-button'`: the Basic save resets mode, threshold and iterations, and the API shows the verification defaults.+- **Tier follows the stored values after a save (`F15.tier-after-save`).** On `/settings/condenser` (`control-openhands browser goto /settings/condenser`; the previous bullet is on `/settings/verification`) run `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser fill 'testid=sdk-settings-condenser.keep_first' 3`, `control-openhands browser click 'testid=save-button'`, `control-openhands browser wait-text 'Settings saved' --timeout 5000` and `control-openhands browser snapshot 'role=tablist'` (`All` [selected]). Then `browser fill 'testid=sdk-settings-condenser.keep_first' 2`, `browser click 'testid=save-button'`, `control-openhands browser wait 'testid=sdk-settings-condenser.keep_first' --state detached --timeout 5000` (`detached`) and `browser snapshot 'role=tablist'`: `Basic` [selected] without any reload; the API shows `keep_first` `2` (restored).+- **Memory reaches the agent (`F15.agent-context-effect`).** Run `control-openhands browser goto /settings/agent-context`, turn Persistent Agent Memory on and save as in `F15.agent-context-save`, then run `control-openhands conversation start --prompt "Reply with only: ok" --wait --timeout 180` and `control-openhands api GET '/api/conversations/<id>/events/search?limit=1'`. The first event is the `SystemPromptEvent`; its text contains `Project memory: ` followed by `` `.openhands/memory/` under the workspace root``. The same call for a conversation started with memory off (for example the one from `F15.confirmation-mode-effect`) has no `.openhands/memory`. Restore memory off through the page (`control-openhands browser goto /settings/agent-context` first: `conversation start` left the browser on the conversation).+- **Leaving discards edits (`F15.unsaved-navigation`).** Arrange an unsaved draft: `control-openhands browser click 'testid=sidebar-settings-/settings/verification' --expect-url '/settings/verification(\?|$)'`, `control-openhands browser click 'testid=sdk-section-all-toggle'`, then click `testid=verification-settings-screen >> text=Confirmation Mode`, `>> text="Enable Critic"` and `>> text="Enable Iterative Refinement"` (do not save); `browser enabled 'testid=save-button'` is `true`. Run `control-openhands browser click 'testid=sidebar-settings-/settings/condenser' --expect-url '/settings/condenser(\?|$)'`, `control-openhands browser dialogs` (none), `control-openhands browser click 'testid=sidebar-settings-/settings/verification' --expect-url '/settings/verification(\?|$)'`, then `control-openhands browser eval "[document.querySelector('[data-testid=\"sdk-settings-confirmation_mode\"]').checked, document.querySelector('[data-testid=\"sdk-settings-verification.critic_enabled\"]').checked]"` (`[false, false]`) and `browser enabled 'testid=save-button'` (`false`).++- **Command menu (`F15.command-menu`).** Run `control-openhands browser goto /`, `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Condenser`, `control-openhands browser snapshot 'testid=command-menu'` (option `Condenser settings Tune context condensation behavior. Go` [selected]), `control-openhands browser press Enter` and `control-openhands browser wait-url '/settings/condenser(\?|$)'`. Repeat with `Verification` (option `Verification settings Adjust risk and confirmation controls. Go`, URL `/settings/verification`) and with `Agent Context` (option `Agent Context Let the agent keep notes and recall them in new conversations. Go` [selected], URL `/settings/agent-context`, subtitle `Let the agent keep notes and recall them in new conversations.`). Then `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' memory` and `control-openhands browser snapshot 'testid=command-menu'`: two options, `Condenser settings …` and `Agent Context …` (hovering selects an option, so click the one you want rather than pressing Enter); close with `control-openhands browser press Escape` (`browser count 'testid=command-menu'` is `0`).+- **Direct URLs (`F15.direct-url`).** Run `control-openhands browser goto /settings/condenser` and `control-openhands browser wait 'testid=condenser-settings-screen'`; likewise `/settings/agent-context` with `testid=agent-context-settings-screen` and `/settings/verification` with `testid=verification-settings-screen`. Each wait returns `visible`.+- **Phone (`F15.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/verification`, `control-openhands browser click 'testid=sdk-section-all-toggle'`, `control-openhands browser click 'testid=verification-settings-screen >> text="Enable Critic"'` (unsaved), `control-openhands browser bbox 'testid=verification-settings-screen'` (width `348`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F15.phone --name verification-all` (one column; the settings nav is replaced by a back chevron). Do the same for `/settings/condenser` All. Return with `control-openhands browser viewport desktop` and `browser reload` to drop the draft.+- **Schema unavailable (`F15.schema-unavailable`, blocked).** `control-openhands service stop agent-server` does not reach this state: after `browser reload` the whole app is replaced by the **Manage backends** dialog (`Disconnected`, 502). Bring the stack back with `control-openhands restart`. The state needs a backend whose schema endpoints 404 (see Preconditions); there `browser text 'testid=sdk-schema-unavailable'` should start with `SDK settings schema unavailable.`+- **Errors sweep.** `control-openhands browser errors --clear`, open the three pages and their All tabs, then `control-openhands browser errors --app-only`: no page errors and no warnings (the condenser fields are translated since #18035).++## Gotchas++- Switches are hidden `<input>`s (#17900): `browser testids` lists them only with `--hidden`. Toggle by clicking the label text scoped to the page, read `.checked` with `browser eval`.+- `text=Enable Critic` is a case-insensitive substring match and hits the help paragraph `Enable critic evaluation for the agent.` first, so the click does nothing. Quote it: `text="Enable Critic"` (same for `text="Enable Iterative Refinement"`).+- The conversation-owned fields have no `verification.` prefix: `sdk-settings-confirmation_mode`, `sdk-settings-security_analyzer`. Critic fields keep it (`sdk-settings-verification.critic_enabled`).+- Saving is tier-scoped: Basic or Advanced saves reset every field the tier hides to its schema default (`F15.view-scoped-save`). Make all edits on All when other non-default values must survive.+- The page opens on the least detailed tier that shows every stored override (any minor override → All). Do not assume Basic after a reload.+- Condenser Kind **None** (`no_op`) still shows the summarizer fields with defaults, although the stored condenser no longer has them, and edits to them are accepted (`Settings saved`) but dropped while **None** is stored. #18049 covers hiding fields that do not apply to the selected kind.+- A server-side validation error is retried three times (about 1.5 s of `Saving...`) before the toast, and the toast only says `Settings validation failed` without naming the field (#17932).+- Condenser Kind is served by the Agent Server's settings schema as a user field. Since #18035 (closed #17939) Canvas shows its own choice labels and help text instead of the raw `llm_summarizing`/`no_op` values and the schema's reStructuredText description. It stays a user field on purpose: software-agent-sdk#5531, which dropped it from the schema, was closed because more condenser kinds may come, so the dropdown (and `F15.condenser-kind`) is expected behavior and its presentation is Canvas's job. OpenHands/software-agent-sdk#5495 (the schema's developer-facing description) is still open.+- Toasts close after a few seconds; read them right after the click, or assert the stored value with `api GET /api/settings`.+- Under confirmation mode the first confirmed command sometimes returned `The terminal session was reset because the underlying tmux server/session disappeared...` while several runs shared one tmux server (OpenHands/OpenHands#17946); `launch` now isolates them, so treat a reset as a finding. The agent then asks to run it again; a confirmed command took up to two minutes to produce its observation. Confirm again and wait with `conversation wait`, not a fixed sleep.+- The confirmation buttons have test ids (`action-confirm-button`, `action-reject-button`) but their accessible names are `Confirm action` / `Reject action`, not the visible `Continue` / `Cancel`: `role=button[name*="Continue"]` finds nothing.+- Basic-tier saves on Verification reset Security Analyzer to `llm` (it is an Advanced field). That is a convenient restore, and a trap if you meant to keep `None`.+- The memory instructions are only visible through the conversation's first event; `conversation events` truncates text, so read `api GET /api/conversations/<id>/events/search?limit=1` and search the JSON.+- A checkout without #18035 shows the condenser minor fields with the schema's English text (`Max tokens`, `Keep first`, raw choice values) and logs 14 `[i18n] Missing translation` warnings on the All tab.+- The dropdowns' clear (×) button has no accessible name and, in this build, clicking it through `role=button >> nth=2` left the value unchanged.+- After every successful save the selected tab is recomputed from the stored values (`F15.tier-after-save`), so a follow-up `fill` on an All-only field can time out because the page silently moved to Basic. Re-click `sdk-section-all-toggle` before each further edit.+- Pressing Enter in a field does not save (no toast, API unchanged, Save stays enabled); only the Save Changes button submits.+- Fields revealed by a parent switch do not exist while the switch is off: `fill` on `critic_threshold` with Iterative Refinement off waits for a missing element.+- Rejecting a pending action (Cancel), the lock chip above the composer and the ⌘↩ / ⇧⌘⌫ shortcuts belong to `F06.confirmation-mode` and `F06.confirmation-shortcuts`; this family only proves that the settings turn the prompt on.+- `browser count 'role=status'` also counts the backend status dot (`backend-status-dot`); use `browser toasts` for toast texts.diff --git a/.agents/skills/verify-openhands/references/feature-map/F16-application-settings.md b/.agents/skills/verify-openhands/references/feature-map/F16-application-settings.mdnew file mode 100644index 0000000000..f9d8341a17--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F16-application-settings.md@@ -0,0 +1,93 @@+# F16 — Application settings++Settings → Application holds the user's app-wide preferences: UI language,+colour theme, anonymous usage data, sound notifications, the sidebar Getting+Started checklist, which LLM profile writes conversation titles, an optional+voice-input transcription endpoint, and the git identity used for commits. The+page mixes two save models: language, analytics, sound, title model and git+identity wait for **Save Changes** and are stored on the backend; theme,+checklist and voice input apply instantly and live in this browser only.++Source: `src/routes/app-settings.tsx`, `src/components/features/settings/app-settings/`, `src/components/features/settings/settings-switch.tsx`, `src/themes/color-theme/`, `src/utils/transcription-endpoint-storage.ts`, `src/api/settings-service/settings-service.api.ts`.++## Sub-features++- `F16.open`: the page opens from the settings navigation, the command menu and the direct URL; every section renders and **Save Changes** is disabled while nothing has changed.+- `F16.language`: choosing a language and saving switches the whole UI at once and persists after a reload; `<html lang>` and `<html dir>` follow the chosen language (`rtl` for Arabic).+- `F16.color-theme`: choosing a colour theme applies it immediately without Save, persists after a reload and on other pages, and is never sent to the backend.+- `F16.analytics`: the "Send anonymous usage data" switch saves with the form and sets browser telemetry consent to granted/denied.+- `F16.analytics-cloud`: on a Cloud backend the analytics switch is forced on and disabled.+- `F16.sound`: the "Sound Notifications" switch saves with the form; with it on, a sound plays when the agent finishes or needs input.+- `F16.checklist`: the "Show Getting Started checklist" switch hides or shows the sidebar checklist immediately, without Save, and survives a reload.+- `F16.title-model`: the Title generation model dropdown offers "Automatic (recommended)" plus one `name · model` option per LLM profile; the choice persists and new conversations still get an automatic title.+- `F16.title-model-fallback`: if the chosen profile is deleted (from LLM settings, or outside the UI), the dropdown shows Automatic and the form stays clean.+- `F16.manage-profiles-link`: "Manage LLM profiles" goes to `/settings/llm`.+- `F16.voice-endpoint`: Voice input Base URL, API Key (masked) and Model save on every keystroke in this browser only, independently of Save; the key lives in session storage.+- `F16.git-identity`: Git Username and Git Email save with the form, persist after a reload, and are what the agent's commits use.+- `F16.git-identity-validation`: an email without `@` is refused by native validation; empty fields save the defaults `openhands` / `[email protected]`.+- `F16.save-states`: Save is enabled only while a saved field differs from the stored value; while a save is pending the whole form, Save included, is replaced by the `app-settings-skeleton` (so the "Saving..." label in the source never shows); success toasts "Settings saved", failure toasts the HTTP error and should keep the user's edits for a retry.+- `F16.keyboard`: every control, including the three switches, is reachable with Tab and exposed to assistive technology.+- `F16.phone`: the form fits a 390 px viewport without horizontal overflow and Save is reachable by scrolling.+- `F16.title-model-clear`: the Title generation model combobox has a clear (×) button, shown on hover; it resets the choice to Automatic (recommended).+- `F16.dropdown-filter`: typing into the Language (or any) combobox filters its options; Escape restores the stored value and leaves Save disabled.+- `F16.browser-scope`: backend-saved preferences (language and the rest of the Save group) follow the user to a fresh browser profile, while theme and checklist visibility return to their defaults there.++## How to get to it (user POV)++- Sidebar settings gear (`backend-selector-settings-link`), then **Application** in the settings navigation (`sidebar-settings-/settings/app`). The gear lands on `/settings/agents`, not on this page.+- Direct URL `/settings/app` (also the default settings page for locked-to-Cloud deployments).+- Command menu (`Control+k` or `Meta+k`, or `command-menu-trigger` in the sidebar): search "Application", choose **Application settings** ("Change app language, theme, and preferences").+- **Manage LLM profiles** link under Conversation titles leaves this page for `/settings/llm` (F16.manage-profiles-link); the LLM settings row menu is how a user deletes a profile (owned by the LLM profiles family).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done; it stores analytics off, so the analytics switch starts unchecked).+- `F16.title-model`, `F16.title-model-fallback` and the agent half of `F16.git-identity` need LLM profiles: `control-openhands llm preset deepseek --api-key-file <key file>` (or `--api-key-env DEEPSEEK_API_KEY`), which saves `deepseek-flash` (active) and `deepseek-pro`.+- Read the starting values once: `control-openhands api GET /api/settings`; backend-saved fields are under `body.misc_settings.app_preferences` (`language`, `user_consents_to_analytics`, `enable_sound_notifications`, `title_llm_profile`, `git_user_name`, `git_user_email`). Keys absent there mean defaults.+- The three switches are `<input hidden>` inside a `<label>`: click the label text scoped to the form, and read state with `control-openhands browser eval "document.querySelector('[data-testid=enable-analytics-switch]').checked"` (same for `enable-sound-notifications-switch`, `show-getting-started-checklist-switch`).+- Every bullet starts on `/settings/app` at the desktop viewport unless it says otherwise (`control-openhands browser goto /settings/app`, then `control-openhands browser wait 'testid=submit-button'`).+- `F16.analytics-cloud` is **blocked** without an OpenHands Cloud backend and account.++- **Open from navigation (`F16.open`).** From `/` run `control-openhands browser click 'testid=backend-selector-settings-link'`, `control-openhands browser click 'testid=sidebar-settings-/settings/app'`, then `control-openhands browser url`, `control-openhands browser snapshot 'testid=app-settings-screen'` and `control-openhands browser screenshot --feature F16.open --name desktop`. The URL ends in `/settings/app`; the snapshot shows comboboxes "Language" (`English`), "Color Theme" (`OpenHands-Neutral`) and "Title generation model" (`Automatic (recommended)`), headings "Conversation titles", "Voice input" and "Git Settings", and `button "Save Changes" [disabled]`.+- **Command-menu and URL entries (`F16.open`).** Run `control-openhands browser goto /` (the previous bullet ends on `/settings/app`, where the URL check would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Application`, `control-openhands browser snapshot 'testid=command-menu'` (option "Application settings Change app language, theme, and preferences. Go" is `[selected]`), `control-openhands browser press Enter`, then `control-openhands browser url`; it ends in `/settings/app`. For the URL entry run `control-openhands browser goto /settings/app`, `control-openhands browser enabled 'testid=submit-button'` (`false`) and `control-openhands browser attr 'testid=sidebar-settings-/settings/app' aria-current` (`page`).+- **Language (`F16.language`).** Run `control-openhands browser click 'testid=language-input'` (15 options), `control-openhands browser click 'role=option[name="Français"]'`, `control-openhands browser enabled 'testid=submit-button'` (`true`), `control-openhands browser click 'testid=submit-button'`, then `control-openhands browser text 'testid=submit-button'`. It reads `Enregistrer les modifications` without a reload. Run `control-openhands browser reload`, `control-openhands browser value 'testid=language-input'` (`Français`), `control-openhands browser screenshot --feature F16.language --name french` (the screenshot, not a scoped snapshot, shows the sidebar's "Nouvelle discussion" and the headings "Titres des conversations", "Saisie vocale") and `control-openhands api GET /api/settings` (`language` is `fr`). Then check the document language with `control-openhands browser eval "document.documentElement.lang + ' ' + document.documentElement.dir"` (`fr ltr`) and the translated sidebar trigger with `control-openhands browser attr 'testid=command-menu-trigger' aria-label` (`Rechercher des commandes`). Choose `role=option[name="Arabic"]` the same way (click the input, the option, Save, reload): the `eval` reads `ar rtl`, and `control-openhands browser bbox 'aside[data-collapsed]'` has `x` `1140`, so the 300 px sidebar now sits at the right edge of the 1440 px viewport. `control-openhands browser screenshot --feature F16.language --name arabic` shows the whole layout flipped right to left: the sidebar on the right, the settings navigation to its left, and the form on the left with its Arabic labels and values aligned right. Restore: `control-openhands browser click 'testid=language-input'`, `control-openhands browser click 'role=option[name="English"]'`, `control-openhands browser click 'testid=submit-button'`, `control-openhands browser reload`, `control-openhands browser text 'testid=submit-button'` reads `Save Changes` and the `eval` reads `en ltr`.+- **Colour theme (`F16.color-theme`).** Run `control-openhands browser click 'testid=color-theme-input'`, `control-openhands browser snapshot 'role=listbox'` (OpenHands-DeepSea, OpenHands-Neutral [selected], OpenHands-Neo, Light+, Solarized Light), `control-openhands browser click 'role=option[name="Light+"]'`, then `control-openhands browser eval "document.documentElement.style.colorScheme + ' ' + localStorage.getItem('openhands-color-theme')"` (`light light-plus`) and `control-openhands browser enabled 'testid=submit-button'` (`false`: no Save needed). `control-openhands browser screenshot --feature F16.color-theme --name light-plus` shows a white page. Second views: `control-openhands browser reload` then `control-openhands browser value 'testid=color-theme-input'` (`Light+`); `control-openhands browser goto /` then `control-openhands browser eval "getComputedStyle(document.body).backgroundColor + ' ' + document.documentElement.style.colorScheme"` (`rgb(255, 255, 255) light`); `control-openhands api GET /api/settings` contains no theme key. Restore on `/settings/app` (`control-openhands browser goto /settings/app`; the second view left `/`) by choosing `role=option[name="OpenHands-Neutral"]` the same way (`dark openhands-neutral`).+- **Analytics consent (`F16.analytics`).** Run `control-openhands browser click 'testid=app-settings-screen >> text=Send anonymous usage data'`, read the switch with the `eval` from Preconditions (`true`), `control-openhands browser click 'testid=submit-button'`, `control-openhands browser wait-text 'Settings saved'`, `control-openhands browser reload`, read the switch again (`true`), `control-openhands api GET /api/settings` (`user_consents_to_analytics: true`) and `control-openhands browser eval "localStorage.getItem('openhands-telemetry-consent')"` (`granted`). Restore by clicking the label again and saving; consent reads `denied` and the API `false`.+- **Cloud forces analytics (`F16.analytics-cloud`).** Blocked: needs a Cloud backend selected in the backend selector. Expected: `control-openhands browser enabled 'testid=enable-analytics-switch'` is `false` and the switch reads checked.+- **Sound notifications (`F16.sound`).** Run `control-openhands browser click 'testid=app-settings-screen >> text=Sound Notifications'`, `control-openhands browser click 'testid=submit-button'`, `control-openhands browser wait-text 'Settings saved'`, `control-openhands browser reload`, read `enable-sound-notifications-switch` (`true`) and `control-openhands api GET /api/settings` (`enable_sound_notifications: true`). Restore by toggling and saving again (`false`). Audible half: with the switch on and saved, `control-openhands conversation start --prompt "Reply with only the word ok. Do not run any tools." --wait --timeout 180`, then `control-openhands browser media`: `plays` lists one `/assets/notification-<hash>.mp3` at the moment the conversation finished. With the switch off, the same check after a conversation reads `plays: []` (the `F16.git-identity` conversation below doubles as that negative check). Turn the switch off and save afterwards (`control-openhands browser goto /settings/app` first: `conversation start` left the browser on the conversation).+- **Getting Started checklist (`F16.checklist`).** Run `control-openhands browser count 'testid=sidebar-onboarding-checklist'` (`1`), `control-openhands browser click 'testid=app-settings-screen >> text=Show Getting Started checklist'`, then the same `count` (`0`, immediately) and `control-openhands browser enabled 'testid=submit-button'` (`false`). `control-openhands browser screenshot --feature F16.checklist --name hidden` shows the sidebar without the "Getting started" card. `control-openhands browser reload` keeps the count at `0` and the switch unchecked. Click the label again to restore; the count returns to `1`.+- **Title generation model (`F16.title-model`).** Run `control-openhands browser click 'testid=title-llm-profile-input'` and `control-openhands browser snapshot 'role=listbox'`: options `Automatic (recommended)`, `deepseek-flash · deepseek/deepseek-flash`, `deepseek-pro · deepseek/deepseek-v4-pro`. Run `control-openhands browser click 'role=option >> has-text=deepseek-pro'`, `control-openhands browser click 'testid=submit-button'`, `control-openhands browser wait-text 'Settings saved'`, `control-openhands browser reload`, `control-openhands browser value 'testid=title-llm-profile-input'` (`deepseek-pro · deepseek/deepseek-v4-pro`) and `control-openhands api GET /api/settings` (`title_llm_profile: "deepseek-pro"`). Then `control-openhands conversation start --prompt "Reply with only the word ok. Do not run any tools." --wait --timeout 180` and, a few seconds later, `control-openhands conversation status <id>` with the `id` it printed: `title` is a generated title: an emoji and a short phrase whose wording varies (for example `🔧 Acknowledge with ok only`). The start output's own `title` may already be set; when it is still `null`, the title is written a few seconds after the run finishes. Return with `control-openhands browser goto /settings/app`, choose `role=option[name="Automatic (recommended)"]`, save; `title_llm_profile` is then absent from `app_preferences`.+- **Manage LLM profiles link (`F16.manage-profiles-link`).** Run `control-openhands browser click 'role=link[name="Manage LLM profiles"]'` then `control-openhands browser url`; it ends in `/settings/llm` and `control-openhands browser count 'testid=profile-row'` lists the profiles.+- **Deleted profile falls back (`F16.title-model-fallback`).** Arrange a throwaway profile: `control-openhands llm set --profile qa-title --model deepseek/deepseek-flash --api-key-file <key file> --no-activate --no-validate`. On `/settings/app` select it (`control-openhands browser click 'testid=title-llm-profile-input'`, `control-openhands browser click 'role=option >> has-text=qa-title'`, save). Delete it through the UI: `control-openhands browser click 'role=link[name="Manage LLM profiles"]'`, `control-openhands browser click 'testid=profile-row >> has-text=qa-title >> testid=profile-menu-trigger'`, `control-openhands browser click 'testid=profile-actions-menu >> testid=profile-delete'`, `control-openhands browser click 'testid=delete-profile-confirm'`, then `control-openhands browser click 'testid=sidebar-settings-/settings/app'`. `control-openhands browser value 'testid=title-llm-profile-input'` is `Automatic (recommended)`, Save is disabled, and `title_llm_profile` is absent from the API's `app_preferences`. For a preference that goes stale outside the UI, arrange `control-openhands api PATCH /api/settings --data '{"misc_settings_diff":{"app_preferences":{"title_llm_profile":"qa-missing"}}}' --write`, then `control-openhands browser reload`: the dropdown still shows `Automatic (recommended)` and Save stays disabled, while the API keeps `qa-missing` until the next Save of this form. Any Save writes the form's current preferences, which no longer hold the stale key, so saving an unrelated change removes it: toggle Sound Notifications, save, toggle back, save.+- **Voice input endpoint (`F16.voice-endpoint`).** Run `control-openhands browser fill 'testid=transcription-base-url-input' http://127.0.0.1:9/v1`, `control-openhands browser fill 'testid=transcription-api-key-input' qa-dummy-key`, `control-openhands browser fill 'testid=transcription-model-input' qa-whisper`, then `control-openhands browser enabled 'testid=submit-button'` (`false`) and `control-openhands browser attr 'testid=transcription-api-key-input' type` (`password`). After `control-openhands browser reload`, `control-openhands browser value 'testid=transcription-model-input'` is `qa-whisper` (same for the other two). `control-openhands browser eval "localStorage.getItem('openhands-transcription-endpoint') + ' | session=' + sessionStorage.getItem('openhands-transcription-api-key')"` reads `{"baseUrl":"http://127.0.0.1:9/v1","model":"qa-whisper"} | session=qa-dummy-key`; the API body has no `qa-whisper`. Clear each with `control-openhands browser fill 'testid=transcription-base-url-input' ''` (and the other two). Using the endpoint from the composer microphone is not driven here (needs microphone capture and a transcription server).+- **Git identity (`F16.git-identity`).** Run `control-openhands browser fill 'testid=git-user-name-input' 'QA Tester'`, `control-openhands browser fill 'testid=git-user-email-input' '[email protected]'`, `control-openhands browser click 'testid=submit-button'`, `control-openhands browser wait-text 'Settings saved'`, `control-openhands browser reload`, then `control-openhands browser value 'testid=git-user-name-input'` (`QA Tester`) and `control-openhands api GET /api/settings` (`git_user_name`, `git_user_email` set). Agent half: `control-openhands conversation start --prompt "Run exactly this command and reply with only its output: env | grep -c '^GIT_'; git init -q qa_t && cd qa_t && git commit --allow-empty -qm x; git log -1 --format='%an <%ae>'" --wait --timeout 240`, then `control-openhands conversation events <id> --kinds ObservationEvent,MessageEvent` with the `id` from the start output. Expected: `QA Tester <[email protected]>`. **Known failure:** the observation is `0 Author identity unknown ...`: the identity is stored only in `misc_settings.app_preferences` and never reaches the agent.+- **Git validation and defaults (`F16.git-identity-validation`).** Run `control-openhands browser fill 'testid=git-user-email-input' 'not-an-email'`, `control-openhands browser click 'testid=submit-button'`, then `control-openhands browser eval "document.querySelector('[data-testid=git-user-email-input]').validationMessage"` (`Please include an '@' in the email address. ...`); the API email is unchanged. Then `control-openhands browser fill 'testid=git-user-email-input' ''`, `control-openhands browser fill 'testid=git-user-name-input' ''`, click submit, `control-openhands browser wait-text 'Settings saved'`, `control-openhands browser reload`: the inputs read `openhands` and `[email protected]`, which also restores the baseline.+- **Save button states (`F16.save-states`).** Click the analytics label once: `control-openhands browser enabled 'testid=submit-button'` is `true`; click it again: `false` (back to the stored value). Each successful save above made while the UI is in English shows the toast found by `control-openhands browser wait-text 'Settings saved'`; the Arabic save and the English restore in `F16.language` are made from a French and an Arabic UI and toast `Paramètres enregistrés` and `تم حفظ الإعدادات` instead (see Gotchas). Pending and failure: run `control-openhands service stop agent-server` (the open page keeps its form), click `testid=app-settings-screen >> text=Sound Notifications`, start a sampler with `control-openhands browser eval "(() => { window.__seen = []; window.__iv = setInterval(() => { const s = document.querySelector('[data-testid=submit-button]'); const k = (s ? s.textContent : '-') + ' skeleton=' + !!document.querySelector('[data-testid=app-settings-skeleton]'); if (window.__seen.at(-1) !== k) window.__seen.push(k); }, 10); return 'started'; })()"`, click `testid=submit-button`, `control-openhands browser wait-text 'HTTP request failed'` (the toast starts `HTTP request failed (502 Bad Gateway)` and names the refused Agent Server port), then `control-openhands browser eval "(() => { clearInterval(window.__iv); return window.__seen.join(' -> '); })()"`: it starts with `Save Changes skeleton=false -> - skeleton=true`, i.e. the form and its Save button are replaced by the skeleton while pending; `Saving...` never appears. By the time the failure toast is read the form has usually come back, adding `-> Save Changes skeleton=false`; assert the prefix. Expected after the failure: the Sound switch stays on so the user can retry. **Known failure:** `control-openhands browser eval "document.querySelector('[data-testid=enable-sound-notifications-switch]').checked"` is `false` and Save is disabled: the edit is silently discarded. Bring the backend back with `control-openhands restart`, `control-openhands doctor`, `control-openhands browser goto /settings/app`.+- **Keyboard and screen readers (`F16.keyboard`).** Run `control-openhands browser focus 'testid=color-theme-input'`, then repeat `control-openhands browser press Tab` and `control-openhands browser eval "(document.activeElement.getAttribute('data-testid')||'') + ' ' + document.activeElement.tagName"`. Expected (the acceptance criterion): focus visits the three switches before `title-llm-profile-input`. **Known failure, today's result:** the first Tab lands on `title-llm-profile-input`; `control-openhands browser snapshot 'testid=app-settings-screen' --feature F16.keyboard --name aria` shows the switches only as `text: Send anonymous usage data Sound Notifications Show Getting Started checklist`, with no switch or checkbox nodes.+- **Phone layout (`F16.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /settings/app`, `control-openhands browser bbox 'testid=app-settings-screen'` (`pageHorizontalOverflow: false`, width 348 at x 16), `control-openhands browser screenshot --feature F16.phone --name top`, `control-openhands browser scroll 'testid=submit-button'`, `control-openhands browser bbox 'testid=submit-button'` (`insideViewport: true`) and `control-openhands browser screenshot --feature F16.phone --name bottom`. Return with `control-openhands browser viewport desktop`.+- **Clear the title model (`F16.title-model-clear`).** Run `control-openhands browser click 'testid=title-llm-profile-input'`, `control-openhands browser click 'role=option >> has-text=deepseek-flash'` (Save enables), `control-openhands browser hover 'testid=title-llm-profile-input'`, then `control-openhands browser click 'testid=title-llm-profile-input >> xpath=../..//button[not(@aria-label)]'`. `control-openhands browser value 'testid=title-llm-profile-input'` reads `Automatic (recommended)` and `control-openhands browser enabled 'testid=submit-button'` is `false`. Without the hover the click times out (`<div ...> intercepts pointer events`).+- **Filter a dropdown by typing (`F16.dropdown-filter`).** Run `control-openhands browser fill 'testid=language-input' Deu` and `control-openhands browser snapshot 'role=listbox'`: the only option is `Deutsch`. Save is briefly `true` while the text is typed; `control-openhands browser press Escape` restores `control-openhands browser value 'testid=language-input'` to `English` and `control-openhands browser enabled 'testid=submit-button'` to `false`.+- **Browser vs backend scope (`F16.browser-scope`).** Choose `Deutsch` in `testid=language-input` and save, choose `Solarized Light` in `testid=color-theme-input`, and hide the checklist with `control-openhands browser click 'testid=show-getting-started-checklist-switch >> xpath=ancestor::label'` (the label text is German now). Then `control-openhands browser reset`, `control-openhands onboard --skip`, `control-openhands browser goto /settings/app`, `control-openhands browser wait 'testid=submit-button'`: `control-openhands browser text 'testid=submit-button'` is `Änderungen speichern` and `control-openhands browser value 'testid=language-input'` is `Deutsch` (backend), while `control-openhands browser value 'testid=color-theme-input'` is `OpenHands-Neutral`, `control-openhands browser eval "localStorage.getItem('openhands-color-theme')"` is `null` and `control-openhands browser count 'testid=sidebar-onboarding-checklist'` is `1` (browser-only, back to defaults). Restore English (the option keeps its English name in the German UI): `control-openhands browser click 'testid=language-input'`, `control-openhands browser click 'role=option[name="English"]'`, `control-openhands browser click 'testid=submit-button'`, `control-openhands browser reload`, `control-openhands browser wait 'testid=submit-button'`; `control-openhands browser text 'testid=submit-button'` reads `Save Changes` and `control-openhands api GET /api/settings --pick misc_settings.app_preferences.language` is `en`.+- After the family, `control-openhands browser errors --app-only` reports `appErrors: 0`. Requests to `registry.npmjs.org` (update check) and Google Fonts fail through the sandbox proxy; they are not app errors.++## Gotchas++- Two save models on one form: theme, checklist and voice input apply instantly and ignore Save; the rest is dropped silently if you navigate away before Save (filling `git-user-name-input`, then clicking `sidebar-settings-/settings/secrets` and back, shows the stored `openhands` again; `browser dialogs` is empty). Assert the instant ones without clicking Save, and never expect Save to enable for them.+- The success toast uses the language that was active when you clicked Save, not the one you saved. In `F16.language` the French Save toasts `Settings saved`, the Arabic Save toasts `Paramètres enregistrés`, and the English restore toasts `تم حفظ الإعدادات`, so `wait-text 'Settings saved'` times out on the last two. Assert with `browser text 'testid=submit-button'` after a reload, or read the toast with `browser toasts`.+- Some chrome strings stay English after a language switch: the sidebar **Automate** label in every language (the automation interface supplies it, not the translation file), and most of the command menu's own texts (placeholder `Search actions, pages, and settings...`, the search box's `Search commands` name, the group names and the item names) in French and 11 other languages. Only the Model Router and Agent Context items are translated (`Routeur de modèles` and `Contexte de l'agent` in French), because they reuse the settings navigation's titles. Do not treat the English ones as a language switch failure; the sidebar trigger's `Search commands` is translated.+- In Arabic (`dir="rtl"`) a switch that is on draws its thumb outside its track (on `show-getting-started-checklist-switch` the track spans `x` 778–818 and the thumb 822–838). Assert switch state with `.checked`, not from a screenshot.+- The switches are hidden checkboxes: `browser click 'testid=enable-analytics-switch'` times out (`element is not visible`). Click the label text scoped to `testid=app-settings-screen`, and read `.checked` through `eval`.+- `role=option[name^=...]` is not supported by the selector parser; use `role=option >> has-text=<profile>` for profile options whose names include the model.+- `conversation start` leaves the browser on the conversation page, which also has a `testid=submit-button`; `goto /settings/app` before the next settings step or clicks hit the composer.+- Which profile actually generated a title is not visible in the UI, the conversation API or the stack logs; `F16.title-model` proves the preference is stored and a title appears, not which model wrote it.+- `onboard --skip` stores analytics off, so a fresh run starts with the switch unchecked even though the code defaults to on when the preference is missing.+- `browser storage` lists `localStorage`, and `browser storage --session` lists `sessionStorage`, where the voice-input key lives. With `--values` that key prints as `<redacted>`, so the recipe reads its dummy value with `eval`. The key disappears in a new tab or browser session by design.+- Deleting a profile through the LLM settings UI clears a matching title preference itself; only a profile removed outside the UI leaves a stale `title_llm_profile` that this page shows as Automatic.+- The Title generation model combobox has a clear (×) button with no accessible name (`- button` in the snapshot, visible as × at phone width). At desktop width it only takes clicks after `browser hover` on the input (`F16.title-model-clear`); otherwise use the Automatic option.+- `browser eval` wraps its argument as an expression: statements separated by `;` fail with `SyntaxError: Unexpected token ';'`; wrap them in `(() => { ...; return x; })()`.+- With `service stop agent-server`, a `browser reload` of `/settings/app` shows the backend-unavailable screen (`agent-server-onboarding-screen`, Manage backends), not the form: stop the service only after the page is loaded, and `restart` afterwards.+- Known product bugs (repro candidates): git identity never reaches the agent (#17899); switches are not keyboard reachable or announced (#17900); a failed save discards the user's edits (`F16.save-states`) (#17927).+- Known issue #17898: a build with `VITE_DO_NOT_TRACK=1` still initializes PostHog and loads scripts from the telemetry host, also with analytics off (`F16.analytics`).+- The title model's clear button has no test id: the recipe's xpath relies on DOM nesting to skip the unnamed `Show suggestions` button. If both ever match, Playwright's strict mode fails the click instead of pressing the wrong one; report it as harness drift.diff --git a/.agents/skills/verify-openhands/references/feature-map/F17-mcp-servers.md b/.agents/skills/verify-openhands/references/feature-map/F17-mcp-servers.mdnew file mode 100644index 0000000000..e9c3756b8b--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F17-mcp-servers.md@@ -0,0 +1,109 @@+# F17 — Customize hub and MCP servers++Customize groups MCP Servers, Skills, Plugins and Apps behind one sidebar+entry. From 1024 px up `/customize` goes straight to `/mcp`; below that (phones+and tablets) it is a list hub. The MCP page lets a user browse a library of catalog+integrations, install one through a modal (credentials masked, optionally also+saved as secrets), hand-author custom SSE, Streamable HTTP or STDIO servers,+test connections, check each installed server's health, enable or disable,+edit and delete servers. Enabled servers are offered to every new+conversation's agent.++Source: `src/routes/extensions-hub.tsx`, `src/routes/mcp.tsx`, `src/components/features/skills/extensions-navigation.tsx`, `src/components/features/skills/extensions-mobile-hub.tsx`, `src/components/features/mcp-page/`, `src/components/features/settings/mcp-settings/mcp-server-form.tsx`, `src/utils/mcp-marketplace-utils.ts`, `src/api/mcp-health/`, `src/utils/mobile-section-nav.ts`.++## Sub-features++- `F17.customize-redirect`: on desktop, the sidebar **Customize** link, the URL `/customize` and the command-menu items **Customize** and **MCP servers** all land on `/mcp`.+- `F17.desktop-subnav`: from 1024 px up, Customize pages show a left aside headed **Customize** with MCP Servers, Skills, Plugins and Apps, the active row marked, and the "synced from" backend badge.+- `F17.mobile-hub`: below 1024 px (phones and tablets), `/customize` is a hub with the same four rows and badge; at phone width detail pages show a Back chevron to the hub; widening the window to 1024 px or more on `/customize` redirects to `/mcp`.+- `F17.cloud-nav`: with a Cloud backend active, Plugins and Apps are hidden and Skills becomes an external link to `<cloud host>/settings/skills` (blocked here).+- `F17.page-states`: `/mcp` shows the **Model Context Protocol (MCP)** header, **Add custom server**, the toolbar, an **Installed** section (empty-state copy when nothing is installed) and the **Library** grid, without page errors.+- `F17.search`: one search box filters the library and the installed list (catalog name, description and args count); no match shows `No matches for your search.` in each section; the X clears it.+- `F17.section-filter`: the All / Installed / Library dropdown shows only the chosen sections.+- `F17.library-catalog`: library cards (logo, name, transport, description, + toggle) open the install modal by click, + toggle or Enter; the modal closes with Cancel, X or Escape.+- `F17.install-remote`: a remote (HTTP) entry shows its fixed URL read-only and a `type="password"` credential field that is required.+- `F17.install-oauth`: an entry whose server runs OAuth itself shows the OAuth info panel instead of a key field.+- `F17.install-unsupported`: entries the local backend cannot install (provider-OAuth only, 12 today such as Sentry) should be hidden or explain themselves; today their modal is empty and Install does nothing (fail).+- `F17.install-args`: an entry with argument fields (Filesystem's **Paths (space separated)**) requires them and appends each whitespace-separated token to the stored command's args.+- `F17.install-stdio`: a STDIO entry shows its read-only command; Install shows `Verifying…`, `Saving...`, toasts `MCP server saved.` and adds a card with the catalog name and description.+- `F17.install-error`: a failed install test keeps the modal open with a red error and saves nothing.+- `F17.save-as-secret`: password credential fields carry **Also save as secret** (checked by default, with a tooltip); after install the value is listed in Settings → Secrets.+- `F17.custom-validation`: the custom editor refuses bad input with an inline message (URL required/invalid/wrong protocol, name invalid or duplicate, command required or with spaces, env/header not `KEY=value`, header required, OAuth secret without client ID, timeout out of range). A malformed header line reuses the environment-variable message (fail).+- `F17.test-connection`: **Test connection** in the editor shows `Verifying…`, then a green `Connected — N tool(s) available` or a red categorized error; Add/Save tests first and stays open on failure.+- `F17.custom-add`: **Add Server** saves and closes; the card is listed after a reload.+- `F17.custom-add-remote`: a custom Streamable HTTP (SHTTP) server with a **Bearer token** connects, saves as an `HTTP` card showing its URL, reopens with the token masked, and its tools reach the agent as `<server>_<tool>`.+- `F17.server-health`: each card's health row runs **Test connection** (`Checking connection…`), then shows a verdict with a coloured dot; a failure is red, worded for the transport (a STDIO command that cannot start, a remote server that cannot be reached) with the Agent Server's detail, and offers **Retry**.+- `F17.enable-disable`: the card toggle disables a server without removing its configuration; the state persists and a disabled server is withheld from new conversations.+- `F17.custom-edit`: clicking a card opens **Edit MCP server** prefilled (secrets shown as `**********`); Save tests and persists the change.+- `F17.delete-server`: **Delete** in the editor asks for confirmation; Cancel keeps the server, Confirm removes it with `MCP server removed.`+- `F17.native-git-tabs`: on a Cloud backend, GitHub/GitLab/Bitbucket offer a recommended native-integration tab next to the MCP tab (blocked here).+- `F17.agent-uses-server`: a conversation started after the save can call the server's tools.+- `F17.phone`: the MCP page, the install modal and the custom editor fit a 390 px viewport.++## How to get to it (user POV)++- Sidebar **Customize** (`sidebar-skills-link`); on desktop it lands on `/mcp`. On a phone, open the drawer (`sidebar-mobile-menu-toggle`) first; it lands on the hub.+- Direct URLs `/customize` and `/mcp`.+- Command menu (`Control+k`/`Meta+k`): **Customize** (to `/customize`, then `/mcp`) and **MCP servers** (to `/mcp`). The menu itself is F02.+- Customize sub-navigation row **MCP Servers** (`sidebar-extensions-/mcp`), desktop aside or phone hub. Pinning Customize as home is F02.+- The onboarding checklist item **Connect an MCP integration** links to `/mcp` and is ticked once a server is configured, before any conversation uses it (F02).+- On `/mcp`: a library card or its + toggle (install modal), **Add custom server** (`mcp-add-custom-server`), an installed card (editor) and its health-row buttons.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) on a fresh run, so nothing is installed yet (`control-openhands api GET /api/settings --pick agent_settings.mcp_config` is `{}`).+- `uvx` and `npx` on the machine. `F17.agent-uses-server`, `F17.custom-add-remote`'s agent check and the disabled-server check need an active LLM profile (`control-openhands llm preset deepseek`).+- TLS-intercepting proxy (this sandbox): MCP stdio servers start with a minimal environment (`HOME`, `PATH`, no proxy or CA variables), so without trust settings `uvx`/`npx` cannot download packages and catalog STDIO installs fail. `launch` now seeds the run's private `HOME` when `SSL_CERT_FILE` or `NODE_EXTRA_CA_CERTS` points at a CA bundle: check with `cat "$OH_VERIFY_RUN/private/home/.config/uv/uv.toml"` (`native-tls = true`) and `cat "$OH_VERIFY_RUN/private/home/.npmrc"` (`cafile=<bundle>`). Only if they are missing, write them once: `mkdir -p "$OH_VERIFY_RUN/private/home/.config/uv"`, `printf 'native-tls = true\n' > "$OH_VERIFY_RUN/private/home/.config/uv/uv.toml"` and `printf 'cafile=/root/.ccr/ca-bundle.crt\n' > "$OH_VERIFY_RUN/private/home/.npmrc"` (use your proxy's CA bundle path). `F17.install-error` moves them aside for one step. Custom servers can also pass `UV_NATIVE_TLS=true` in their env. Skip all of this on a machine with direct internet.+- `F17.custom-add-remote` needs a local Streamable HTTP MCP server (arrange, not proof; no `fixture` verb exists for it yet): from a shell, `cd "$OH_VERIFY_RUN/workspace" && (PORT=38417 nohup npx -y @modelcontextprotocol/server-everything streamableHttp > "$OH_VERIFY_RUN/private/qa-shttp.log" 2>&1 &)`, pick any free port, and wait until the log says `MCP Streamable HTTP Server listening on port 38417`. Stop it in Cleanup by its own PID (`pgrep -f 'server-everything streamableHttp'` lists it; never `pkill -f`).+- `F17.cloud-nav` and `F17.native-git-tabs` need an OpenHands Cloud backend (with git providers configured); not available here.+- Never type real credentials: every key below is a dummy.++- **Desktop entry points (`F17.customize-redirect`).** Run `control-openhands browser goto /conversations`, `control-openhands browser click 'testid=sidebar-skills-link' --expect-url '/mcp(\?|$)'` and `control-openhands browser count 'testid=mcp-page'` (`1`). Run `control-openhands browser goto /customize` and `control-openhands browser wait-url '/mcp(\?|$)'`. Command menu: run `control-openhands browser goto /conversations` (the browser is on `/mcp`, where the URL wait would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' MCP`, `control-openhands browser press Enter` and `control-openhands browser wait-url '/mcp(\?|$)'`; repeat with the term `Customize` (its only option reads `Customize Browse skills, plugins, and integrations.`). Every path ends on `/mcp`.+- **Desktop sub-navigation (`F17.desktop-subnav`).** On `/mcp` run `control-openhands browser text 'testid=extensions-navbar-desktop'`: `Customize`, `MCP Servers`, `Skills`, `Plugins`, `Apps`, then `These settings are synced from Local backend (<base url>)`. `control-openhands browser attr 'testid=sidebar-extensions-/mcp' aria-current` is `page`. Run `control-openhands browser click 'testid=sidebar-extensions-/skills' --expect-url '/skills(\?|$)'`; that row's `aria-current` becomes `page`. Do the same for `/plugins` and `/apps`, then return with `control-openhands browser click 'testid=sidebar-extensions-/mcp' --expect-url '/mcp(\?|$)'`. `control-openhands browser screenshot 'testid=extensions-navbar-desktop' --feature F17.desktop-subnav --name subnav` shows the MCP Servers row highlighted.+- **Phone hub (`F17.mobile-hub`, `F17.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /customize` and `control-openhands browser text 'testid=extensions-mobile-hub'` (the same five lines as the desktop aside); `control-openhands browser screenshot --feature F17.mobile-hub --name hub`. Run `control-openhands browser click 'testid=extensions-mobile-hub >> testid=sidebar-extensions-/mcp' --expect-url '/mcp(\?|$)'`; `control-openhands browser attr 'testid=sidebar-mobile-back-button' aria-label` is `Customize`, and `control-openhands browser count 'testid=extensions-navbar-desktop >> visible'` is `0`. `control-openhands browser bbox 'testid=mcp-page'` has `insideViewport` `true` and `pageHorizontalOverflow` `false`; `control-openhands browser screenshot --feature F17.phone --name mcp-page` shows the header, toolbar and one column of cards. Run `control-openhands browser click 'testid=sidebar-mobile-back-button' --expect-url '/customize(\?|$)'`; `control-openhands browser count 'testid=extensions-mobile-hub'` is `1`. Drawer entry: `control-openhands browser goto /conversations`, `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'` and `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=sidebar-skills-link' --expect-url '/customize(\?|$)'`; the hub is shown. Tablets get the hub too: `control-openhands browser viewport tablet` (820 px) keeps it on `/customize`; run `control-openhands browser click 'testid=extensions-mobile-hub >> testid=sidebar-extensions-/mcp' --expect-url '/mcp(\?|$)'`, then `control-openhands browser visible 'testid=extensions-navbar-desktop'` and `control-openhands browser visible 'testid=sidebar-mobile-back-button'` (both `false`), `control-openhands browser bbox 'role=main'` (520 px wide, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F17.mobile-hub --name tablet-mcp`; the rail's `control-openhands browser click 'testid=sidebar-skills-link' --expect-url '/customize(\?|$)'` brings the hub back. Then `control-openhands browser viewport desktop` and `control-openhands browser wait-url '/mcp(\?|$)'`: widening on `/customize` redirects to `/mcp`.+- **Page and empty state (`F17.page-states`).** On a fresh run run `control-openhands browser goto /mcp`, `control-openhands browser text 'testid=mcp-installed-empty'` (`No MCP servers installed yet.` and `Pick one from the marketplace below to get started.`) and `control-openhands browser count '[data-testid^="mcp-marketplace-card-"]'` (`55` today; the catalog ships with `@openhands/extensions`). `control-openhands browser eval "[...document.querySelectorAll('main h2')].map(h=>h.textContent)"` is `["Model Context Protocol (MCP)","Installed","Library"]`. Take `control-openhands browser screenshot --feature F17.page-states --name empty-desktop`. After the family, `control-openhands browser errors --app-only` shows `pageErrors` `0`.+- **Search (`F17.search`).** Run `control-openhands browser fill 'testid=mcp-search-input' time` and `control-openhands browser count '[data-testid^="mcp-marketplace-card-"]'` (`1`, `mcp-marketplace-card-time`). Fill `qa-zzz-nothing`; `control-openhands browser text 'testid=mcp-marketplace-empty'` is `No matches for your search.` (the installed list's search needs installed cards: it is driven at the end of `F17.install-stdio`). Run `control-openhands browser click 'testid=mcp-search-clear'`; `control-openhands browser value 'testid=mcp-search-input'` is `""` and the card count is back to `55`.+- **Section filter (`F17.section-filter`).** Run `control-openhands browser click 'testid=mcp-section-filter >> testid=dropdown-trigger'`, `control-openhands browser snapshot 'testid=mcp-section-filter'` (`button "Filter MCP servers" [expanded]: All` and `menu "Filter MCP servers"` with `All` [checked], `Installed`, `Library`) and `control-openhands browser click 'testid=mcp-section-filter-library'`; the `main h2` list above loses `Installed`. Open the dropdown again and click `testid=mcp-section-filter-installed`; `control-openhands browser count 'testid=mcp-marketplace-section'` is `0` and `control-openhands browser text 'testid=mcp-section-filter >> testid=dropdown-trigger'` is `Installed`. Restore with `testid=mcp-section-filter-all`.+- **Open and close the install modal (`F17.library-catalog`).** Run `control-openhands browser click 'testid=mcp-marketplace-card-time'`, `control-openhands browser text 'testid=mcp-install-modal'` (`Time`, its description, `View documentation →`, `Command`, `Cancel`, `Install`) and `control-openhands browser value 'testid=mcp-install-field-command-readonly'` (`uvx mcp-server-time`; `browser enabled` is `false`). Close with `control-openhands browser click 'testid=mcp-install-cancel'`; `control-openhands browser count 'testid=mcp-install-modal'` is `0`. Reopen with `control-openhands browser click 'testid=mcp-marketplace-toggle-time'` and close with `control-openhands browser click 'testid=mcp-install-modal-close'`. Keyboard: `control-openhands browser focus 'testid=mcp-marketplace-card-time'`, `control-openhands browser press Enter` (count `1`), `control-openhands browser press Escape` (count `0`).+- **Remote entry, masked key (`F17.install-remote`).** Run `control-openhands browser click 'testid=mcp-marketplace-card-stripe'`; `control-openhands browser value 'testid=mcp-install-modal >> testid=mcp-install-field-url'` is `https://mcp.stripe.com/` and `browser enabled` on it is `false`. Click `testid=mcp-install-modal >> testid=mcp-install-submit` with the key empty: `control-openhands browser eval "document.querySelector('[data-testid=mcp-install-field-api_key]').validationMessage"` is `Please fill out this field.` and no request is sent. Run `control-openhands browser fill 'testid=mcp-install-modal >> testid=mcp-install-field-api_key' rk_test_qa_dummy_000`; `control-openhands browser attr 'testid=mcp-install-modal >> testid=mcp-install-field-api_key' type` is `password` and `control-openhands browser screenshot 'testid=mcp-install-modal' --feature F17.install-remote --name stripe-masked` shows dots. Cancel; never click Install with a dummy key on a hosted server.+- **OAuth entry (`F17.install-oauth`).** Run `control-openhands browser click 'testid=mcp-marketplace-card-granola'` and `control-openhands browser text 'testid=mcp-install-modal >> testid=mcp-install-oauth-info'`: `This server uses OAuth for authentication. Click Install to connect — you will be redirected to authorize access.` and `No API key needed. The server handles the OAuth flow automatically.` The URL field reads `https://mcp.granola.ai/mcp` and there is no `mcp-install-field-api_key`. Cancel; Install would start a real OAuth flow.+- **Entry that cannot be installed (`F17.install-unsupported`).** Run `control-openhands browser click 'testid=mcp-marketplace-card-sentry'`, `control-openhands browser network --clear`, `control-openhands browser click 'testid=mcp-install-modal >> testid=mcp-install-submit'`, then `control-openhands browser network --last 5`, `control-openhands browser count 'testid=mcp-install-modal'` and `control-openhands browser toasts`. Expected: such entries are hidden from the library, or the modal explains that the local backend cannot install them. Today the modal shows only the title, description and docs link, Install sends no request, shows nothing and the modal stays open (fail; `cloudflare-bindings` behaves the same). Cancel.+- **Install fails, modal stays (`F17.install-error`).** Make the server unable to start: behind the TLS proxy, move the seeded trust settings aside (shell arrange: `mv "$OH_VERIFY_RUN/private/home/.config/uv/uv.toml"{,.off}` and `mv "$OH_VERIFY_RUN/private/home/.npmrc"{,.off}`) and use an entry uv has never downloaded in this run, such as Fetch (Time succeeds from the uv cache once installed). Run `control-openhands browser click 'testid=mcp-marketplace-card-fetch'` (`browser value 'testid=mcp-install-field-command-readonly'` is `uvx mcp-server-fetch`) and `control-openhands browser click 'testid=mcp-install-submit' --observe 'testid=mcp-install-submit' --observe-ms 15000`; the observed labels are `Install`, `Verifying… [disabled]`, `Install` (about 6 s). `control-openhands browser text 'testid=mcp-install-modal-error'` is `Connection failed: McpError: Connection closed` and the modal stays open (`<run>/private/stack.log` shows `UnknownIssuer`). An npx entry such as Memory fails differently: after about 17 s the error reads `Connection timed out. Check the URL and try again.` Cancel, `control-openhands browser reload`, and `control-openhands browser count 'testid=mcp-installed-empty'` is still `1` (no `fetch` card). Restore the trust files (`mv ….off` back) before the next bullet.+- **Install a STDIO entry (`F17.install-stdio`).** With the TLS precondition, run `control-openhands browser click 'testid=mcp-marketplace-card-time'` and `control-openhands browser click 'testid=mcp-install-modal >> testid=mcp-install-submit' --observe 'testid=mcp-install-modal >> testid=mcp-install-submit' --observe-ms 20000`: `Install`, `Verifying…`, `Saving...`, then `<absent>` (closed). After `control-openhands browser reload`, `control-openhands browser text 'testid=mcp-server-item >> has-text=Timezone-aware'` is `Time`, `STDIO`, `Timezone-aware current time, conversions, and timestamp formatting.`, `uvx mcp-server-time`, `Not checked yet`, `Test connection`; its `data-server-id` is `time`. Installing it again (same two commands, then `browser reload`) adds a second card (`time_1`): the library is add-only and its + toggle never shows installed (`aria-checked` stays `false`). The copy keeps the Time catalog identity (#18034): `control-openhands browser text '[data-server-id=time_1]'` is `time_1`, `STDIO`, `Timezone-aware current time, conversions, and timestamp formatting.`, `uvx mcp-server-time`, `Not checked yet`, `Test connection` (the title is the settings key because it differs from the catalog id), and `control-openhands browser eval "[...document.querySelectorAll('[data-testid=mcp-server-item]')].map(c=>c.dataset.serverId+':'+c.querySelector('span[aria-hidden=true][title]')?.title)"` is `["time:Time","time_1:Time"]` (both badges come from the Time entry). Time has no logo, so both installed cards show the generic puzzle glyph where its library card shows a robot glyph. Search the installed list: `control-openhands browser fill 'testid=mcp-search-input' Timezone` keeps both cards (`browser eval "[...document.querySelectorAll('[data-testid=mcp-server-item]')].map(c=>c.dataset.serverId)"` is `["time","time_1"]`, matched by the catalog description) and one library card; `control-openhands browser fill 'testid=mcp-search-input' qa-zzz-nothing` makes `control-openhands browser text 'testid=mcp-installed-empty-search'` `No matches for your search.`; clear with `control-openhands browser click 'testid=mcp-search-clear'`. `control-openhands browser screenshot --feature F17.install-stdio --name time-and-time_1` shows both cards with the description.+- **Argument fields (`F17.install-args`).** Run `control-openhands browser click 'testid=mcp-marketplace-card-filesystem'`; `control-openhands browser snapshot 'testid=mcp-install-modal'` shows the read-only `Command` `npx -y @modelcontextprotocol/server-filesystem`, a `Paths (space separated)` field and `Each whitespace-separated token is appended as its own argument.`; `control-openhands browser attr 'testid=mcp-install-modal >> role=link' target` is `_blank` (**View documentation →**, `rel` `noreferrer`). Click `testid=mcp-install-submit` with the field empty: `control-openhands browser eval "document.querySelector('[data-testid=mcp-install-field-paths]').validationMessage"` is `Please fill out this field.` and `browser network` records no request. Shell arrange `mkdir -p "$OH_VERIFY_RUN/workspace/qa-fs-a" "$OH_VERIFY_RUN/workspace/qa-fs-b"`, then `control-openhands browser fill 'testid=mcp-install-modal >> testid=mcp-install-field-paths' "$OH_VERIFY_RUN/workspace/qa-fs-a $OH_VERIFY_RUN/workspace/qa-fs-b"` and `control-openhands browser click 'testid=mcp-install-modal >> testid=mcp-install-submit' --observe 'testid=mcp-install-modal >> testid=mcp-install-submit' --observe-ms 90000` (`Install`, `Verifying…`, `Saving...`, `<absent>`). After `browser reload`, `control-openhands browser text '[data-server-id=filesystem]'` ends the command line with both paths, and `control-openhands api GET /api/settings --pick agent_settings.mcp_config.filesystem` has `args` `["-y","@modelcontextprotocol/server-filesystem","<…>/qa-fs-a","<…>/qa-fs-b"]`.+- **Save as secret (`F17.save-as-secret`).** With the TLS precondition and no `TAVILY_API_KEY` secret (`control-openhands api GET /api/settings/secrets`), run `control-openhands browser click 'testid=mcp-marketplace-card-tavily'`. `control-openhands browser attr 'testid=mcp-install-modal >> testid=mcp-install-field-TAVILY_API_KEY' type` is `password`, `control-openhands browser eval "document.querySelector('[data-testid=mcp-install-save-secret-TAVILY_API_KEY] input').checked"` is `true`, and `control-openhands browser tooltip 'testid=mcp-install-modal >> role=button[name=/secret/i]'` is `MCP credentials aren't shared with automations. Save as a secret to make this value available to automations.` Run `control-openhands browser fill 'testid=mcp-install-modal >> testid=mcp-install-field-TAVILY_API_KEY' tvly-qa-dummy-000` and `control-openhands browser click 'testid=mcp-install-modal >> testid=mcp-install-submit' --observe 'role=status' --observe-ms 60000`; the observed toasts are `MCP server saved.` and `Saved to secrets: TAVILY_API_KEY`. Then `control-openhands browser goto /settings/secrets` and `control-openhands browser count 'testid=secret-item >> has-text=TAVILY_API_KEY'` is `1`. The GitHub card's hosted token has the same toggle (`mcp-install-save-secret-GITHUB_PERSONAL_ACCESS_TOKEN`, checked). Clean up by deleting the `tavily` server (Delete below) and the secret through F14's Delete recipe.+- **Editor validation (`F17.custom-validation`).** Run `control-openhands browser goto /mcp` (Save as secret ends on `/settings/secrets`), `control-openhands browser click 'testid=mcp-add-custom-server'`. With the default SSE type, click `testid=add-mcp-server-form >> testid=submit-button` after each change and read `control-openhands browser text 'testid=add-mcp-server-form >> css=p.text-red-500 >> nth=0'`: empty URL → `URL is required`; `control-openhands browser fill 'testid=add-mcp-server-form >> testid=url-input' 'not a url'` → `Invalid URL format`; `ftp://127.0.0.1/mcp` → `URL must use http:// or https://`; URL `http://127.0.0.1:9/sse` plus `testid=server-name-input` `'bad name'` → `Name can only contain letters, numbers, hyphens, and underscores`; name `qa_sse`, then `control-openhands browser click 'testid=add-mcp-server-form >> testid=auth-mode-dropdown'` and `control-openhands browser click 'role=option[name="Header"]'` → `Header authentication requires a header`; auth `OAuth` with `testid=oauth-client-secret-input` filled `dummy-secret` → `OAuth client secret requires a client ID`. Switch type with `control-openhands browser click 'testid=add-mcp-server-form >> testid=server-type-dropdown'` and `control-openhands browser click 'role=option[name="SHTTP"]'`, set auth back to `None`; `testid=timeout-input` `0` → `Timeout must be positive`, `5000` → `Timeout cannot exceed 3600 seconds (1 hour)`. Switch to `STDIO`: empty → `Name is required`; `testid=name-input` `'bad name!'` → the invalid-name message; name `qa_time` → `Command is required`; `testid=command-input` `'uvx mcp-server-time'` → `Command cannot contain spaces`; command `uvx` plus `testid=env-input` `NOEQUALS` → `Environment variables must follow KEY=value format`. Once a STDIO `qa_time` exists (or any installed STDIO id such as `time`), the same name gives `A STDIO server with this name already exists`. `control-openhands browser press Escape` closes the editor. Header format: reopen the editor, pick `SHTTP`, fill `url-input` `http://127.0.0.1:9/mcp`, auth `Header`, `control-openhands browser fill 'testid=add-mcp-server-form >> testid=headers-input' NOEQUALS` and submit. Expected a header-specific message; today it reads `Environment variables must follow KEY=value format` (fail: the header check reuses the env validator's copy).+- **Test connection (`F17.test-connection`).** Failure: in an SHTTP form with URL `http://127.0.0.1:9/mcp` and timeout `10`, click `testid=add-mcp-server-form >> testid=mcp-test-connection`, `control-openhands browser wait 'testid=add-mcp-server-form >> testid=mcp-test-message' --timeout 60000`; the text is `Could not reach the server (check the URL and server type): Client failed to connect: All connection attempts failed` (the remote wording followed by the Agent Server's detail) and its class contains `text-red-500`. Clicking **Add Server** leaves the editor open (`browser count 'testid=mcp-custom-editor'` is `1`). Success: in a STDIO form fill `testid=name-input` `qa_time`, `testid=command-input` `uvx`, `control-openhands browser fill 'testid=add-mcp-server-form >> testid=args-input' mcp-server-time` and `control-openhands browser fill 'testid=add-mcp-server-form >> testid=env-input' UV_NATIVE_TLS=true`, then `control-openhands browser click 'testid=add-mcp-server-form >> testid=mcp-test-connection' --observe 'testid=add-mcp-server-form >> testid=mcp-test-connection' --observe-ms 20000` (`Test connection`, `Verifying…`, `Test connection`), the same `wait` and `control-openhands browser text 'testid=add-mcp-server-form >> testid=mcp-test-message'`: `Connected — 2 tool(s) available`, class `text-green-500`. `control-openhands browser screenshot 'testid=mcp-custom-editor' --feature F17.test-connection --name stdio-success`.+- **Add the server (`F17.custom-add`).** In the successful STDIO form run `control-openhands browser click 'testid=add-mcp-server-form >> testid=submit-button'` and `control-openhands browser wait 'testid=mcp-custom-editor' --state detached --timeout 60000`, then `control-openhands browser reload` and `control-openhands browser text 'testid=mcp-server-item >> has-text=qa_time'`: `qa_time`, `STDIO`, `Timezone-aware current time, conversions, and timestamp formatting.`, `uvx mcp-server-time`, `Not checked yet`, `Test connection` (it runs the Time entry's command and args, so it shows that entry's description and badge under its own name, #18034). `control-openhands browser attr 'testid=mcp-server-item >> has-text=qa_time' data-server-id` is `qa_time` (the id in the per-card test ids below) and its `aria-label` is `Edit qa_time`.+- **Custom remote server (`F17.custom-add-remote`).** With the Streamable HTTP fixture from Preconditions running, run `control-openhands browser click 'testid=mcp-add-custom-server'`, pick `SHTTP` (`server-type-dropdown`, then `role=option[name="SHTTP"]`), fill `testid=add-mcp-server-form >> testid=server-name-input` `qa_shttp` and `url-input` `http://127.0.0.1:38417/mcp`, pick auth `Bearer token` (`auth-mode-dropdown`, then `role=option[name="Bearer token"]`) and fill `testid=add-mcp-server-form >> testid=api-key-input` `qa-dummy-token` (`browser attr ... type` is `password`). Click `testid=add-mcp-server-form >> testid=mcp-test-connection`; `control-openhands browser text 'testid=add-mcp-server-form >> testid=mcp-test-message' --timeout 60000` is `Connected — 13 tool(s) available`. Click `testid=add-mcp-server-form >> testid=submit-button`, wait for `testid=mcp-custom-editor` to detach and `browser reload`: `control-openhands browser text '[data-server-id=qa_shttp]'` is `qa_shttp`, `HTTP`, `http://127.0.0.1:38417/mcp`, `Not checked yet`, `Test connection`; `control-openhands api GET /api/settings --pick agent_settings.mcp_config.qa_shttp` has `transport` `http` and `auth` `{"strategy":"bearer","value":"**********"}`. Its health probe reads `Reachable — credentials not verified`. Reopen it with `control-openhands browser click 'testid=mcp-server-detail-qa_shttp'`: `browser snapshot 'testid=mcp-custom-editor'` shows `Edit MCP server`, combobox `Authentication` `Bearer token`, and `control-openhands browser value 'testid=edit-mcp-server-form >> testid=api-key-input'` is `**********`; Escape. Agent side: `control-openhands conversation start --prompt "Call the qa_shttp MCP server's echo tool with message qa-ping. Do not use the terminal. Reply with only the tool's output." --wait --timeout 240`, then `control-openhands conversation events <id> --kinds ActionEvent,ObservationEvent,MessageEvent`: tool `qa_shttp_echo`, observation `Echo: qa-ping`. Run `control-openhands browser goto /mcp` afterwards.+- **Card health (`F17.server-health`).** Run `control-openhands browser click 'testid=mcp-health-probe-qa_time' --observe 'testid=mcp-health-label-qa_time' --observe-ms 20000`: `Not checked yet`, `Checking connection…`, `Reachable — credentials not verified`. `control-openhands browser text 'testid=mcp-server-health-qa_time'` adds the hint `This check only proves the server is reachable and lists its tools; it does not verify your credentials.`, `control-openhands browser attr 'testid=mcp-server-health-qa_time >> testid=mcp-health-dot' data-status` is `healthy-connectivity`, and the click did not open the editor (`browser count 'testid=mcp-custom-editor'` is `0`). Failure: the editor refuses to save a broken server, so arrange one with `control-openhands api POST /api/settings/mcp/qa_broken --data '{"transport":"stdio","command":"qa-no-such-command","enabled":false}' --write`, `control-openhands browser reload`, then click `testid=mcp-health-probe-qa_broken`: the label is `Could not start the server command: Client failed to connect: [Errno 2] No such file or directory: 'qa-no-such-command'` in red (STDIO wording, no URL hint; the card clamps it to two lines, `browser text 'testid=mcp-server-health-qa_broken'` reads it whole), the dot's `data-status` is `failed` and the button reads `Retry`; `control-openhands browser screenshot 'testid=mcp-server-item >> has-text=qa_broken' --feature F17.server-health --name failed`.+- **Delete (`F17.delete-server`).** Run `control-openhands browser click 'testid=mcp-server-detail-qa_broken'` (a click on the card's centre lands on its health row and opens nothing: see Gotchas), `control-openhands browser click 'testid=mcp-custom-editor-delete'` and `control-openhands browser text 'testid=confirmation-modal'` (`Are you sure you want to delete this server?`, `Cancel`, `Confirm`). Run `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'`; the editor is still open. Click Delete again, then `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'` and `control-openhands browser toasts` (`MCP server removed.`). After `control-openhands browser reload`, `control-openhands browser count 'testid=mcp-server-item >> has-text=qa_broken'` is `0`, and `control-openhands api GET /api/settings` has no `qa_broken`.+- **Edit (`F17.custom-edit`).** Run `control-openhands browser click 'testid=mcp-server-detail-qa_time'` (the detail line opens the editor on every card; a plain click on the card's centre happens to open it on `qa_time`, whose Time description fills the centre, but not on a card without a description; keyboard: `browser focus '[data-server-id=qa_time]'` then `browser press Enter`) and `control-openhands browser snapshot 'testid=mcp-custom-editor'`: heading `Edit MCP server`, no Server Type field, a `Delete` button; `control-openhands browser value 'testid=edit-mcp-server-form >> testid=env-input'` is `UV_NATIVE_TLS=**********`. Run `control-openhands browser fill 'testid=edit-mcp-server-form >> testid=args-input' $'mcp-server-time\n--local-timezone\nUTC'` (bash ANSI-C quoting for the newlines), click `testid=edit-mcp-server-form >> testid=mcp-test-connection` (still `Connected — 2 tool(s) available`: the stored env value is reused), then `control-openhands browser click 'testid=edit-mcp-server-form >> testid=submit-button'` and wait for `testid=mcp-custom-editor` to detach. The card shows a verdict at once (seeded from the save's test). After `control-openhands browser reload`, `control-openhands browser text 'testid=mcp-server-detail-qa_time'` is `uvx mcp-server-time --local-timezone UTC`.+- **The agent uses it (`F17.agent-uses-server`).** With `qa_time` enabled run `control-openhands conversation start --prompt "Use the qa_time MCP server's get_current_time tool with timezone UTC. Do not use the terminal. Reply with only the tool's datetime value." --wait --timeout 240`, then `control-openhands conversation events <id> --kinds ActionEvent,ObservationEvent,MessageEvent` with the `id` it printed. There is an `ActionEvent` with tool `qa_time_get_current_time` (MCP tools reach the agent as `<server id>_<tool>`), its observation reads `[Tool 'qa_time_get_current_time' executed.] { "timezone": "UTC", "datetime": … }`, and the agent's reply is that `datetime`. `control-openhands conversation events <id> --grep qa_time_get_current_time --from-start` also matches the `SystemPromptEvent` (the tool was offered). `control-openhands browser screenshot --feature F17.agent-uses-server --name conversation` shows the tool step (its title is model-written, e.g. `Get current time in UTC via qa_time MCP`) and the datetime reply. `conversation start` leaves the browser on the conversation: `control-openhands browser goto /mcp` next.+- **Enable and disable (`F17.enable-disable`).** On `/mcp` run `control-openhands browser attr 'testid=mcp-installed-toggle-qa_time' aria-checked` (`true`; `aria-label` `Disable server`), `control-openhands browser click 'testid=mcp-installed-toggle-qa_time'`, `control-openhands browser reload` and the same `attr` (`false`; label `Enable server`). `control-openhands api GET /api/settings` shows `agent_settings.mcp_config.qa_time.enabled` `false` with command, args and env intact; `control-openhands browser screenshot 'testid=mcp-server-item >> has-text=qa_time' --feature F17.enable-disable --name disabled` shows the + icon. With no other server exposing that tool, run `control-openhands conversation start --prompt "Without running any command: is a tool named get_current_time available to you right now? Reply with only YES or NO." --wait --timeout 240`; the reply is `NO`, `control-openhands api GET /api/conversations/<id> --pick agent.mcp_config.qa_time.enabled` is `false`, and `control-openhands conversation events <id> --grep qa_time_get_current_time --from-start` has `count` `0` (no `SystemPromptEvent` lists it). Then `control-openhands browser goto /mcp`. Click the toggle again and reload; it is `true`.+- **Phone modals (`F17.phone`).** At `browser viewport phone` on `/mcp` run `control-openhands browser click 'testid=mcp-add-custom-server'`, `control-openhands browser bbox 'testid=mcp-custom-editor'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F17.phone --name custom-editor`; close with `testid=mcp-custom-editor-close`. Do the same for `testid=mcp-marketplace-card-stripe` with `testid=mcp-install-modal` (`--name install-modal`), then `control-openhands browser viewport desktop`.+- **Cloud backend (`F17.cloud-nav`, `F17.native-git-tabs`).** Blocked without an OpenHands Cloud backend. On the local backend `control-openhands browser click 'testid=mcp-marketplace-card-github'` shows only the MCP form (`browser count 'testid=mcp-install-tab-native'` is `0`). With Cloud active, `browser text 'testid=extensions-navbar-desktop'` should list only MCP Servers and the cloud Skills link (`browser attr 'testid=sidebar-extensions-/skills' href` ends in `/settings/skills`), and the GitHub modal should show `mcp-install-tab-native` (Recommended) and `mcp-install-tab-mcp`.+- **Cleanup.** On `/mcp` (not the conversation page `conversation start` left open), delete `qa_time`, `qa_shttp` and any `time`, `time_1`, `tavily`, `filesystem` cards through the editor's Delete: for each id, `browser focus '[data-server-id=<id>]'`, `browser press Enter`, `browser click 'testid=mcp-custom-editor-delete'`, `browser click 'testid=confirmation-modal >> testid=confirm-button'`, `browser wait '[data-server-id=<id>]' --state detached --timeout 10000`. After `browser reload`, `browser count 'testid=mcp-installed-empty'` is `1` and `api GET /api/settings --pick agent_settings.mcp_config` is `{}`. Delete the `TAVILY_API_KEY` secret on `/settings/secrets` (F14: `testid=secret-item >> has-text=TAVILY_API_KEY >> testid=delete-secret-button`, then `testid=confirmation-modal >> testid=confirm-button`), stop the Streamable HTTP fixture by its PID, and restore `deepseek-flash` as the active profile if you changed it.++## Gotchas++- Desktop `/customize` is a client-side redirect: `browser url` may still read `/customize` for a moment; use `wait-url '/mcp(\?|$)'`.+- From 768 to 1023 px the sidebar rail stays and the top bar is gone, so a Customize detail page shows neither the aside nor a Back chevron; the rail's **Customize** link (`sidebar-skills-link`, unscoped at this width) returns to the hub.+- On a phone the drawer and the hidden desktop rail both render `sidebar-skills-link`; scope it with `testid=sidebar-mobile-drawer >> ...` or the click fails with a strict-mode error, even though `browser testids` lists it once.+- Editor dropdowns are comboboxes: click `server-type-dropdown` or `auth-mode-dropdown`, then `role=option[name="..."]`. Server types read `SSE`, `STDIO` and `SHTTP` (not "Streamable HTTP"); auth modes read `None`, `Bearer token`, `Header` and `OAuth`. The type dropdown exists only when adding.+- The timeout field is `type="number"`: `browser fill` refuses letters, so `Timeout must be a valid number` cannot be reached from the UI.+- A red test message stays on screen when a later validation error appears, so `css=p.text-red-500` can match two paragraphs; take `>> nth=0` (the validation error comes first).+- Install-modal required fields use native browser validation (a tooltip, no paragraph): assert `validationMessage`.+- The installed and library toggles are `role=switch` buttons: read `aria-checked`, not `aria-pressed`.+- MCP stdio servers start with a minimal environment. Behind a TLS-intercepting proxy, without trust settings in the run's private `HOME`, `uvx` catalog installs fail with `Connection closed` (`<run>/private/stack.log` shows `UnknownIssuer`) and `npx` ones with `Connection timed out`. That is the sandbox, not the product. `launch` now seeds the trust files from `SSL_CERT_FILE`/`NODE_EXTRA_CA_CERTS`, so a fresh run installs fine and `F17.install-error` must move them aside; once a package is in the run's uv cache it installs even without them.+- An installed card's health row swallows clicks (so the probe button does not open the editor). On a card without a catalog description (`qa_broken`) that row is the card's centre, so a plain card click opens nothing; a catalog description moves it down. Open the editor by the card's name or `mcp-server-detail-<id>` line, or focus the card and press Enter.+- `conversation start` leaves the browser on the conversation page; every MCP-page command after it needs `browser goto /mcp` first, or the per-card selectors silently wait on a page that has none.+- `@modelcontextprotocol/server-everything sse` printed `Server is running` here but never answered on its port; use the `streamableHttp` mode for the remote-server fixture.+- A server without a catalog credential probe reads `Reachable — credentials not verified`, never `Connected — credentials verified (N tool(s))`, even without credentials. Health after a save is seeded from the pre-save test and is lost on reload (`Not checked yet`).+- Adding a custom server shows no toast; only catalog installs and deletes toast. Assert the card after reload.+- Catalog installs are add-only: a second Time install becomes `time_1`. Since #18034 (closed #17930) STDIO servers match the catalog by command plus leading args instead of by name, so `time_1` and a custom server that runs a catalog command under its own name (`qa_time`) keep that entry's description, badge and search keywords, while a server that only borrows a catalog name does not (a STDIO `fetch` running `qa-no-such-command` shows only its command) (`F17.install-stdio`, `F17.custom-add`). Twelve library entries (provider-OAuth-only, such as Sentry, HubSpot or the Cloudflare OAuth servers) open an empty modal whose Install does nothing (`F17.install-unsupported`) (#17922).+- The section filter's trigger and menu are named `Filter MCP servers` since #18035 (closed #17939); a checkout without it reuses the conversation filter's `Filter conversations`. The test ids work on both.+- A malformed header line in the custom editor shows `Environment variables must follow KEY=value format` (`mcp-server-form.tsx` runs headers through `validateEnvFormat`) (#17958); see `F17.custom-validation`.+- Known issue #17941: turning off an enabled card toggle can drop the click when the pointer moves in and presses at once (`F17.enable-disable`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F18-skills.md b/.agents/skills/verify-openhands/references/feature-map/F18-skills.mdnew file mode 100644index 0000000000..05318893ef--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F18-skills.md@@ -0,0 +1,96 @@+# F18 — Skills catalog++The Skills page (Customize → Skills, `/skills`) lists every skill the backend can+load: the built-in catalog bundled with the frontend plus personal and project+skills reported by the Agent Server. A user searches and filters the cards+(filters are mirrored into the URL), opens a detail modal, switches skills on or+off (saved to settings straight away, effective for new conversations only),+launches a skill into chat, and reads how to add one with `/add-skill`; after the+agent installs a skill in a conversation, a banner offers a fresh conversation+that loads it.++Source: `src/routes/skills-settings.tsx`, `src/components/features/skills/`, `src/hooks/use-skill-enablement.ts`, `src/utils/skill-enablement.ts`, `src/hooks/use-launch-skill-in-chat.ts`, `src/api/skills-service.ts`, `src/components/features/chat/skill-install-restart-banner.tsx`, `src/utils/skill-install-events.ts`.++## Sub-features++- `F18.page`: the page shows the title, description, the notice "Skill changes apply to new conversations only.", an **Add skill** button, a result count, the facet rail and the card grid. (Empty state "No skills found." and loading skeletons are not reachable on a local backend.)+- `F18.search`: typing filters cards by name, description, content or trigger; after 300 ms the query is mirrored to `?q=` without a new history entry; the X clears it; no match shows "No skills match your search."+- `F18.search-history`: browser Back/Forward put the matching query back into the search box.+- `F18.facets`: the desktop facet rail (State, Recommendation, Source, Category, Type) filters with per-row counts, writes canonical URL params, disables zero-count rows and offers **Clear filters**; deep links apply and unknown values are dropped.+- `F18.filters-modal`: below 768 px the rail is replaced by a **Filters** button with an active-count badge that opens the same facets in a modal with Clear filters and Close.+- `F18.card`: each card shows icon, name, source, a two-line description and pills; extra pills collapse into a `+N` popover; click, Enter or Space opens the detail modal.+- `F18.copy-source`: personal and project skills (path sources) have a copy-path button on the card and in the modal that flips to "Copied to clipboard" for 2 s; built-in skills (source `public`) have none.+- `F18.toggle`: the card's plus/check toggle switches a built-in skill on or off; the choice survives a reload (`enabled_skills` allow-list on a local backend).+- `F18.toggle-local`: switching a personal/project skill off writes `disabled_skills`; new conversations then do not load it, and do again once it is back on.+- `F18.toggle-error`: a failed save shows an error toast and nothing is persisted.+- `F18.skill-in-chat`: an enabled skill is loaded into new conversations and fires on its trigger; a disabled one is not.+- `F18.detail-modal`: the detail modal shows source, an Enabled/Disabled switch, description, pills and the read-only content; switching off disables **Use skill**.+- `F18.detail-close`: the X, **Close**, Escape and a backdrop click close the detail modal.+- `F18.detail-pills`: the modal shows the full pill set (type, category, recommended, license, compatibility, version, triggers); pills that do not fit collapse into a `+N` button whose popover lists the rest without closing the modal.+- `F18.use-skill`: **Use skill** closes the modal, opens `/conversations` and pre-fills the composer with `/<skill-name> `.+- `F18.add-skill-modal`: **Add skill** opens an instructions-only modal with a copyable `/add-skill` example (which must point at an existing skill), steps, URL formats, storage notes and a docs link; Close, X and Escape close it.+- `F18.install-banner`: after the agent installs a skill with `/add-skill`, the conversation shows "Installed to this workspace: …" with **Start new conversation with this skill** (same workspace) and a dismiss X (session-only).+- `F18.phone`: at 390 px the page, cards and both modals fit without horizontal overflow; `/customize` shows a hub that links to Skills and the header back button returns to it.+- `F18.cloud-link`: with a Cloud backend the Customize **Skills** item opens the Cloud skills page in a new tab instead of `/skills` (blocked here).++## How to get to it (user POV)++- Sidebar **Customize** (`sidebar-skills-link`, goes to `/customize`, which redirects to `/mcp` on desktop), then **Skills** in the Customize navigation (`sidebar-extensions-/skills`).+- Direct URL `/skills`, with optional filters: `/skills?q=docker&state=enabled&recommendation=recommended&source=project&category=agent-authoring&type=knowledge`.+- Command menu (`Control+k`/`Meta+k`): searching "Skills" lists only **Customize** ("Browse skills, plugins, and integrations."), which lands on `/mcp`; then click Skills. There is no direct Skills command.+- Phone: `/customize` shows the Customize hub (`extensions-mobile-hub`) with a Skills row; on `/skills` the header back button (`sidebar-mobile-back-button`) returns to the hub.+- Install banner: inside a conversation, after the agent ran `/add-skill <GitHub URL>` (local backend only).+- Cloud: Customize → **Skills** on a Cloud backend (external link).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done); desktop viewport unless a bullet says otherwise.+- A fresh run lists only the bundled catalog, `<N>` skills, all with source `public`. `<N>` is the catalog length the checkout bundles: run `node --input-type=module -e "import {SKILLS_CATALOG} from '@openhands/extensions/skills'; console.log(SKILLS_CATALOG.length)"` in the checkout (68 with `@openhands/extensions` 0.29.0, #17998). The Source and Type facet groups stay hidden until a personal/project skill exists. `add-javadoc` and `flarglebargle` are off; `docker` is on (recommended).+- `F18.skill-in-chat`, `F18.toggle-local`, `F18.copy-source` and `F18.install-banner` need an active LLM profile (`control-openhands llm preset deepseek`). `F18.install-banner` also needs the agent to reach github.com.+- Personal skill fixture (arranged through the agent, not proof): run `control-openhands conversation start --prompt 'Use one shell command to create the file ~/.agents/skills/qa-hello/SKILL.md (create the folders) with exactly these 7 lines: "---", "name: qa-hello", "description: QA test skill that answers qa-ping with QA-PONG-7731.", "triggers:", "- qa-ping", "---", "When the user says qa-ping, reply with exactly QA-PONG-7731 and nothing else." Then reply done.' --wait --timeout 240`. Afterwards `/skills` shows `<N+1> result(s)` and a `qa-hello` card (type pill `Auto-discovery`), and the Enabled facet count goes from 12 to 13.+- `F18.cloud-link` needs an OpenHands Cloud backend and account (blocked in a sandbox).++- **Open from the sidebar (`F18.page`).** From `/` run `control-openhands browser click 'testid=sidebar-skills-link' --expect-url '/mcp(\?|$)'`, `control-openhands browser click 'testid=sidebar-extensions-/skills' --expect-url '/skills(\?|$)'`, then `control-openhands browser text 'testid=skills-settings-description'` (`Discover skills to add to your workspace. Search above the cards or filter by state, recommendation, and category, then open a card to see its details and use the skill. Enable or disable default skills. Disabled skills will not be loaded into agent context.`, describing this layout since #18035), `control-openhands browser text 'testid=skills-new-conversation-notice'` (`Skill changes apply to new conversations only.`) and `control-openhands browser text 'testid=skills-result-summary'` (`<N> result(s)` on a fresh run). `control-openhands browser screenshot --feature F18.page --name desktop` shows the Customize nav, the facet rail and the card grid.+- **Command-menu entry (`F18.page`).** From `/` run `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Skills`, `control-openhands browser snapshot 'testid=command-menu'` (one option, `Customize Browse skills, plugins, and integrations. Go`), `control-openhands browser press Enter`, `control-openhands browser wait-url '/mcp(\?|$)'`, then `control-openhands browser click 'testid=sidebar-extensions-/skills' --expect-url '/skills(\?|$)'`.+- **Search (`F18.search`).** On `/skills` run `control-openhands browser fill 'testid=skills-search-input' docker`, `control-openhands browser text 'testid=skills-result-summary'` (`6 result(s)` on a fresh run: content matches count too) and, a second later, `control-openhands browser url` (ends in `/skills?q=docker`); `control-openhands browser eval "history.length"` is the same before and after typing. Then `control-openhands browser fill 'testid=skills-search-input' zzqa-nomatch` and `control-openhands browser text 'testid=skills-no-match'`: `No skills match your search.` with `0 result(s)`. Clear with `control-openhands browser click 'testid=skills-toolbar >> role=button[name="Clear search"]'`; `control-openhands browser value 'testid=skills-search-input'` is empty, the full count is back and `?q=` leaves the URL.+- **Back and forward (`F18.search-history`).** Run `control-openhands browser goto '/skills?q=docker'`, `control-openhands browser click 'testid=skill-facet-state-enabled'` (pushes `?q=docker&state=enabled`), `control-openhands browser fill 'testid=skills-search-input' github`, wait a second, then `control-openhands browser back` and `control-openhands browser value 'testid=skills-search-input'`: `docker`, URL `/skills?q=docker`. `control-openhands browser forward` gives `github` and `/skills?q=github&state=enabled`.+- **Facets (`F18.facets`).** On `/skills` run `control-openhands browser click 'testid=skill-facet-recommendation-recommended'` (URL `?recommendation=recommended`, `12 result(s)`), `control-openhands browser click 'testid=skill-facet-state-enabled'` (URL `?state=enabled&recommendation=recommended`: canonical order, not click order), `control-openhands browser attr 'testid=skill-facet-state-enabled' aria-checked` (`true`), `control-openhands browser enabled 'testid=skill-facet-state-disabled'` (`false`, its count reads `0`), `control-openhands browser click 'testid=skill-facet-category-agent-authoring'` (`8 result(s)`), then `control-openhands browser click 'testid=skills-clear-filters'`: URL `/skills`, all results, and `control-openhands browser count 'testid=skills-clear-filters'` is `0`.+- **Source and Type facets (`F18.facets`).** With the `qa-hello` fixture, `control-openhands browser text 'testid=skill-facet-group-source'` lists `This project 1` and `Built in <N>`, and `testid=skill-facet-group-type` lists `Auto-discovery 1` and `Trigger-based <N>`. `control-openhands browser click 'testid=skill-facet-source-project'` gives `?source=project` and `1 result(s)`; after Clear filters, `control-openhands browser click 'testid=skill-facet-type-agentskills'` gives `?type=agentskills` and only `qa-hello` (`control-openhands browser eval "[...document.querySelectorAll('[data-testid^=skill-name-]')].map(e=>e.textContent).join(',')"`). Clear filters again.+- **Deep link (`F18.facets`).** Run `control-openhands browser goto '/skills?category=bogus&type=knowledge&source=project'` on a fresh run, `control-openhands browser text 'testid=skills-result-summary'` (`0 result(s)`) and `control-openhands browser text 'testid=skill-facet-group-source'`: `SOURCE`, `This project 0`, `Built in <N>`. A URL selection keeps its group visible even when it matches nothing, and `bogus` is ignored. Clear with `testid=skills-clear-filters`.+- **Card and pill overflow (`F18.card`).** Run `control-openhands browser testids 'testid=skill-card-add-javadoc'` (name, `skill-source-add-javadoc` = `public`, `skill-toggle-add-javadoc`, description, pills, `skill-triggers-add-javadoc-overflow` labelled `Show 2 more`), `control-openhands browser click 'testid=skill-triggers-add-javadoc-overflow'` and `control-openhands browser text 'testid=skill-triggers-add-javadoc-overflow-popover'` (`java documentation`, `document java`); `control-openhands browser count 'testid=skill-detail-modal'` stays `0`. `control-openhands browser screenshot --feature F18.card --name overflow-popover`, then `control-openhands browser press Escape`.+- **Keyboard open (`F18.card`).** Run `control-openhands browser focus 'testid=skill-card-docker'`, `control-openhands browser press Enter` and `control-openhands browser attr 'testid=skill-detail-modal' data-skill-name` (`docker`); `control-openhands browser press Escape`, focus again, `control-openhands browser press Space` and `control-openhands browser count 'testid=skill-detail-modal'` (`1`). Escape closes it.+- **Copy the source path (`F18.copy-source`).** With the `qa-hello` fixture, `control-openhands browser attr 'testid=skill-source-qa-hello' title` is the full `…/.agents/skills/qa-hello/SKILL.md` path. Run `control-openhands browser click 'testid=skill-copy-source-qa-hello'`, `control-openhands browser attr 'testid=skill-copy-source-qa-hello' aria-label` (`Copied to clipboard`; `count 'testid=skill-detail-modal'` stays `0`), `control-openhands browser clipboard` (`text` is the same full `SKILL.md` path) and, after 2 s, the same `attr` (`Copy source path`). In the modal (`control-openhands browser click 'testid=skill-card-qa-hello'`) `control-openhands browser click 'testid=skill-modal-copy-source-qa-hello'` turns its label to `Copied to clipboard` and the modal stays open. `count 'testid=skill-copy-source-add-javadoc'` is `0`.+- **Toggle a built-in skill (`F18.toggle`).** Run `control-openhands browser attr 'testid=skill-toggle-add-javadoc' aria-checked` (`false`; `aria-label` is `Enable skill`), `control-openhands browser click 'testid=skill-toggle-add-javadoc'` (no modal opens; `aria-checked` turns `true` and the Enabled facet count goes up by one), wait a second, `control-openhands browser reload` and read `aria-checked` again: `true`. `control-openhands api GET /api/settings --pick misc_settings.app_preferences.enabled_skills` lists `add-javadoc` (`--pick` paths start inside `body`). To switch an enabled skill off from its card, `control-openhands browser hover 'testid=skill-toggle-add-javadoc'` first (`attr ... data-showing-remove` is `true`), then click (see Gotchas).+- **Toggle a personal skill (`F18.toggle-local`).** Run `control-openhands browser hover 'testid=skill-toggle-qa-hello'`, `control-openhands browser click 'testid=skill-toggle-qa-hello'`, wait a second, `control-openhands browser reload` and `control-openhands browser attr 'testid=skill-toggle-qa-hello' aria-checked` (`false`). `control-openhands api GET /api/settings` shows `disabled_skills: ["qa-hello"]` under `body.misc_settings.app_preferences` and `enabled_skills` without it. `control-openhands conversation start --prompt "qa-ping" --wait --timeout 240`, then `control-openhands api GET '/api/conversations/<id>/events/search?limit=5' --max-bytes 2000000` (id from `conversation start`): the user `MessageEvent` has `"activated_skills": []`. Back on `/skills` (`control-openhands browser goto /skills`; `conversation start` left the browser on the conversation), click the toggle on again (no hover needed), start another `qa-ping` conversation: `"activated_skills": ["qa-hello"]` and `control-openhands browser text 'testid=agent-message >> nth=-1'` is `QA-PONG-7731`; `disabled_skills` is `[]` again.+- **Skill reaches chat (`F18.skill-in-chat`).** Run `control-openhands browser goto /skills` (the previous bullet ends on a conversation), `control-openhands browser click 'testid=skill-toggle-flarglebargle'` (`aria-checked` `true`), then `control-openhands conversation start --prompt "flarglebargle" --wait --timeout 240`, `control-openhands api GET '/api/conversations/<id>/events/search?limit=5' --max-bytes 2000000` (`"activated_skills": ["flarglebargle"]`) and `control-openhands browser text 'testid=agent-message >> nth=-1'` (a reply praising how smart the user is). `control-openhands browser screenshot --feature F18.skill-in-chat --name enabled`. Switch it off again on `/skills` (`control-openhands browser goto /skills`, hover, click; `enabled_skills` no longer lists it) and start another `flarglebargle` conversation: `"activated_skills": []` and the agent says it does not recognise the word.+- **Save failure (`F18.toggle-error`).** Run `control-openhands browser goto /skills`, wait for `testid=skill-toggle-add-javadoc` and note its `aria-checked` (`true` when this follows the toggle bullet, which left `add-javadoc` on). Then `control-openhands service stop agent-server`, `control-openhands browser click 'testid=skill-toggle-add-javadoc' --timeout 5000` (the card flips at once), wait about 2 s (the `PATCH /api/settings` is tried three times before the error shows; `browser network` lists three `502`s) and `control-openhands browser toasts --history`: `HTTP request failed (502 Bad Gateway): "Bad Gateway: connect ECONNREFUSED 127.0.0.1:<agent-server port>"`. `control-openhands browser screenshot --feature F18.toggle-error --name toast`. Run `control-openhands restart --timeout 240`, `control-openhands browser goto /skills`: `aria-checked` on `testid=skill-toggle-add-javadoc` is back to the value noted before the click and `enabled_skills` is unchanged. Clear the expected 502 noise with `control-openhands browser errors --clear`.+- **Detail modal and switch (`F18.detail-modal`).** With `add-javadoc` on, run `control-openhands browser click 'testid=skill-card-add-javadoc'`, `control-openhands browser testids 'testid=skill-detail-modal'` (name, source, `skill-modal-enable-row-add-javadoc`, description, pills incl. license `MIT`, `skill-modal-field-content-add-javadoc`, `skill-detail-close`, `skill-detail-use-skill-add-javadoc`) and `control-openhands browser enabled 'testid=skill-detail-use-skill-add-javadoc'` (`true`). Switch off with `control-openhands browser click 'testid=skill-modal-enable-row-add-javadoc >> text=Enabled'`; `control-openhands browser eval "document.querySelector('[data-testid=skill-modal-toggle-add-javadoc]').checked"` is `false`, the row reads `Disabled`, `enabled` on Use skill is `false` and the card toggle behind reads `aria-checked` `false`. `control-openhands browser screenshot --feature F18.detail-modal --name disabled`. Close, reload: the card stays off and `enabled_skills` no longer lists `add-javadoc`.+- **Close the modal (`F18.detail-close`).** With `testid=skill-card-docker` opened each time, each of `control-openhands browser click 'testid=skill-detail-modal-close'`, `control-openhands browser click 'testid=skill-detail-close'`, `control-openhands browser press Escape` and `control-openhands browser mouse-click 100 500` (backdrop) leaves `control-openhands browser count 'testid=skill-detail-modal'` at `0`.+- **Pill overflow in the modal (`F18.detail-pills`).** Run `control-openhands browser click 'testid=skill-card-add-javadoc'`, `control-openhands browser text 'testid=skill-modal-pills-add-javadoc'` (`Trigger-based`, `Code quality & review`, `MIT`, `Requires Java source files`, `+3`; license and compatibility appear only in the modal), `control-openhands browser attr 'testid=skill-modal-pills-add-javadoc-overflow' aria-label` (`Show 3 more`), `control-openhands browser click 'testid=skill-modal-pills-add-javadoc-overflow'` and `control-openhands browser text 'testid=skill-modal-pills-add-javadoc-overflow-popover'` (`javadoc`, `java documentation`, `document java`); `count 'testid=skill-detail-modal'` stays `1`. `control-openhands browser screenshot --feature F18.detail-pills --name popover`. Close the popover with `control-openhands browser click 'testid=skill-modal-description-add-javadoc'` (popover count `0`, modal still open), then `control-openhands browser press Escape`. Expected as well: Escape with the popover open closes the popover (as it does on a card); at 0c446b8 it closes neither the popover nor the modal (see Gotchas).+- **Use skill (`F18.use-skill`).** Run `control-openhands browser click 'testid=skill-card-docker'`, `control-openhands browser click 'testid=skill-detail-use-skill-docker' --expect-url '/conversations(\?|$)'`, then `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerText"`: `/docker ` (the skill name as a slash command), with the modal gone (`control-openhands browser count 'testid=skill-detail-modal'` is `0`) and the composer focused (`control-openhands browser eval "document.activeElement.getAttribute('data-testid')"` is `chat-input`). `control-openhands browser screenshot --feature F18.use-skill --name prefilled` shows `/docker` in the Home composer. Nothing is sent, and the text is applied once: leave and come back without a page load (`control-openhands browser click 'testid=sidebar-automations-link' --expect-url '/automations$'`, then `control-openhands browser click 'testid=sidebar-conversations-link' --expect-url '/conversations(\?|$)'`) and the same `chat-input` eval returns an empty string. A `browser goto /` would prove nothing here: a page load empties the composer either way.+- **Add skill instructions (`F18.add-skill-modal`).** Run `control-openhands browser goto /skills` (Use skill ends on `/conversations`), `control-openhands browser click 'testid=skills-add-skill-button'`, `control-openhands browser text 'testid=add-skill-modal'` (title `Add a skill`, the example `/add-skill https://github.com/OpenHands/extensions/tree/main/skills/code-review`, five steps, "Supported URL formats" with the short form `OpenHands/extensions/skills/code-review`, "Where skills are stored", the `GITHUB_TOKEN` note) and `control-openhands browser attr 'testid=add-skill-modal-docs-link' href` (`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`; `target` is `_blank`). Copy with `control-openhands browser click 'testid=add-skill-modal-example-copy'`: its `aria-label` becomes `Copied to clipboard`, `enabled` is `false` and `control-openhands browser clipboard` returns the example command; after 2 s it reads `Copy to clipboard` again. Close with `testid=add-skill-modal-dismiss`, `testid=add-skill-modal-close` or `control-openhands browser press Escape`; `count 'testid=add-skill-modal'` is `0` each time. The example points at an existing skill (#18035): `control-openhands browser goto '/skills?q=code-review'` and `control-openhands browser text 'testid=skill-source-code-review'` (`public`) show it in the bundled catalog, which `F18.install-banner` installs from that same URL.+- **Install banner (`F18.install-banner`).** Run `control-openhands conversation start --prompt "/add-skill https://github.com/OpenHands/extensions/tree/main/skills/code-review" --wait --timeout 300` and `control-openhands browser text 'testid=skill-install-restart-banner'`: `Installed to this workspace: code-review. Skills load when a conversation starts, so this conversation can't use them yet.` plus `Start new conversation with this skill`. `control-openhands browser screenshot --feature F18.install-banner --name banner`. Run `control-openhands browser click 'testid=skill-install-restart-action' --expect-url '/conversations/(?!<id>)[0-9a-f-]+(\?|$)'` (`<id>` from `conversation start`; the lookahead skips the current URL), then `control-openhands conversation status <new id>` (the id in the returned URL): its `workspace` equals the install conversation's `workspace` from `conversation start`. Back on the first conversation (`control-openhands browser goto /conversations/<id>`), `control-openhands browser click 'testid=skill-install-restart-dismiss'` makes `count 'testid=skill-install-restart-banner'` `0`; after `control-openhands browser reload` it is `1` again (dismissal is session-only by design).+- **Filters modal on a phone (`F18.filters-modal`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /skills`, `control-openhands browser visible 'testid=skill-facet-rail'` (`false`), `control-openhands browser click 'testid=skills-filters-button'`, `control-openhands browser count 'testid=skill-filters-modal-clear'` (`0`), `control-openhands browser click 'testid=skill-filters-modal >> testid=skill-facet-state-enabled'` (URL `?state=enabled`, Clear filters appears), `control-openhands browser screenshot --feature F18.filters-modal --name phone`, `control-openhands browser click 'testid=skill-filters-modal-done'`, then `control-openhands browser text 'testid=skills-filters-button'` (`Filters` and badge `1`) and the summary (`12 result(s)` on a fresh run, `13 result(s)` with the `qa-hello` fixture). Reopen and `control-openhands browser click 'testid=skill-filters-modal-clear'`: URL `/skills` and the Clear button disappears; Escape closes the modal.+- **Phone layout and hub (`F18.phone`).** At the phone viewport run `control-openhands browser bbox 'testid=skills-page'` (`pageHorizontalOverflow` `false`), `control-openhands browser screenshot --feature F18.phone --name list`, open `testid=skill-card-docker` and `control-openhands browser bbox 'testid=skill-detail-modal'` (`insideViewport` `true`), Escape, `control-openhands browser click 'testid=skills-add-skill-button'` and `control-openhands browser bbox 'testid=add-skill-modal'` (`insideViewport` `true`), Escape. Then `control-openhands browser goto /customize`, `control-openhands browser text 'testid=extensions-mobile-hub'` (`Customize`, `MCP Servers`, `Skills`, `Plugins`, `Apps`), `control-openhands browser click 'testid=extensions-mobile-hub >> testid=sidebar-extensions-/skills' --expect-url '/skills(\?|$)'` and `control-openhands browser click 'testid=sidebar-mobile-back-button' --expect-url '/customize(\?|$)'`. Return with `control-openhands browser viewport desktop`.+- **Cloud link (`F18.cloud-link`).** Blocked: needs a Cloud backend. Expected: `control-openhands browser attr 'testid=sidebar-extensions-/skills' href` is `<cloud host>/settings/skills` with `target` `_blank`, and the Plugins and Apps items are hidden.+- **Restore.** Leave `add-javadoc` and `flarglebargle` off and `qa-hello` on; the fixture skill and the conversations vanish with the run's private state.++## Gotchas++- `sidebar-skills-link` is labelled **Customize** and lands on `/mcp` on desktop (`/customize` redirects); Skills is one more click. Test ids embed the route: quote `'testid=sidebar-extensions-/skills'`.+- A `browser click` on an **enabled** card toggle is lost when the pointer was not already over it: `pointerenter` swaps the checkmark icon for the X icon between mousedown and mouseup, so Chrome fires no click and no `PATCH /api/settings` goes out (#17941). `browser hover` the toggle first (or click twice). Turning a skill on is not affected. Recorded as `fail` on `F18.toggle`.+- The card toggle and the facet rows are `role=switch`/`role=checkbox` buttons: read `aria-checked`. The modal switch is a hidden `<input>` (#17900): click the row text and read `.checked` with `browser eval`.+- Typing writes `?q=` with `replace` after a 300 ms debounce, so read `browser url` a second later; facet clicks push a history entry immediately.+- Facet counts are disjunctive: a row counts skills matching the other groups' selections, so Disabled reads `0` (and is disabled) while Recommended is checked.+- Groups with fewer than two values are hidden (Source and Type on a fresh run) unless the URL selects one of their values.+- The run's `HOME` lives under `/tmp`, so a skill in `~/.agents/skills` is filed under Source **This project** (`source=project`), not **Personal**; with a real `/home/<user>` or `/Users/<user>` home it would be Personal.+- `conversation events` does not show `activated_skills`; read the user `MessageEvent` through `api GET '/api/conversations/<id>/events/search?limit=5' --max-bytes 2000000`.+- Skill lists are cached for 10 minutes: `browser reload` (or `goto`) after the agent creates a skill file, or the new card does not appear.+- `navigator.clipboard.readText()` through `browser eval` hangs (no clipboard permission in the page); read what a copy button wrote with `control-openhands browser clipboard` and assert the button's `aria-label` too. The app runs on `127.0.0.1` (a secure context), so the unguarded `clipboard.writeText` calls cannot be tested for insecure-origin failures here.+- With the Agent Server stopped, reloading `/skills` shows the "Manage backends / Disconnected" screen instead of the page: load the page first, then stop the service. After the failed save the card keeps showing the new state until a reload (#17941).+- Before #18035 (closed #17939) the page description said "Search from the sidebar to filter the list" and offered curl and install flows the page does not have; a checkout without it still does.+- With the modal's `+N` pill popover open (focus on its trigger), Escape closes neither the popover nor the detail modal; on a card the same Escape closes the popover (#17957). Cause not confirmed: the `+N` trigger's `onKeyDown` in `src/components/features/skills/skill-card-pill-row.tsx` stops propagation, which may keep the key from the popover's `document` and `ModalBackdrop`'s `window` listeners. Click elsewhere in the modal first. Recorded as `fail` on `F18.detail-pills`.+- The Add skill example, its Copy button and the add-skill **Use skill** message share one constant. Since #18035 it is `.../skills/code-review`; before, it pointed at `skills/codereview`, which is 404 upstream (the skill was renamed).+- Skill changes apply to new conversations only; an open conversation keeps the skills it started with.diff --git a/.agents/skills/verify-openhands/references/feature-map/F19-plugins.md b/.agents/skills/verify-openhands/references/feature-map/F19-plugins.mdnew file mode 100644index 0000000000..ad5a9a09a2--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F19-plugins.md@@ -0,0 +1,101 @@+# F19 — Plugins and plugin launch++Plugins bundle skills, commands and files that the agent loads into a+conversation. Under Customize → Plugins a user browses one card grid that merges+the marketplace catalog, installed plugins and read-only local plugins; searches+and filters it; installs, enables, disables, updates and uninstalls plugins;+browses a plugin's bundled skills and files; and starts a conversation with a+plugin. Starting goes through `/launch`, a review screen (also reachable as a+deep link) that lists the plugins, lets the user edit plugin parameters and+requires a trust checkbox before it creates the conversation.++Source: `src/routes/skills-plugins.tsx`, `src/routes/launch.tsx`, `src/components/features/plugins/`, `src/components/features/launch/`, `src/utils/plugin-launch-url.ts`, `src/hooks/mutation/use-install-plugin.ts`, `src/hooks/mutation/use-set-plugin-enabled.ts`, `src/hooks/mutation/use-uninstall-plugin.ts`, `src/hooks/mutation/use-refresh-plugin.ts`.++## Sub-features++- `F19.page`: `/plugins` shows the **Plugins** heading, the description "Browse, install, enable, and uninstall plugins. Enabled plugins load automatically into new conversations.", an enabled **Add plugin** button on a local backend, and the catalog as cards.+- `F19.search`: the search box filters by name, description, source, path and ref; a query matching nothing shows `No plugins match your search.`; the X clears the query.+- `F19.status-filter`: the All / Installed / Available / Local segments filter the grid; the active one has `aria-pressed="true"`; the filter resets to All on reload.+- `F19.detail-modal`: clicking a card (or Enter/Space on a focused card) opens a modal with name, source, description, **Skills in this plugin bundle**, **Files** and footer actions; X, **Close** and Escape close it.+- `F19.files-browser`: in the modal's Files tree, expanding a folder and selecting a file shows its highlighted content with line numbers; selecting it again closes the viewer.+- `F19.install-card`: **Install** on a card installs the plugin: toast `Plugin installed.`, the button becomes an enable switch, a version pill appears, the card sorts first and the install survives a reload.+- `F19.install-modal`: **Install** in the detail modal does the same for the open plugin; the modal stays open and switches to the installed footer.+- `F19.enable-toggle`: the card switch (named `Disable plugin` / `Enable plugin`) and the modal **Enabled/Disabled** switch turn an installed plugin off and on; the state persists after reload.+- `F19.enabled-autoload`: an installed, enabled plugin loads into every new conversation; disabled, it does not.+- `F19.refresh`: **Update** in an installed plugin's modal re-fetches it from its recorded source and shows `Plugin updated.`+- `F19.uninstall`: **Uninstall** removes the plugin at once (no confirmation), shows `Plugin uninstalled.`, closes the modal and returns the card to **Install**.+- `F19.add-plugin`: **Add plugin** opens **Add a plugin** with Source (required), Ref and Path (optional); Install stays disabled until Source has text; a valid source installs and closes the modal.+- `F19.add-plugin-cancel`: the Add modal's X, **Close**, Escape and a backdrop click close it without installing; reopening starts with empty fields.+- `F19.add-plugin-error`: an unusable source shows one error toast with the server's reason and keeps the modal open with the typed values.+- `F19.installed-coordinates`: a plugin installed with a source, ref and path shows that source on its card and in the modal header, and modal pills `v<version>`, `Ref <resolved commit>` and `Path <repo path>` next to the Enabled switch.+- `F19.local-plugin`: a plugin found in `~/.agents/plugins` shows a **Local** badge (no Install or switch), is listed under the Local filter, and its modal has a Local pill, Files, no Install/Uninstall and no Start Conversation.+- `F19.start-conversation`: **Start Conversation** in the detail modal opens `/launch?plugins=<base64 JSON>` for that plugin.+- `F19.launch-review`: `/launch` shows a modal titled `Launch <plugin>` (one plugin) or `Launch Plugin` (several), the optional `message` with HTML stripped and capped at 500 characters, and each plugin as `<source> / <path> @ <ref>`; X and Escape go to `/conversations`.+- `F19.launch-parameters`: plugins with `parameters` get an expanded, collapsible section with a text input, number input (blank becomes 0) or checkbox per value; edits are kept.+- `F19.launch-trust`: **Start Conversation** stays disabled until the trust checkbox (`I trust this plugin from <sources> …`) is ticked; then it creates the conversation (sending the message, if any), opens `/conversations/<id>`, and the plugin is loaded there.+- `F19.launch-dev-params`: `/launch?plugin_source=…&plugin_ref=…&plugin_repo_path=…&message=…` opens the same review for one plugin.+- `F19.launch-errors`: bare `/launch` or an empty array says `No plugins were specified…`; bad base64, invalid JSON, a non-array or an item without `source` says `The plugin configuration is invalid…`; **Go Home** opens `/conversations`.+- `F19.launch-creation-failed`: when conversation creation fails, the screen shows `Unable to Launch` / `Failed to Start Conversation` with **Go Home** and **Try Again**; Try Again reloads the page, which brings back the review modal with the trust box cleared.+- `F19.launch-unicode`: a deep link whose JSON contains non-ASCII text (UTF-8 base64) shows that text correctly.+- `F19.phone`: at 390 px the toolbar stacks, cards fit, and the detail, Add and launch modals stay inside the viewport.++## How to get to it (user POV)++- Sidebar **Customize** (`sidebar-skills-link`, lands on `/mcp`), then **Plugins** in the Customize navigation (`sidebar-extensions-/plugins`).+- Direct URL `/plugins`.+- Command menu (`Control+k`/`Meta+k`): "Plugins" finds only **Customize** ("Browse skills, plugins, and integrations"), which lands on `/mcp`; then click Plugins. There is no direct Plugins command.+- Phone width: `/customize` shows the Customize hub; its Plugins row (`extensions-mobile-hub >> sidebar-extensions-/plugins`) opens `/plugins`, and the top bar's Back chevron (`sidebar-mobile-back-button`) returns to `/customize`.+- `/launch`: from a plugin's detail modal (**Start Conversation**), or a deep link `/launch?plugins=<base64 JSON array>&message=<text>` (production format) or `/launch?plugin_source=…` (dev format).+- Attaching plugins from the home composer (**Plugins** pill) is F03 (`F03.plugin-picker`); the conversation's **Show Plugins** list is F27 (`F27.plugins-modal`).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done), local backend, desktop viewport.+- An active LLM profile (`control-openhands llm preset deepseek`) for Enabled plugins auto-load and the two Start-a-conversation bullets.+- No plugin installed: `control-openhands api GET /api/plugins/installed` returns `{"plugins": []}`.+- The catalog comes from the launcher's cached public-skills checkout and needs no network: `control-openhands api GET /api/plugins/marketplace` lists `city-weather`, `magic-test` and others with local-path `source` values. `magic-test` answers "alakazam" with `The magic worked! Plugin loaded successfully. 🎩✨`, which makes plugin loading cheap to prove.+- Right before the Local plugin bullet (not earlier: it changes card counts and the Local filter), put a local plugin in the Agent Server's `~/.agents/plugins`. No CLI verb does this (harness gap); from the checkout run `H="$OH_VERIFY_RUN/private/home/.agents/plugins"; mkdir -p "$H" && cp -r "$OH_VERIFY_RUN/private/cache/skills/public-skills/plugins/magic-test" "$H/qa-local-plugin" && sed -i 's/"name": "magic-test"/"name": "qa-local-plugin"/' "$H/qa-local-plugin/.plugin/plugin.json"`. The rename matters: a local plugin whose name is already in the catalog is hidden.+- The Add plugin bullet installs from `github:OpenHands/extensions`, which needs outbound access to GitHub.++- **Open the page (`F19.page`).** Run `control-openhands browser goto /conversations`, `control-openhands browser click 'testid=sidebar-skills-link' --expect-url '/mcp(\?|$)'`, `control-openhands browser click 'testid=sidebar-extensions-/plugins' --expect-url '/plugins(\?|$)'`, then `control-openhands browser text 'testid=skills-plugins-screen >> h2'` (`Plugins`), `control-openhands browser text 'testid=plugins-settings-description'` (the description above), `control-openhands browser enabled 'testid=plugins-add-plugin-button'` (`true`) and `control-openhands browser count '[data-testid^="plugin-card-"]'` (9 with today's catalog). `control-openhands browser screenshot --feature F19.page --name catalog` shows two columns of cards, each with name, truncated source path, a two-line description and **Install**.+- **Command-menu entry (`F19.page`).** From `/conversations` run `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Plugins`, `control-openhands browser snapshot 'testid=command-menu'` (one option, `Customize Browse skills, plugins, and integrations. Go`), `control-openhands browser press Enter`, `control-openhands browser wait-url '/mcp(\?|$)'`, then `control-openhands browser click 'testid=sidebar-extensions-/plugins' --expect-url '/plugins(\?|$)'`.+- **Search (`F19.search`).** Run `control-openhands browser fill 'testid=plugins-search-input' weather` and `control-openhands browser count '[data-testid^="plugin-card-"]'` (`1`). `control-openhands browser fill 'testid=plugins-search-input' alakazam` also leaves `1` (`magic-test`, matched on its description). `control-openhands browser fill 'testid=plugins-search-input' zzz-none`, then `control-openhands browser text 'testid=plugins-no-match'`: `No plugins match your search.` Run `control-openhands browser click 'testid=plugins-toolbar >> role=button[name="Clear search"]'`; `control-openhands browser value 'testid=plugins-search-input'` is empty and the count is back to 9.+- **Status filter (`F19.status-filter`).** `control-openhands browser attr 'testid=plugins-filter-all' aria-pressed` is `true`. Run `control-openhands browser click 'testid=plugins-filter-installed'`: its `aria-pressed` is `true`, All's is `false`, and with nothing installed `control-openhands browser count 'testid=plugins-no-match'` is `1`. `control-openhands browser click 'testid=plugins-filter-available'` shows all 9 cards; `control-openhands browser click 'testid=plugins-filter-local'` shows `plugins-no-match` (no local plugin yet). After `control-openhands browser reload`, `plugins-filter-all` is pressed again.+- **Detail modal (`F19.detail-modal`).** Run `control-openhands browser click 'testid=plugin-card-magic-test'` and `control-openhands browser snapshot 'testid=plugin-detail-modal'`: heading `magic-test`, the source path, the description, `Skills in this plugin bundle` with `magic-word`, `Files` with `.plugin` and `skills` folders, and buttons **Install**, **Start Conversation**, **Close**. Close with `control-openhands browser click 'testid=plugin-detail-modal-close'` (`browser count 'testid=plugin-detail-modal'` is `0`). Keyboard: `control-openhands browser focus 'testid=plugin-card-city-weather'`, `control-openhands browser press Enter`, then `control-openhands browser attr 'testid=plugin-detail-modal' data-plugin-name` (`city-weather`); `control-openhands browser press Escape` closes it; `browser focus` again and `control-openhands browser press Space` reopens it; `control-openhands browser click 'testid=plugin-detail-modal-dismiss'` closes it.+- **Files (`F19.files-browser`).** Open the `magic-test` modal again and run `control-openhands browser click 'testid=file-tree-dir-.plugin'`, `control-openhands browser click 'testid=file-tree-file-.plugin/plugin.json'`, `control-openhands browser wait 'testid=plugin-file-content >> text=magic-test' --timeout 15000` and `control-openhands browser text 'testid=plugin-file-content'`: `.plugin/plugin.json` followed by numbered JSON lines (`2 "name": "magic-test",`). `control-openhands browser screenshot --feature F19.files-browser --name plugin-json` shows the tree with the file highlighted above a syntax-coloured viewer. Click the same file again; `control-openhands browser count 'testid=plugin-file-content'` is `0`. Close with `testid=plugin-detail-modal-close`.+- **Install from a card (`F19.install-card`).** Run `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=plugin-install-magic-test'`, `control-openhands browser wait 'testid=plugin-toggle-magic-test' --timeout 60000` and `control-openhands browser toasts` (`Plugin installed.`). `control-openhands browser text 'testid=plugin-version-magic-test'` is `v1.0.0` and `control-openhands browser eval "[...document.querySelectorAll('[data-testid^=plugin-card-]')].map(e=>e.dataset.testid)[0]"` is `plugin-card-magic-test`. After `control-openhands browser reload` and `control-openhands browser click 'testid=plugins-filter-installed'`, `browser count '[data-testid^="plugin-card-"]'` is `1`, and `control-openhands api GET /api/plugins/installed` lists `magic-test` with `"enabled": true`. Click `testid=plugins-filter-all`.+- **Enable switch (`F19.enable-toggle`).** Run `control-openhands browser attr 'testid=plugin-toggle-magic-test' aria-checked` (`true`) and `control-openhands browser attr 'testid=plugin-toggle-magic-test' aria-label` (`Disable plugin`), `control-openhands browser hover 'testid=plugin-toggle-magic-test'`, `control-openhands browser click 'testid=plugin-toggle-magic-test'`, wait three seconds, then `browser attr ... aria-checked` again (`false`, with `aria-label` `Enable plugin`); after `control-openhands browser reload` it is still `false` and `api GET /api/plugins/installed` shows `"enabled": false`. Today the disable is often lost: the reload's concurrent reads hit the metadata race (Gotchas) and the API, then the switch, read `"enabled": true` again (2 of 3 trials; the PATCH itself returns 200). If that happens, disable it once more before the modal step, which needs the plugin disabled. In the modal: `control-openhands browser click 'testid=plugin-card-magic-test'`, `control-openhands browser click 'testid=plugin-detail-modal >> text="Disabled"'`, then `control-openhands browser eval "document.querySelector('[data-testid=plugin-modal-toggle-magic-test]').checked"` (`true`); the API shows `"enabled": true` and, after closing the modal, the card switch's `aria-checked` is `true`.+- **Enabled plugins auto-load (`F19.enabled-autoload`).** With `magic-test` enabled, run `control-openhands conversation start --prompt "alakazam" --wait --timeout 240` and `control-openhands browser text 'testid=agent-message >> nth=-1'`: `The magic worked! Plugin loaded successfully. 🎩✨`. Then `control-openhands browser goto /plugins`, disable it with the card switch (hover, click; API `"enabled": false`) and run the same `conversation start`: the reply is an ordinary request for a task, without the phrase. `browser goto /plugins` again; `magic-test` stays installed and disabled. Today the revisit often re-enables it (API `"enabled": true`, `installed_at` reset; see Gotchas), so re-check the API before relying on the disabled state.+- **Update (`F19.refresh`).** Run `control-openhands browser click 'testid=plugin-card-magic-test'`, `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=plugin-detail-refresh-magic-test'`, wait a few seconds, then `control-openhands browser toasts`. Expected `Plugin updated.` (the toast fades fast: read `control-openhands browser toasts --history`). Whether it works depends on the recorded source. After a catalog install it usually fails (see Gotchas): `control-openhands browser text 'testid=plugin-source-magic-test'` reads `local` instead of the catalog path, and the toast is `HTTP request failed (500 Internal Server Error): … Unable to parse extension source: local …`, shown twice. On a plugin whose source survived (the GitHub install in **Add plugin from GitHub**, `browser text 'testid=plugin-source-magic-test'` = `github:OpenHands/extensions`), the same click logs `Updating extension magic-test from github:OpenHands/extensions` and `toasts --history` shows `Plugin updated.` Close the modal.+- **Start a conversation from an installed plugin (`F19.start-conversation`).** Run `control-openhands browser click 'testid=plugin-card-magic-test'`, `control-openhands browser click 'testid=plugin-detail-start-conversation-magic-test' --expect-url '/launch\?plugins='` and `control-openhands browser eval "JSON.parse(atob(new URLSearchParams(location.search).get('plugins')))"`. Expected: the plugin's real source. Today it is `[{"source":"local","ref":null,"repo_path":null}]` and the modal title is `Launch local`; after `control-openhands browser check 'testid=trust-checkbox'` and `control-openhands browser click 'testid=start-conversation-button' --expect-url '/conversations/[0-9a-f-]+'`, `control-openhands browser type 'testid=chat-input' 'alakazam'` and `control-openhands browser press Enter --selector 'testid=chat-input'` leave the message at `Sending...` (still after 25 s) with the banner `Unable to parse plugin source: local. Expected formats: 'github:owner/repo', git URL, or local path` (`control-openhands browser screenshot --feature F19.start-conversation --name local-source-conversation`). When the installed plugin kept its source (the GitHub install below), the link carries it: `[{"source":"github:OpenHands/extensions","ref":"<resolved commit>","repo_path":"plugins/magic-test"}]` and the title is `Launch magic-test`.+- **Uninstall (`F19.uninstall`).** Run `control-openhands browser goto /plugins`, `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=plugin-card-magic-test'`, `control-openhands browser click 'testid=plugin-detail-uninstall-magic-test'`, then `control-openhands browser count 'testid=plugin-detail-modal'` (`0`), `control-openhands browser count 'testid=confirmation-modal'` (`0`: no confirmation), `control-openhands browser toasts` (`Plugin uninstalled.`) and `control-openhands browser count 'testid=plugin-install-magic-test'` (`1`). After `control-openhands browser reload` the Install button is still there, `browser text 'testid=plugin-source-magic-test'` is the catalog path again and `api GET /api/plugins/installed` returns `{"plugins": []}`.+- **Install from the modal (`F19.install-modal`).** Run `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=plugin-card-city-weather'`, `control-openhands browser click 'testid=plugin-detail-install-city-weather'`, `control-openhands browser wait 'testid=plugin-detail-uninstall-city-weather' --timeout 60000` and `control-openhands browser toasts` (`Plugin installed.`). The modal stays open (`browser count 'testid=plugin-detail-modal'` is `1`), `control-openhands browser eval "document.querySelector('[data-testid=plugin-modal-toggle-city-weather]').checked"` is `true`, and `control-openhands browser snapshot 'testid=plugin-detail-modal >> footer'` lists **Update**, **Uninstall**, **Start Conversation**, **Close**. Clean up with `control-openhands browser click 'testid=plugin-detail-uninstall-city-weather'`; `browser count 'testid=plugin-install-city-weather'` is `1`.+- **Cancel Add plugin (`F19.add-plugin-cancel`).** Run `control-openhands browser click 'testid=plugins-add-plugin-button'`, `control-openhands browser fill 'testid=add-plugin-source-input' qa-typed` and `control-openhands browser click 'testid=add-plugin-modal-close'`; `control-openhands browser count 'testid=add-plugin-modal'` is `0`. Reopen it: `control-openhands browser value 'testid=add-plugin-source-input'` is empty. Type again and close with `control-openhands browser click 'testid=add-plugin-modal-dismiss'` (count `0`); reopen and `control-openhands browser press Escape` (count `0`); reopen and `control-openhands browser mouse-click 20 500` on the backdrop (count `0`). `api GET /api/plugins/installed` still returns `{"plugins": []}` and `browser network` shows no `POST /api/plugins/install`.+- **Add plugin form and error (`F19.add-plugin`, `F19.add-plugin-error`).** Run `control-openhands browser click 'testid=plugins-add-plugin-button'` and `control-openhands browser snapshot 'testid=add-plugin-modal'`: heading `Add a plugin`, `Install a plugin from a Git source or local path.`, textbox `Source` (placeholder `github:owner/repo, a Git URL, or a local path`), `Ref Optional`, `Path Optional`, **Close** and a disabled **Install**. `control-openhands browser fill 'testid=add-plugin-source-input' ' '` keeps `control-openhands browser enabled 'testid=add-plugin-submit'` at `false`; `control-openhands browser fill 'testid=add-plugin-source-input' qa-not-a-source` turns it `true`. Run `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=add-plugin-submit'`, wait a few seconds, then `control-openhands browser toasts`, `control-openhands browser count 'testid=add-plugin-modal'` (`1`) and `control-openhands browser value 'testid=add-plugin-source-input'` (`qa-not-a-source`). Expected one toast with the server's reason (the Agent Server answers 400 `Failed to fetch plugin source. Check that the source is valid.`); today two identical toasts read `Disconnected (check URL or network). Check that the backend URL is correct…` (`browser screenshot --feature F19.add-plugin-error --name toast`).+- **Add plugin from GitHub (`F19.add-plugin`).** In the same modal run `control-openhands browser fill 'testid=add-plugin-source-input' 'github:OpenHands/extensions'`, `control-openhands browser fill 'testid=add-plugin-repo-path-input' 'plugins/magic-test'`, `control-openhands browser toasts --clear`, `control-openhands browser click 'testid=add-plugin-submit'` and `control-openhands browser text 'testid=add-plugin-submit'` (`Installing…`), then `control-openhands browser wait 'testid=add-plugin-modal' --state hidden --timeout 120000` and `control-openhands browser toasts` (`Plugin installed.`). `api GET /api/plugins/installed` lists `magic-test` with four files (`.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, `.plugin/plugin.json`, `skills/magic-word/SKILL.md`) with `"source": "github:OpenHands/extensions"`, `"repo_path": "plugins/magic-test"` and a commit in `resolved_ref`; the card's `plugin-source-magic-test` reads `github:OpenHands/extensions`. The metadata race (Gotchas) can still turn it into `"source": "local"` with `repo_path: null`. Without GitHub access expect the error toast of the previous bullet instead. Clean up: `testid=plugin-card-magic-test` → `testid=plugin-detail-uninstall-magic-test`.+- **Installed coordinates (`F19.installed-coordinates`).** Needs GitHub access like the previous bullet. Run `control-openhands browser click 'testid=plugins-add-plugin-button'`, `control-openhands browser fill 'testid=add-plugin-source-input' 'github:OpenHands/extensions'`, `control-openhands browser fill 'testid=add-plugin-ref-input' main`, `control-openhands browser fill 'testid=add-plugin-repo-path-input' 'plugins/city-weather'`, `control-openhands browser click 'testid=add-plugin-submit'` and `control-openhands browser wait 'testid=add-plugin-modal' --state hidden --timeout 120000` (`toasts --history`: `Plugin installed.`). `control-openhands browser text 'testid=plugin-source-city-weather'` is `github:OpenHands/extensions`; `control-openhands browser click 'testid=plugin-card-city-weather'` and `control-openhands browser snapshot 'testid=plugin-detail-modal'` show the header paragraph `github:OpenHands/extensions` and the text `v1.0.0 Ref <40-hex commit> Path plugins/city-weather Enabled` (the API's `resolved_ref`), and Files lists `.claude-plugin` and `.codex-plugin` that the catalog copy lacks. Clean up with `control-openhands browser click 'testid=plugin-detail-uninstall-city-weather'`; the card's source is the catalog path again.+- **Local plugin (`F19.local-plugin`).** After arranging `qa-local-plugin` (Preconditions), run `control-openhands browser reload`, `control-openhands browser text 'testid=plugin-local-badge-qa-local-plugin'` (`Local`), and `control-openhands browser count` on `testid=plugin-install-qa-local-plugin`, `testid=plugin-toggle-qa-local-plugin` and `testid=plugin-source-qa-local-plugin` (all `0`). `control-openhands browser click 'testid=plugins-filter-local'` leaves one card; under `plugins-filter-available` `browser count 'testid=plugin-card-qa-local-plugin'` is `0`. Back on All, `control-openhands browser click 'testid=plugin-card-qa-local-plugin'` and `control-openhands browser snapshot 'testid=plugin-detail-modal'`: no source line, pills `Local v1.0.0`, the bundled skill and Files, and only a **Close** button in the footer (`browser screenshot --feature F19.local-plugin --name modal`). Close with Escape. Clean up: `rm -rf "$OH_VERIFY_RUN/private/home/.agents/plugins/qa-local-plugin"`, `control-openhands browser reload`; the card count for `qa-local-plugin` is `0`.+- **Start a conversation from the catalog (`F19.start-conversation`, `F19.launch-trust`).** With `magic-test` not installed, run `control-openhands browser click 'testid=plugin-card-magic-test'`, `control-openhands browser click 'testid=plugin-detail-start-conversation-magic-test' --expect-url '/launch\?plugins='` and the `atob` eval above: one object with the catalog `source`, `ref: null`, `repo_path: null`. `control-openhands browser snapshot 'testid=plugin-launch-modal'` shows `Launch magic-test`, the source path and the checkbox `I trust this plugin from <source path> with the agent secrets defined in my account.`; `control-openhands browser enabled 'testid=start-conversation-button'` is `false`. Run `control-openhands browser check 'testid=trust-checkbox'` (`enabled` turns `true`) and `control-openhands browser click 'testid=start-conversation-button' --expect-url '/conversations/[0-9a-f-]+'`; `control-openhands browser url` gives `<id>`. `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser click 'testid=show-plugins-button'` and `control-openhands browser text 'testid=plugins-modal'` list `magic-test`; close with `testid=close-plugins-modal`. Then `control-openhands browser type 'testid=chat-input' 'alakazam'`, `control-openhands browser press Enter --selector 'testid=chat-input'`, `control-openhands conversation wait <id> --timeout 180` and `control-openhands browser text 'testid=agent-message >> nth=-1'`: the magic phrase.+- **Review screen (`F19.launch-review`).** Run `control-openhands browser goto '/launch?plugins=W3sic291cmNlIjoiZ2l0aHViOk9wZW5IYW5kcy9leHRlbnNpb25zIiwicmVwb19wYXRoIjoicGx1Z2lucy9jaXR5LXdlYXRoZXIifSx7InNvdXJjZSI6Imh0dHBzOi8vZ2l0aHViLmNvbS9PcGVuSGFuZHMvZXh0ZW5zaW9ucy5naXQiLCJyZXBvX3BhdGgiOiJwbHVnaW5zL21hZ2ljLXRlc3QiLCJyZWYiOiJtYWluIn1d'` (two plugins from `OpenHands/extensions`, one as an HTTPS git URL) and `control-openhands browser snapshot 'testid=plugin-launch-modal'`: the heading `Launch Plugin` (`Launch` once); under `Plugins`, the text `city-weather OpenHands/extensions/ plugins/city-weather magic-test OpenHands/extensions/ plugins/magic-test@ main` (the screenshot renders `OpenHands/extensions / plugins/magic-test @ main`); and the checkbox `I trust this plugin from OpenHands/extensions with the agent secrets defined in my account.`, which names `OpenHands/extensions` once (`browser screenshot --feature F19.launch-review --name multi`). Message: `control-openhands browser goto '/launch?plugin_source=github%3AOpenHands%2Fextensions&message=%3Cb%3EWeather%3C%2Fb%3E%20for%20QA'` and `control-openhands browser text 'testid=plugin-launch-modal >> p'`: `Weather for QA` (tags stripped). With a 600-character `message` (`/launch?plugin_source=github%3AOpenHands%2Fextensions&message=aaa…`), `control-openhands browser eval "document.querySelector('[data-testid=plugin-launch-modal] p').textContent.length"` is `500`. Close: `control-openhands browser click 'testid=plugin-launch-modal >> testid=close-button' --expect-url '/conversations(\?|$)'`; on a fresh `/launch?...`, `control-openhands browser press Escape` also lands on `/conversations`.+- **Parameters (`F19.launch-parameters`).** Run `control-openhands browser goto '/launch?plugins=W3sic291cmNlIjoiZ2l0aHViOk9wZW5IYW5kcy9leHRlbnNpb25zIiwicmVwb19wYXRoIjoicGx1Z2lucy9jaXR5LXdlYXRoZXIiLCJyZWYiOiJtYWluIiwicGFyYW1ldGVycyI6eyJjaXR5IjoiUGFyaXMiLCJkYXlzIjozLCJtZXRyaWMiOnRydWV9fV0%3D'` (city-weather with `{"city":"Paris","days":3,"metric":true}`) and `control-openhands browser snapshot 'testid=plugin-launch-modal'`: a `city-weather` section button, `ref: main`, `path: plugins/city-weather`, textbox `city` (`Paris`), spinbutton `days` (`3`) and a checked checkbox `metric`. `control-openhands browser click 'testid=plugin-section-0'` collapses it (`browser count 'testid=plugin-0-param-city'` is `0`); click again to expand. `control-openhands browser fill 'testid=plugin-0-param-city' Berlin`, `control-openhands browser fill 'testid=plugin-0-param-days' ''` (then `control-openhands browser value 'testid=plugin-0-param-days'` is `0`) and `control-openhands browser uncheck 'testid=plugin-0-param-metric'` are accepted. A link that mixes plugins with and without parameters (`/launch?plugins=W3sic291cmNlIjoiZ2l0aHViOk9wZW5IYW5kcy9leHRlbnNpb25zIiwicmVwb19wYXRoIjoicGx1Z2lucy9tYWdpYy10ZXN0In0seyJzb3VyY2UiOiJnaXRodWI6T3BlbkhhbmRzL2V4dGVuc2lvbnMiLCJyZXBvX3BhdGgiOiJwbHVnaW5zL2NpdHktd2VhdGhlciIsInBhcmFtZXRlcnMiOnsiY2l0eSI6IlBhcmlzIn19XQ%3D%3D`) lists the parameter-less one under `Additional Plugins`. Leave with Escape; do not start this one (see Gotchas).+- **Dev format (`F19.launch-dev-params`).** Run `control-openhands browser goto '/launch?plugin_source=github%3AOpenHands%2Fextensions&plugin_ref=main&plugin_repo_path=plugins%2Fmagic-test&message=hi%20QA'` and `control-openhands browser snapshot 'testid=plugin-launch-modal'`: `Launch magic-test`, paragraph `hi QA`, text `magic-test OpenHands/extensions/ plugins/magic-test@ main`.+- **Error states (`F19.launch-errors`).** For each of `/launch`, `/launch?plugins=garbage`, `/launch?plugins=e30%3D` (`{}`), `/launch?plugins=W10%3D` (`[]`) and `/launch?plugins=W3sicmVmIjoibWFpbiJ9XQ%3D%3D` (`[{"ref":"main"}]`) run `control-openhands browser goto '<url>'` and `control-openhands browser text 'testid=launch-error'`. Bare and `[]` read `Unable to Launch` / `No plugins were specified. Please provide at least one plugin to launch.`; the other three read `The plugin configuration is invalid. Please check the URL and try again.` (`browser screenshot --feature F19.launch-errors --name invalid-format`). `control-openhands browser count 'testid=try-again-button'` is `0` in all of them. `control-openhands browser click 'testid=go-home-button' --expect-url '/conversations(\?|$)'` leaves.+- **Creation failure (`F19.launch-creation-failed`).** Run `control-openhands browser goto '/launch?plugin_source=github%3AOpenHands%2Fextensions&plugin_repo_path=plugins%2Fmagic-test'`, `control-openhands browser check 'testid=trust-checkbox'`, `control-openhands service stop agent-server`, `control-openhands browser click 'testid=start-conversation-button'`, `control-openhands browser wait 'testid=launch-error' --timeout 60000` and `control-openhands browser text 'testid=launch-error'`: `Unable to Launch`, `Failed to Start Conversation`, `Go Home`, `Try Again` (`browser screenshot --feature F19.launch-creation-failed --name error`). `control-openhands browser click 'testid=try-again-button'` reloads the page; with the server still down the app shows **Manage backends** with the Local backend `Disconnected`. Restore with `control-openhands restart --timeout 240` and `control-openhands browser reload`: the review modal is back and `control-openhands browser eval "document.querySelector('[data-testid=trust-checkbox]').checked"` is `false`. Run `control-openhands doctor` before continuing.+- **Non-ASCII deep link (`F19.launch-unicode`).** Run `control-openhands browser goto '/launch?plugins=W3sic291cmNlIjoiZ2l0aHViOnFhL3LDqXBvIn1d'` (UTF-8 base64 of `[{"source":"github:qa/répo"}]`) and `control-openhands browser text 'testid=plugin-launch-modal >> h2'`. Expected `Launch qa/répo`; today `Launch qa/répo`.+- **Phone (`F19.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /plugins`, `control-openhands browser bbox 'testid=skills-plugins-screen'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser eval "(()=>{const s=document.querySelector('[data-testid=plugins-search-input]').getBoundingClientRect(), f=document.querySelector('[data-testid=plugins-status-filter]').getBoundingClientRect();return {searchBottom:Math.round(s.bottom), filterTop:Math.round(f.top), filterWidth:Math.round(f.width)}})()"`: `filterTop` is below `searchBottom` (stacked) and `filterWidth` is `348`. `control-openhands browser screenshot --feature F19.phone --name list` shows one column of cards. Open `testid=plugin-card-city-weather` and `control-openhands browser bbox 'testid=plugin-detail-modal'` (`insideViewport` `true`, `browser screenshot --feature F19.phone --name detail`), Escape; `control-openhands browser click 'testid=plugins-add-plugin-button'` and `control-openhands browser bbox 'testid=add-plugin-modal'` (`insideViewport` `true`), Escape. The parameters link from above gives `control-openhands browser bbox 'testid=plugin-launch-modal'` `insideViewport` `true` (`browser screenshot --feature F19.phone --name launch`). Hub entry: `control-openhands browser goto /customize`, `control-openhands browser click 'testid=extensions-mobile-hub >> testid=sidebar-extensions-/plugins' --expect-url '/plugins(\?|$)'` and `control-openhands browser click 'testid=sidebar-mobile-back-button' --expect-url '/customize(\?|$)'`. Return with `control-openhands browser viewport desktop`.+- **Errors sweep (`F19.page`).** `control-openhands browser errors --app-only` shows no page errors; the only app HTTP errors are the deliberate ones (refresh 500, install 400, 502s while the Agent Server was stopped).++## Gotchas++- The card switch swaps its icon on hover. A plain `browser click` that moves the pointer onto it from elsewhere (for example right after clicking a filter segment) is often swallowed (#17941): no `PATCH /api/plugins/installed/<name>` shows in `browser network`. Run `browser hover` on the switch first, then click, and assert `aria-checked` and the API, not the click result.+- Installed plugins lose their source and their enabled state, intermittently (OpenHands/software-agent-sdk#5496). The Agent Server rewrites `<run>/private/plugins/installed/.installed.json` with a plain truncate-and-write on every load (SDK `InstallationMetadata.save_to_dir`), so a concurrent `GET /api/plugins/installed` (page loads fire several) can read an empty file: it logs `Failed to load installed extension metadata … Invalid JSON: EOF while parsing` and `Discovered untracked extension`, then saves every plugin with `"source": "local"`, `"enabled": true` and a fresh `installed_at`. It hit catalog installs in most trials and a disabled plugin on 2 of 3 page revisits; GitHub installs kept their source in this run. Once it hits, the card shows `local`, **Update** fails with a 500, **Start Conversation** builds an unusable `/launch` link, and a disabled plugin silently auto-loads again. Prove the launch path from a card that is not installed, and re-read the API after every navigation.+- Plugin mutation errors show the same toast twice: the hook's `onError` and the global `MutationCache` handler both fire (#17954). Install errors that the server answers with 400 show the misleading `Disconnected (check URL or network)` text (#17954); read the real reason in the run's `private/stack.log`.+- **Uninstall** acts immediately, with no confirmation (MCP server delete and App uninstall confirm).+- `/launch` with a `message` starts the agent as soon as **Start Conversation** is clicked. Prefer links without a message and send `alakazam` yourself; a `city-weather` launch with a message makes the agent call an external weather API (stop it with `testid=stop-button`).+- Edited launch parameters cannot be observed after creation: the conversation's client metadata (`localStorage['openhands-agent-server-conversation-metadata']`) strips them and the Agent Server does not return a conversation's plugins. Proving delivery needs request-body capture (harness gap).+- `conversation start` and launches leave the browser on a conversation page, which has its own `chat-input`; `browser goto /plugins` before the next card step.+- Build deep links with URL-encoded base64 (`%2B`, `%2F`, `%3D`): a raw `+` decodes to a space and gives the invalid-format error. Non-ASCII text must not be used in payloads (`atob` decodes bytes as Latin-1).+- The page loads three queries (marketplace, installed, local) behind skeleton rows; wait for `testid=plugins-toolbar` before counting cards. With no plugins at all the page shows `No plugins found.` (`plugins-empty`), which the bundled catalog makes unreachable; on a Cloud backend **Add plugin** and card actions are disabled (not driven: no Cloud account).+- Local plugins under `~/.agents/plugins` appear on the next page load without a restart; the Agent Server's `HOME` is `<run>/private/home`.diff --git a/.agents/skills/verify-openhands/references/feature-map/F20-canvas-apps.md b/.agents/skills/verify-openhands/references/feature-map/F20-canvas-apps.mdnew file mode 100644index 0000000000..285c3dd68d--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F20-canvas-apps.md@@ -0,0 +1,95 @@+# F20 — Canvas apps++Canvas apps (Canvas Extensions) are trusted browser modules installed on the+active local Agent Server. Under Customize → Apps a user installs an app from a+local path or a Git source (it arrives disabled), reviews its card, enables it+through a trust confirmation, updates, disables or uninstalls it, and opens the+pages it contributes from the main sidebar rail at `/extensions/<name>/<path>`.++Source: `src/routes/canvas-extensions.tsx`, `src/routes/canvas-extension-page.tsx`, `src/components/features/canvas-extensions/`, `src/hooks/mutation/use-manage-canvas-extensions.ts`, `src/api/canvas-extensions-service.ts`, `src/utils/parse-git-tree-url.ts`, `src/components/features/sidebar/sidebar-rail-body.tsx`, `src/fixtures/canvas-extensions/demo-page/`.++## Sub-features++- `F20.entry-points`: the Apps page is reached from the sidebar **Customize** link (lands on `/mcp`) then **Apps** in the Customize navigation, from the command menu's **Customize** command plus **Apps**, from the phone Customize hub, and by direct URL `/apps`; there is no bare `/extensions` page and no "Apps" command.+- `F20.page`: `/apps` shows the title **Apps for Agent Canvas**, a description, a **Build an app** docs link (new tab), an enabled **Add app** button, the amber trust notice, the **Installed apps** heading and, with nothing installed, `No apps are installed on this backend.`+- `F20.add-modal`: **Add app** opens a form with **App source** (required), **Ref** and **Path**; **Install** stays disabled while the source is empty or blank; **Close**, the X, Escape and a backdrop click close it.+- `F20.install`: installing from a local path shows **Installing…**, toasts `App installed. Review it here, then enable it when you are ready.`, closes the form and lists the app disabled (after reload too) with no rail entry; a local **App source** plus **Path** is joined into one path.+- `F20.install-error`: a failed install toasts the server's reason (`Could not read canvas extension source: …`) and keeps the form open with the input, for local paths and for unreachable Git sources alike.+- `F20.git-tree-url`: a Git host folder URL (`…/<owner>/<repo>/tree/<ref>/<path>`) pasted into **App source** is split into source, ref and path; the card shows the repo URL as source, **Ref** (resolved commit) and **Path**.+- `F20.git-ref-path`: the **Ref** and **Path** fields apply to a Git source, including the placeholder's `github:owner/repo` shorthand; the card keeps the source as typed and shows the resolved commit and the path. Enter in a field submits the form.+- `F20.install-duplicate`: installing an app whose name is already installed is refused (`409`): the form stays open with its input, the toast says the app is already installed, and the existing card is unchanged. Today the toast also tells the user to `Use force=true to overwrite.`, which the form cannot do (see Gotchas).+- `F20.card`: each card shows the display name, source, a `role=switch` (**Enable**/**Disable**), the description, `Disabled`/`Enabled`, `v<version>` and `Pages: N` pills, each page title, and **Update** and **Uninstall** buttons.+- `F20.enable-confirm`: switching a disabled app on (click or Space) opens a trust confirmation (`confirmation-modal`) with **Cancel** and **Enable trusted app**; Cancel, Escape and a backdrop click leave it disabled, confirming enables it (persists after reload).+- `F20.rail-entry`: an enabled app's page appears in the main sidebar rail as `sidebar-canvas-extension-<name>-<pageId>` linking to `/extensions/<name>/<path>`.+- `F20.rail-active`: on the app's page its rail entry is marked current (`aria-current="page"`, highlighted); with the sidebar collapsed the entry is an icon whose tooltip and `aria-label` carry the label. App pages are not listed in the command menu.+- `F20.rail-label`: the rail entry is labelled with the page's `nav_label` (`Extension demo` for the demo fixture), falling back to its title.+- `F20.page-render`: the rail entry and the direct URL mount the app into `main` named after the page title (demo: h1 `Hello from a Canvas Extension`); a deeper URL passes the rest of the path to the app (`Nested extension path: nested`).+- `F20.page-unavailable`: an unknown app, an unknown page of a known app, or a disabled or uninstalled app shows **Not available** / `This app is disabled, missing, or does not provide this page.`+- `F20.phone`: at 390 px the Customize hub lists Apps, the Apps page, the Add form and an app page fit without horizontal overflow, and the app's entry is in the sidebar drawer.+- `F20.refresh`: **Update** re-installs from the recorded source, toasts `App updated.` and keeps the enabled state; a failed update toasts the error and leaves the card unchanged.+- `F20.persist-restart`: installed apps, their enabled state and rail entries survive a stack restart.+- `F20.disable`: switching an enabled app off happens immediately without confirmation, removes its rail entry and makes its page unavailable.+- `F20.uninstall`: **Uninstall** asks `Uninstall <display name> from this backend?`; Escape or Cancel keep the app, **Confirm** toasts `App uninstalled.` and removes the card and the rail entry.+- `F20.busy-lock`: while Update, Uninstall or Enable is pending, every card control is inert, the switch included.+- `F20.load-error`: when listing apps fails, the Installed section shows the error and a **Retry** button.+- `F20.unsupported`: on a Cloud backend, with no backend, or on an Agent Server without the apps API, the Installed section shows **Not available** with the reason and **Add app** is disabled; Cloud hides Apps from the Customize navigation.++## How to get to it (user POV)++- Main sidebar **Customize** (`sidebar-skills-link`, lands on `/mcp`), then **Apps** in the Customize navigation (`sidebar-extensions-/apps`).+- Command menu (`Control+k`/`Meta+k` or `command-menu-trigger`): search `Customize`, Enter (lands on `/mcp`), then **Apps**. Searching `Apps` finds nothing.+- Phone: `/customize` shows the Customize hub (`extensions-mobile-hub`) instead of redirecting; tap **Apps**.+- Direct URL `/apps`.+- App pages are not in the command menu; only the rail (or a URL) reaches them.+- App pages: the app's entry in the main sidebar rail (phone: the sidebar drawer, `sidebar-mobile-menu-toggle`), or the direct URL `/extensions/<name>/<path>[/<sub-path>]`.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) on the launcher's local Agent Server. No LLM is needed.+- No app is installed: `control-openhands api GET /api/canvas-extensions/installed` returns `"canvas_extensions": []`.+- Run commands from the checkout root: recipes install the bundled, reviewed fixture `$PWD/src/fixtures/canvas-extensions/demo-page` (name `demo-page`, display name `Demo page`, one page `hello` at `/hello`). Never install or enable arbitrary third-party code: enabling runs it inside Canvas.+- Git bullets (tree URL, Ref and Path, busy lock, duplicate): the Agent Server can read `https://github.com/OpenHands/OpenHands` anonymously (read-only; no account needed), and that repo's `main` holds the same reviewed fixture at `src/fixtures/canvas-extensions/demo-page`. Check both before installing, with a read-only shell step: `git clone -q --depth 1 --filter=blob:none --sparse https://github.com/OpenHands/OpenHands "$OH_VERIFY_RUN/private/qa-upstream" && git -C "$OH_VERIFY_RUN/private/qa-upstream" sparse-checkout set src/fixtures/canvas-extensions && diff -r "$OH_VERIFY_RUN/private/qa-upstream/src/fixtures/canvas-extensions/demo-page" src/fixtures/canvas-extensions/demo-page && git -C "$OH_VERIFY_RUN/private/qa-upstream" rev-parse HEAD` must print no diff and a commit. Enable a Git-installed copy only when the card's **Ref** equals that commit. If GitHub is unreachable or the diff is not empty, these bullets are blocked (a local smart-HTTP Git server would do, but `control-openhands` has no verb for one; dumb HTTP such as `python3 -m http.server` fails the Agent Server's fetch).+- Desktop viewport unless a bullet says otherwise.++- **Sidebar entry and empty page (`F20.entry-points`, `F20.page`).** From `/` run `control-openhands browser click 'testid=sidebar-skills-link' --expect-url '/mcp(\?|$)'`, `control-openhands browser click 'testid=sidebar-extensions-/apps' --expect-url '/apps(\?|$)'`, then `control-openhands browser snapshot 'testid=canvas-extensions-screen >> main'`. The snapshot shows heading `Apps for Agent Canvas`, the description `Apps are built with the Canvas Extensions API`, link `Build an app`, button `Add app`, the trust notice, heading `Installed apps` and paragraph `No apps are installed on this backend.` `control-openhands browser enabled 'testid=canvas-extensions-add-button'` is `true` and `control-openhands browser attr 'role=link[name="Build an app"]' target` is `_blank`. `control-openhands browser screenshot --feature F20.page --name empty`.+- **Command-menu entry (`F20.entry-points`).** From `/` run `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' Apps` and `control-openhands browser snapshot 'testid=command-menu'`: it reads `No commands found`. Then `control-openhands browser fill 'testid=command-menu >> role=combobox' Customize`, `control-openhands browser press Enter`, `control-openhands browser wait-url '/mcp(\?|$)'` and `control-openhands browser click 'testid=sidebar-extensions-/apps' --expect-url '/apps(\?|$)'`. `control-openhands browser goto /extensions` and `control-openhands browser snapshot 'testid=not-found-screen'` show the app's not-found page, like any unknown path: heading `Page not found`, `This address does not match any page. Check the URL, or go back to the home page.` and link `Home`.+- **Add form and its closers (`F20.add-modal`).** On `/apps` (`control-openhands browser goto /apps`; the previous bullet ends on the `/extensions` not-found page) run `control-openhands browser click 'testid=canvas-extensions-add-button'` and `control-openhands browser snapshot 'testid=add-canvas-extension-modal'`: heading `Add app`, intro `Install from a Git source or a path on the active Agent Server. The app will be installed disabled.`, textboxes `App source`, `Ref Optional`, `Path Optional`, buttons `Close` and `Install [disabled]`. After `control-openhands browser fill 'testid=add-canvas-extension-source-input' ' '`, `control-openhands browser enabled 'testid=add-canvas-extension-submit'` is still `false`. Each of `control-openhands browser click 'testid=add-canvas-extension-dismiss'`, `control-openhands browser click 'testid=add-canvas-extension-modal-close'`, `control-openhands browser press Escape` and `control-openhands browser mouse-click 20 500` (backdrop) closes it: `control-openhands browser count 'testid=add-canvas-extension-modal'` is `0` (reopen with `canvas-extensions-add-button` between them).+- **Install error, local path (`F20.install-error`).** Open the form, run `control-openhands browser fill 'testid=add-canvas-extension-source-input' /nonexistent/qa-app`, `control-openhands browser click 'testid=add-canvas-extension-submit'`, then `control-openhands browser toasts`: `Could not read canvas extension source: Local extension path does not exist: /nonexistent/qa-app`. `browser count 'testid=add-canvas-extension-modal'` stays `1` and the input keeps its value. `control-openhands browser errors --app-only` lists the expected `400` on `POST /api/canvas-extensions/install`.+- **Install error, Git source (`F20.install-error`).** In the same form run `control-openhands browser fill 'testid=add-canvas-extension-source-input' 'http://127.0.0.1:9/qa-owner/qa-missing'`, `control-openhands browser click 'testid=add-canvas-extension-submit'`, `control-openhands browser wait 'testid=add-canvas-extension-submit >> text=Install' --timeout 60000`, then `control-openhands browser toasts` and `control-openhands browser screenshot --feature F20.install-error --name git-misreported`. Expected: `Could not read canvas extension source: Failed to fetch extension from http://127.0.0.1:9/qa-owner/qa-missing` (the server's 400 detail). Today the toast reads `Disconnected (check URL or network). Check that the backend URL is correct …` (see Gotchas).+- **Install the demo (`F20.install`).** In the open form run `control-openhands browser fill 'testid=add-canvas-extension-source-input' "$PWD/src/fixtures/canvas-extensions/demo-page"` and `control-openhands browser click 'testid=add-canvas-extension-submit' --observe 'testid=add-canvas-extension-submit'`: the observed states are `Install`, `Installing… [disabled]`, `<absent>`. `control-openhands browser toasts` shows `App installed. Review it here, then enable it when you are ready.` Then `control-openhands browser reload`, `control-openhands browser attr 'testid=canvas-extension-card-demo-page >> role=switch' aria-checked` (`false`) and `control-openhands browser count 'testid=sidebar-canvas-extension-demo-page-hello'` (`0`).+- **Card (`F20.card`).** Run `control-openhands browser snapshot 'testid=canvas-extension-card-demo-page'`: heading `Demo page`, the source path, switch `Enable`, `A dependency-free fixture for the Canvas Extension page ABI.`, text `Disabled v0.1.0 Pages: 1`, list item `Hello from an extension`, buttons `Update` and `Uninstall`. `control-openhands browser screenshot --feature F20.card --name disabled`.+- **Trust confirmation (`F20.enable-confirm`).** Run `control-openhands browser click 'testid=canvas-extension-card-demo-page >> role=switch'` and `control-openhands browser snapshot 'testid=confirmation-modal'`: the paragraph `This app runs trusted JavaScript inside Agent Canvas and can make authenticated requests to the active Agent Server. Review its source and revision before enabling it.`, buttons `Cancel` and `Enable trusted app`. `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'` closes it and `aria-checked` stays `false`. Keyboard: `control-openhands browser focus 'testid=canvas-extension-card-demo-page >> role=switch'` and `control-openhands browser press Space` open it again (`browser count 'testid=confirmation-modal'` is `1`); `control-openhands browser press Escape` closes it and `api GET /api/canvas-extensions/installed` still says `"enabled": false`. Backdrop: click the switch again, `control-openhands browser mouse-click 20 500`, then `browser count 'testid=confirmation-modal'` is `0` and the API still says `"enabled": false`. Reopen with the click, then `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`, `control-openhands browser reload` and read `aria-checked`: `true`; `control-openhands browser text 'testid=canvas-extension-card-demo-page'` contains `Enabled`.+- **Rail entry (`F20.rail-entry`, `F20.rail-label`).** After enabling, run `control-openhands browser wait 'testid=sidebar-canvas-extension-demo-page-hello' --timeout 10000`, `control-openhands browser attr 'testid=sidebar-canvas-extension-demo-page-hello' href` (`/extensions/demo-page/hello`) and `control-openhands browser text 'testid=sidebar-canvas-extension-demo-page-hello'`. Expected `Extension demo` (the fixture's `nav_label`); today it reads `Hello from an extension` (see Gotchas).+- **Render the page (`F20.page-render`).** Run `control-openhands browser click 'testid=sidebar-canvas-extension-demo-page-hello' --expect-url '/extensions/demo-page/hello(\?|$)'` and `control-openhands browser snapshot 'role=main[name="Hello from an extension"]'`: heading `Hello from a Canvas Extension` and paragraph `Host API 1 on backend default-local`. Direct URL: `control-openhands browser goto /extensions/demo-page/hello/nested` and the same snapshot show the paragraph `Nested extension path: nested`. `control-openhands browser screenshot --feature F20.page-render --name rail`.+- **Active and collapsed rail entry (`F20.rail-active`).** With the demo enabled, run `control-openhands browser goto /apps`; `control-openhands browser attr 'testid=sidebar-canvas-extension-demo-page-hello' aria-current` is `null`; after `control-openhands browser click 'testid=sidebar-canvas-extension-demo-page-hello' --expect-url '/extensions/demo-page/hello(\?|$)'` it is `page`. Run `control-openhands browser click 'testid=sidebar-collapse-toggle'`: `browser visible 'testid=sidebar-canvas-extension-demo-page-hello'` stays `true` (about 40 px wide), `browser attr ... aria-label` and `control-openhands browser tooltip 'testid=sidebar-canvas-extension-demo-page-hello'` read `Hello from an extension`; `control-openhands browser screenshot --feature F20.rail-active --name collapsed` shows the highlighted icon. Expand again with `browser click 'testid=sidebar-collapse-toggle'` (its `aria-label` is `Collapse sidebar` again). Command menu: `browser goto /`, `browser press Control+k`, `browser type 'testid=command-menu >> role=combobox' Hello` and `browser snapshot 'testid=command-menu'` read `No commands found`; `browser press Escape`.+- **Unavailable page (`F20.page-unavailable`).** Run `control-openhands browser goto /extensions/qa-missing/x` and `control-openhands browser snapshot 'role=main'`: heading `Not available` and `This app is disabled, missing, or does not provide this page.` `control-openhands browser goto /extensions/demo-page/nope` shows the same card while the demo is enabled.+- **Phone (`F20.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /customize` (the URL stays `/customize`), `control-openhands browser click 'testid=extensions-mobile-hub >> testid=sidebar-extensions-/apps' --expect-url '/apps(\?|$)'`, `control-openhands browser bbox 'testid=canvas-extensions-screen'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F20.phone --name apps`. Open the form with `canvas-extensions-add-button`; `control-openhands browser bbox 'testid=add-canvas-extension-modal'` is inside the viewport with no page overflow; close it with `add-canvas-extension-dismiss`. Then `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'`, `control-openhands browser visible 'testid=sidebar-mobile-drawer >> testid=sidebar-canvas-extension-demo-page-hello'` (`true`), `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=sidebar-canvas-extension-demo-page-hello' --expect-url '/extensions/demo-page/hello(\?|$)'` and `control-openhands browser bbox 'role=main[name="Hello from an extension"]'` (inside, no overflow). Return with `control-openhands browser viewport desktop`.+- **Update (`F20.refresh`).** Note `installed_at` from `control-openhands api GET /api/canvas-extensions/installed`, then on `/apps` (`control-openhands browser goto /apps`; Phone ends on the extension page) run `control-openhands browser click 'testid=canvas-extension-refresh-demo-page'` and `control-openhands browser toasts` (`App updated.`). The API shows a newer `installed_at` and keeps `"enabled": true`; `browser count 'testid=sidebar-canvas-extension-demo-page-hello'` stays `1`.+- **Survives a restart (`F20.persist-restart`).** Run `control-openhands restart`, `control-openhands doctor`, `control-openhands browser goto /`, `control-openhands browser wait 'testid=sidebar-canvas-extension-demo-page-hello' --timeout 15000`, then `control-openhands browser goto /apps` and read the switch's `aria-checked`: `true`.+- **Update with the backend down (`F20.refresh`).** On `/apps` run `control-openhands service stop agent-server`, `control-openhands browser click 'testid=canvas-extension-refresh-demo-page'` and `control-openhands browser toasts`: `HTTP request failed (502 Bad Gateway): "Bad Gateway: connect ECONNREFUSED 127.0.0.1:<agent-server-port>"`, and the card still shows `Enabled`. Bring the stack back with `control-openhands restart` and `control-openhands doctor` before going on.+- **Disable (`F20.disable`).** On `/apps` run `control-openhands browser click 'testid=canvas-extension-card-demo-page >> role=switch'`; `control-openhands browser count 'testid=confirmation-modal'` is `0` and `control-openhands browser wait 'testid=sidebar-canvas-extension-demo-page-hello' --state detached --timeout 10000` succeeds. After `control-openhands browser reload` the switch's `aria-checked` is `false`; `control-openhands browser goto /extensions/demo-page/hello` and `browser snapshot 'role=main'` show `Not available`.+- **Uninstall (`F20.uninstall`).** Re-enable the demo on `/apps` (`control-openhands browser goto /apps`, since Disable ends on the extension page; the switch, then `testid=confirmation-modal >> testid=confirm-button`, then `browser wait 'testid=sidebar-canvas-extension-demo-page-hello'`). Run `control-openhands browser click 'testid=canvas-extension-uninstall-demo-page'` and `control-openhands browser snapshot 'testid=confirmation-modal'`: `Uninstall Demo page from this backend?`, buttons `Cancel` and `Confirm`. `control-openhands browser press Escape` leaves `browser count 'testid=canvas-extension-card-demo-page'` at `1`; so does clicking Uninstall again and `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'`. Click Uninstall again, `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'` and `control-openhands browser toasts` (`App uninstalled.`); `control-openhands browser wait 'testid=sidebar-canvas-extension-demo-page-hello' --state detached --timeout 10000` succeeds. After `control-openhands browser reload` the card count is `0`, the page shows `No apps are installed on this backend.`, and `/extensions/demo-page/hello` shows `Not available`.+- **Local source plus Path (`F20.install`).** Run `control-openhands browser goto /apps` (the Uninstall check ends on `/extensions/demo-page/hello`), `control-openhands browser click 'testid=canvas-extensions-add-button'`, `control-openhands browser fill 'testid=add-canvas-extension-source-input' "$PWD/src/fixtures/canvas-extensions"`, `control-openhands browser fill 'testid=add-canvas-extension-repo-path-input' demo-page`, `control-openhands browser click 'testid=add-canvas-extension-submit'` and `control-openhands browser wait 'testid=add-canvas-extension-modal' --state detached --timeout 30000`. The toast is `App installed. …` and `api GET /api/canvas-extensions/installed` shows `"source"` ending in `/src/fixtures/canvas-extensions/demo-page` with `"repo_path": null`. Uninstall it as above (switch untouched, so no rail check).+- **Git tree URL (`F20.git-tree-url`).** Needs the Git precondition (upstream reachable, fixture identical). Run `control-openhands browser click 'testid=canvas-extensions-add-button'`, `control-openhands browser fill 'testid=add-canvas-extension-source-input' 'https://github.com/OpenHands/OpenHands/tree/main/src/fixtures/canvas-extensions/demo-page'` (Ref and Path empty), `control-openhands browser click 'testid=add-canvas-extension-submit' --observe 'testid=add-canvas-extension-submit'` (`Installing… [disabled]` for about 0.4 to 2 s, then `<absent>`) and `control-openhands browser wait 'testid=add-canvas-extension-modal' --state detached --timeout 90000`; the toast is `App installed. …`. After `control-openhands browser reload`, `control-openhands browser snapshot 'testid=canvas-extension-card-demo-page'` shows source `https://github.com/OpenHands/OpenHands`, switch `Enable`, term `Ref` with the 40-character commit from the precondition and term `Path` with `src/fixtures/canvas-extensions/demo-page`; `api GET /api/canvas-extensions/installed` has the same `source`, `resolved_ref` and `repo_path`. `control-openhands browser screenshot --feature F20.git-tree-url --name card`.+- **Duplicate install (`F20.install-duplicate`).** With the Git-installed demo present, run `control-openhands browser errors --clear`, `control-openhands browser click 'testid=canvas-extensions-add-button'`, `control-openhands browser fill 'testid=add-canvas-extension-source-input' "$PWD/src/fixtures/canvas-extensions/demo-page"`, `control-openhands browser click 'testid=add-canvas-extension-submit'` and `control-openhands browser wait 'testid=add-canvas-extension-submit >> text=Install' --timeout 30000`. `control-openhands browser toasts` reads `Canvas extension already installed. Use force=true to overwrite.` (expected: no `force=true` hint, see Gotchas), `browser count 'testid=add-canvas-extension-modal'` stays `1`, `browser count '[data-testid^="canvas-extension-card-"]'` stays `1`, `api GET /api/canvas-extensions/installed` still shows the GitHub `source`, and `browser errors --app-only` lists the expected `409` on `POST /api/canvas-extensions/install`. Close the form with `control-openhands browser press Escape`.+- **Busy lock (`F20.busy-lock`).** Needs the Git-installed demo from the Git tree URL bullet: its Update re-clones in about 0.4 to 2 s, so issue the next commands in the same shell line as the click. Disabled app: run `control-openhands browser click 'testid=canvas-extension-refresh-demo-page'`, then at once `control-openhands browser press Space --selector 'testid=canvas-extension-card-demo-page >> role=switch'` (focuses the switch, then presses Space) and `control-openhands browser eval "[document.querySelector('[data-testid=canvas-extension-uninstall-demo-page]').disabled, document.querySelector('[data-testid=canvas-extension-card-demo-page] [role=switch]').disabled, document.activeElement.tagName].join(' ')"`, which reads `true true BODY` (Uninstall and the switch are both disabled, and the busy switch takes no focus), then `control-openhands browser count 'testid=confirmation-modal'` (`0`: Space did nothing). Read the three values in that one `eval`: each `browser enabled` call takes about 150 ms and can land after a short Update. If the `eval` reads `false` for either control, the Update ended mid-line and Space may have reached an idle switch: close any trust dialog with `control-openhands browser click 'testid=confirmation-modal >> testid=cancel-button'` and run the line again. Once `control-openhands browser toasts --history` shows `App updated.`, the keyboard works again: `browser enabled` on the switch is `true`, and `browser focus` on it, `browser press Space` and `browser count 'testid=confirmation-modal'` give `1`. Close the dialog with `testid=confirmation-modal >> testid=cancel-button`; `api GET /api/canvas-extensions/installed --pick canvas_extensions.0.enabled` is still `false`. Enabled app (only when the card's Ref equals the precondition's commit): enable it through the trust dialog and wait for `sidebar-canvas-extension-demo-page-hello`, then repeat the same line (click Update, Space on the switch, the `eval` reads `true true BODY`, no dialog). If the `eval` reads `false` for either control there and Space reached the idle switch, it turned the app off with no dialog (`api GET /api/canvas-extensions/installed --pick canvas_extensions.0.enabled` is `false`): enable it again through the trust dialog, wait for `sidebar-canvas-extension-demo-page-hello` and repeat the line. A few seconds later `api GET /api/canvas-extensions/installed --pick canvas_extensions.0.enabled` is still `true`, and after `browser reload` the switch's `aria-checked` is `true` and `browser count 'testid=sidebar-canvas-extension-demo-page-hello'` is `1`. Clean up: uninstall as above and confirm `api GET /api/canvas-extensions/installed --pick canvas_extensions` is `[]`.+- **Ref and Path with the `github:` shorthand (`F20.git-ref-path`).** Needs the Git precondition. Run `control-openhands browser click 'testid=canvas-extensions-add-button'`, `control-openhands browser fill 'testid=add-canvas-extension-source-input' 'github:OpenHands/OpenHands'`, `control-openhands browser fill 'testid=add-canvas-extension-ref-input' main`, `control-openhands browser fill 'testid=add-canvas-extension-repo-path-input' src/fixtures/canvas-extensions/demo-page`, `control-openhands browser focus 'testid=add-canvas-extension-repo-path-input'`, `control-openhands browser press Enter` (Enter submits) and `control-openhands browser wait 'testid=add-canvas-extension-modal' --state detached --timeout 90000`; the toast is `App installed. …`. After `control-openhands browser reload`, `browser snapshot 'testid=canvas-extension-card-demo-page'` shows source `github:OpenHands/OpenHands`, `Ref` with the precondition's commit and `Path` `src/fixtures/canvas-extensions/demo-page`. Uninstall it as above.+- **List error with Retry (`F20.load-error`).** Blocked: it needs an Agent Server whose `GET /api/canvas-extensions/installed` fails with a non-404 while its health checks pass. `control-openhands service stop agent-server` then `control-openhands browser goto /apps` shows the app-wide **Manage backends** gate (`Disconnected`) instead of the page, and on an already loaded page the cached list stays on screen.+- **Unsupported backends (`F20.unsupported`).** Blocked: needs a Cloud backend account (`Apps are not available on Cloud backends yet.`, Apps hidden from Customize), a state with no backend (`Add an Agent Server backend to use Apps.`), or an Agent Server that passes Canvas's version gate (1.47.0 or newer) but has no `/api/canvas-extensions` routes (`This Agent Server does not support Apps yet. Upgrade the backend and try again.`). In each case **Add app** should be disabled. Released servers cannot produce the last state: the routes ship from 1.44.1, and an older server such as `control-openhands launch --new --sdk-ref v1.43.1` (whose `GET /api/canvas-extensions/installed` is `404`) never reaches `/apps`, because every page shows the **Manage backends** gate with `Agent Canvas requires agent-server 1.47.0 or newer; this backend is running 1.43.1.` (`doctor` still reports `ok`).++## Gotchas++- The card's refresh button (`canvas-extension-refresh-<name>`) is labelled **Update**, not "Refresh".+- The trust confirmation has no title and reuses the shared `confirmation-modal`; its body repeats the amber notice. Keyboard focus is not moved into it: after Space on the switch, Tab lands on the card's **Update** button behind the dialog.+- `nav_label` is dropped by the Agent Server: `GET /api/canvas-extensions/installed` returns pages with only `id`, `title` and `path` (Agent Server 1.50.1), so the rail shows the page title (OpenHands/software-agent-sdk#5501). Keep `F20.rail-label` failing until the backend returns it.+- Install and update errors go through the shared error toast, which rewrites any message containing "failed to fetch" into the generic `Disconnected (check URL or network)…` text (#17954). Every unreachable Git source hits this because the server's detail says `Failed to fetch extension from <url>`; the local-path error is shown verbatim.+- The page states (empty, error, unsupported) and the `/extensions/...` unavailable card have no test ids; assert on text with `browser snapshot`.+- The Agent Server fetches Git sources with a shallow clone and appends `.git` to the repo URL: a test Git server must speak smart HTTP and answer both `qa-repo` and `qa-repo.git`.+- The Git bullets read the public upstream repo, so they depend on its `main` still holding the identical fixture; the precondition's `diff -r` guards that. A Git install or Update clones in about 0.4 to 2 s here (Updates measured about 0.4 to 1.5 s on 2026-10-06), long enough for the busy-lock checks when they run in the same shell line as the click and read both controls in one `eval`; on a slower network raise the `wait` timeouts, not the expectations.+- A duplicate install surfaces the Agent Server's API hint verbatim (`Canvas extension already installed. Use force=true to overwrite.`); the form has no force option, so the user's only path is **Update** or **Uninstall** on the existing card. Keep `F20.install-duplicate` failing on the `force=true` wording until the UI rewrites it.+- Busy states with a local-path source last about 50 ms: `--observe` catches `Installing…`, but checking that controls are disabled during Update needs a Git source (an upstream Update lasts about 0.4 to 2 s).+- `control-openhands launch` passes the launcher only a fixed list of environment variables (path, locale, proxy) plus its own flags: `OH_AGENT_SERVER_VERSION=<old>` in the environment is ignored (the run still gets the pinned server); use `--sdk-ref v<version>`. Any server older than 1.47.0 is gated by Canvas before `/apps` renders.+- Stopping the Agent Server makes the next full page load show the **Manage backends** gate; always `restart` and `doctor` afterwards.+- A trailing `browser errors --app-only` sweep shows a `400` per failed install by design; count only other errors.diff --git a/.agents/skills/verify-openhands/references/feature-map/F21-automations-dashboard.md b/.agents/skills/verify-openhands/references/feature-map/F21-automations-dashboard.mdnew file mode 100644index 0000000000..aa9c5567bb--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F21-automations-dashboard.md@@ -0,0 +1,131 @@+# F21 — Automations dashboard and actions++The Automate dashboard (`/automations`) is where a user sees every automation at+a glance and acts on one without opening it. It shows four overview tiles, a+search box, a Filters popover (status, trigger, sort), a grid/list view toggle,+and Active and Inactive groups of cards or rows with run health, a recent-runs+sparkline and stats. Each automation has a Play (Run now) button and a kebab+menu with Run now, View, Export, Edit, Turn on/off and Delete. The page sits in+a Dashboard/Templates sub-page shell. It is reached from the sidebar, the command+menu or a pinned home route, and it only exists when the automation interface+manifest from `@openhands/extensions` is admitted.++Source: `src/routes/automations-list.tsx`, `src/components/features/automations/` (`automation-card.tsx`, `automation-list-row.tsx`, `kebab-menu.tsx`, `build-automation-menu-items.tsx`, `delete-confirmation-modal.tsx`, `automation-view-toggle.tsx`, `empty-state.tsx`, `dashboard/`), `src/components/features/manifest/manifest-subpage-layout.tsx`, `src/components/features/manifest/manifest-overview-tiles.tsx`, `src/manifests/automation-insights.ts`, `src/manifests/automation-interface.ts`, `src/hooks/query/use-automations.ts`, `src/hooks/use-pinned-home-route.ts`, `node_modules/@openhands/extensions/automations/interface.json`.++## Sub-features++- `F21.sidebar-entry`: the sidebar **Automate** item opens `/automations` with the heading **Dashboard** and the Automate sub-page aside.+- `F21.command-menu`: the command menu offers **Automations** ("Review scheduled and webhook automations."), also found by the keywords automate, cron, schedule, webhook and jobs; choosing it opens `/automations`.+- `F21.pin-home`: the pin on the sidebar Automate item makes `/` redirect to `/automations`; unpinning restores the normal home.+- `F21.subpage-nav`: Dashboard and Templates sub-pages appear in a left aside from 1024 px up and in a horizontal strip below that (phones and tablets); the current page has `aria-current="page"`.+- `F21.manifest-404`: without an admitted automation interface manifest, `/automations` is a 404 from the layout error boundary and the Automate entries are hidden.+- `F21.health-loading`: while the health check runs, the page shows the title and three card skeletons.+- `F21.list-loading`: once the backend is healthy, the header, tiles and controls render at once while three card skeletons stand in for the list until the first page arrives.+- `F21.backend-unavailable`: when the health check fails, the page shows **Automations Unavailable** with a Retry button.+- `F21.list-error`: when the list request fails with nothing cached, the page shows **Failed to load automations** with Retry.+- `F21.add-menu`: the header **Add Automation** menu offers **Create Automation** and **Import automation**; Create Automation opens the **How to create an automation** dialog (instructions, docs link, Create Automation), which X and Escape close.+- `F21.empty-state`: with zero automations the page shows **No automations configured**, the "Create an automation" instructions, a docs link, **Create Automation** and the Recommended automations rail; the view toggle is disabled.+- `F21.empty-rail`: a Recommended automations card on the empty dashboard opens its template setup at `/automations/new/<template-id>` (F22 owns the setup flow).+- `F21.overview-tiles`: four tiles summarize the loaded org list: Automations (`N active`), Needs attention (`Latest run failed` or `No latest-run failures`), Total runs and Average duration.+- `F21.search`: the search box narrows the visible automations client-side by name, prompt, repository or model; the tiles do not change.+- `F21.filters`: the **Filters** popover filters by status (All / Active / Needs attention / Disabled) and trigger (All / Scheduled / Event-driven), counts non-default choices in a badge and offers **Reset all**; it stays open while the user changes several choices.+- `F21.sort`: Sort (Latest run / Most runs / Name) orders automations inside each group and counts as a non-default choice.+- `F21.filtered-empty`: when nothing matches, **No automations match these filters** and **Clear filters** appear; Clear filters resets search, status and trigger but keeps the sort.+- `F21.view-toggle`: the view-mode menu switches Grid and List; the choice survives a reload.+- `F21.card-grid`: a grid card shows name, prompt preview, trigger pills, sparkline, a status strip (latest run status, summary, relative time, or **No activity yet**) and Runs / Recent success / Avg. duration stats.+- `F21.list-row`: a list row shows a health dot, name, schedule or event, relative last run, run badge, sparkline, Play and kebab; its link is labelled `<name> <status>`.+- `F21.row-tooltip`: hovering a list row shows a preview card with the name, Trigger, Status and, once it has run, Last run and Task (the run summary); the Play button's tooltip reads **Run now**.+- `F21.summary-hovercard`: hovering a grid card's truncated run summary shows the full summary in a hovercard.+- `F21.sparkline-deeplink`: a sparkline bar links to `/automations/<id>?run=<runId>`, which opens the detail page with that run highlighted.+- `F21.open-detail`: kebab **View**, the row link, a card click and Enter on a focused card all open `/automations/<id>`.+- `F21.load-more`: past 50 automations a **Load more** button fetches the next page and disappears when everything is loaded.+- `F21.git-sync-button`: the header **Git Sync** button (manage permission; always on local) opens `/automations/git-sync` (see F24).+- `F21.kebab-menu`: the **Automation actions** menu lists Run now, View, Export, Edit, Turn on/Turn off and Delete, closes on Escape or an outside click, and flips above the trigger near the viewport bottom.+- `F21.run-now`: Play or kebab **Run now** on an enabled automation dispatches a run with the toast **Automation dispatched**; the card moves through Pending/Running to the result. Both are disabled on a disabled automation.+- `F21.run-now-error`: a failed dispatch shows exactly one error toast with the API message; when the automation is gone (`Automation not found`), its card then drops out of the dashboard without a reload.+- `F21.toggle`: kebab **Turn on** / **Turn off** flips the enabled flag immediately (no confirmation on the dashboard) and moves the automation between the Active and Inactive groups.+- `F21.edit`: kebab **Edit** opens the edit modal prefilled from the automation; Save persists (field-level editing is F23).+- `F21.export`: kebab **Export** downloads `<name-slug>.automation.json` with `version`, `kind: "automation"` and the spec.+- `F21.delete`: kebab **Delete** asks `Delete "<name>"? This cannot be undone.`; Cancel and the X keep it, Delete removes it for good, and Escape dismisses the dialog.+- `F21.phone`: at 390 px the dashboard has no horizontal overflow, tiles wrap 2×2 and the kebab menu stays inside the viewport.++## How to get to it (user POV)++- Sidebar **Automate** (`sidebar-automations-link`); hovering it reveals the pin (`sidebar-pin-home-toggle-automations`).+- Direct URL `/automations`; the Templates sub-page is `/automations/templates` (F22).+- Command menu (`Control+k`/`Meta+k` or `command-menu-trigger`): type `Automations` or a keyword such as `cron`, press Enter.+- With Automate pinned, `/` (logo, a bare visit) lands on `/automations`.+- Sub-page navigation: `automations-navbar-desktop` (aside) or `automations-navbar-mobile` (phone strip), links `automations-navigation-list` and `automations-navigation-templates`.+- Header **Add Automation** (`automations-add-automation`) → **Create Automation** (`automations-add-automation-create`) or **Import automation** (`automations-import-automation`, F22); on the empty dashboard, the Recommended automations rail cards (`recommended-automation-rail-card-<id>`).+- Getting-started checklist item **Schedule a task** links to `/automations` (onboarding checklist family).+- Per automation: Play (`automation-run-now-<id>`, name "Run now") and kebab (name "Automation actions") on each card or row; the card itself and the row link open the detail page (F23).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) with an active LLM profile for Run now (`control-openhands llm preset deepseek`, or `--api-key-file <file>` when the key is in a file).+- No automations exist (`control-openhands api GET /api/automation/v1` shows `"total": 0`); the recipes start from the empty state.+- Fixtures are imported through **Add Automation → Import automation** (F22 owns that flow; here it only arranges). Create the files first; each command prints the path to upload (`$OH_VERIFY_RUN/evidence/_fixtures/<name>`):+ `control-openhands fixture file --name qa-f21-alpha.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F21 Alpha","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":false,"prompt":"Reply with the single word: pong. Do not run any tools."}}'`,+ `control-openhands fixture file --name qa-f21-beta.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F21 Beta","trigger":{"type":"event","source":"github","on":"pull_request.opened"},"enabled":false,"prompt":"Beta event-driven QA fixture; never runs."}}'`,+ `control-openhands fixture file --name qa-f21-fail.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F21 Fail","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":false,"prompt":"Reply with the single word: pong.","timeout":1}}'`.+ The yearly cron (`0 0 1 1 *`) keeps a turned-on fixture from firing on its own.+- Selectors below avoid run-specific ids: `[data-testid^="automation-card-"] >> has-text=<name>` (grid) and `[data-testid^="automation-list-row-"] >> has-text=<name>` (list). The kebab menu renders in a portal with no test ids; scope its items as `role=list >> has-text=Export >> role=button[name="..."]`.++- **Sidebar entry (`F21.sidebar-entry`).** From `/` run `control-openhands browser click 'testid=sidebar-automations-link'`, `control-openhands browser url` and `control-openhands browser testids --filter automations-navigation`. The URL is `/automations`, the `main` heading is **Dashboard**, and `automations-navigation-list` and `automations-navigation-templates` are listed.+- **Command menu (`F21.command-menu`).** Run `control-openhands browser goto /` (Sidebar entry ends on `/automations`, where the URL check would pass at once), `control-openhands browser press Control+k`, `control-openhands browser type 'testid=command-menu >> role=combobox' cron`, `control-openhands browser snapshot 'testid=command-menu'`, `control-openhands browser press Enter`, then `control-openhands browser url`. The snapshot lists exactly one option, `Automations Review scheduled and webhook automations. Go` (`[selected]`, under **Navigation**), and the URL ends in `/automations`.+- **Pin as home (`F21.pin-home`).** On any page run `control-openhands browser hover 'testid=sidebar-automations-link'`, `control-openhands browser click 'testid=sidebar-pin-home-toggle-automations'`, `control-openhands browser attr 'testid=sidebar-pin-home-toggle-automations' aria-pressed` (`true`; `aria-label` becomes `Unpin as home page`), then `control-openhands browser goto /` and `control-openhands browser url`: the URL is `/automations`. Unpin with the same hover and click (`aria-pressed` `false`); `control-openhands browser goto /` then stays on `/`.+- **Sub-page navigation (`F21.subpage-nav`).** On `/automations` (`control-openhands browser goto /automations`; Pin as home ends on `/`) run `control-openhands browser click 'testid=automations-navbar-desktop >> testid=automations-navigation-templates'` (URL `/automations/templates`, h1 **Templates**), `control-openhands browser click 'testid=automations-navbar-desktop >> testid=automations-navigation-list'` and `control-openhands browser attr 'testid=automations-navbar-desktop >> testid=automations-navigation-list' aria-current` (`page`). Below 1024 px the same links live under `testid=automations-navbar-mobile` (see Phone), tablets included: run `control-openhands browser viewport tablet` (820 px), `control-openhands browser visible 'testid=automations-navbar-mobile'` (`true`) and `control-openhands browser visible 'testid=automations-navbar-desktop'` (`false`), then `control-openhands browser viewport desktop`.+- **Backend unavailable (`F21.backend-unavailable`).** Run `control-openhands service stop automation`, `control-openhands browser goto /automations`, `control-openhands browser wait-text 'Automations Unavailable'`, `control-openhands browser text 'role=main'` and `control-openhands browser screenshot --feature F21.backend-unavailable --name unavailable`. The main pane reads `Dashboard`, the subtitle, `Automations Unavailable`, `The automations backend is not available right now. ...` and `Retry`; the sidebar Automate item stays. Then `control-openhands restart` (the page stays put), `control-openhands browser click 'role=button[name="Retry"]'` and `control-openhands browser wait 'testid=automations-empty'`: the dashboard returns without a reload.+- **List error (`F21.list-error`).** The health result is cached for 30 s, and every page's sidebar checklist fetches it but not the 50-row list. Run `control-openhands browser goto /settings/secrets`, then within 30 s `control-openhands service stop automation`, `control-openhands browser click 'testid=sidebar-automations-link' --expect-url '/automations'` and `control-openhands browser wait-text 'Failed to load automations'`. The header, tiles (zeros) and Filters render above `Failed to load automations` and `Retry`; screenshot with `--feature F21.list-error --name list-error`. Then `control-openhands restart`, click `role=button[name="Retry"]` and wait for `testid=automations-empty`. Starting from `/` does not work: home loads the same list, so the cached copy is shown instead of the error.+- **List loading (`F21.list-loading`).** Run `control-openhands browser goto /settings/secrets`, then `control-openhands browser click 'testid=sidebar-automations-link' --observe '[data-testid="automation-card-skeleton"], [data-testid="automations-add-automation"]' --observe-ms 2000`. One observed state is `Add Automation` plus three empty skeleton entries (about 50 ms), followed by `Add Automation` alone.+- **Health loading and missing manifest (`F21.health-loading`, `F21.manifest-404`).** Blocked. The health-only skeleton (title and three `automation-card-skeleton`, no header buttons) shows only on the first health fetch, which the sidebar checklist always makes before a user can reach the dashboard, and stopping the service makes the fetch fail at once rather than hang. The 404 needs a build without the automation interface manifest.+- **Empty state (`F21.empty-state`).** With no automations run `control-openhands browser goto /automations`, `control-openhands browser text 'testid=automations-empty'`, `control-openhands browser enabled 'testid=automations-view-toggle'` and `control-openhands browser screenshot --feature F21.empty-state --name empty`. The text starts `No automations configured`, contains `Create an automation`, `Learn more in the documentation` and `Create Automation`, and lists the Recommended automations; `enabled` is `false`; the tiles read `Automations 0 / 0 active` and `Needs attention 0 / No latest-run failures`. **Create Automation** (`automations-create-automation`) starts a model-backed chat: see F22.+- **Add Automation menu (`F21.add-menu`).** Run `control-openhands browser click 'testid=automations-add-automation'` and `control-openhands browser snapshot 'testid=automations-add-automation-menu'`: buttons `Create Automation` and `Import automation`. `control-openhands browser press Escape` (or a click on `role=heading[name="Dashboard"]`) makes `browser count 'testid=automations-add-automation-menu'` `0`. Reopen it, `control-openhands browser click 'testid=automations-add-automation-create'` and `control-openhands browser snapshot 'role=dialog'`: `dialog "How to create an automation"` with Close, the instructions (`Create an automation` as code), `Learn more in the documentation` (`https://docs.openhands.dev/openhands/usage/automations/overview`) and `Create Automation` (`automations-create-automation`, model-backed, F22). `control-openhands browser click 'testid=add-automation-modal-close'` and `browser press Escape` each make `browser count 'testid=add-automation-modal'` `0`.+- **Recommended rail on the empty dashboard (`F21.empty-rail`).** With no automations, `control-openhands browser click 'testid=automations-empty >> testid=recommended-automation-rail-card-custom-automation' --expect-url 'automations/new'` lands on `/automations/new/custom-automation` with the **Before you start** prerequisites dialog (F22). `control-openhands browser back` returns to `/automations`; there `browser attr 'testid=recommended-automations-rail-fade-left' data-visible` is `false` and `...-fade-right` is `true` (scrolling is F03.recommended-automations-rail).+- **Arrange two automations (import, F22).** Run `control-openhands browser click 'testid=automations-add-automation'`, `control-openhands browser click 'testid=automations-import-automation'`, `control-openhands browser upload 'testid=automations-import-file' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f21-alpha.automation.json"`, `control-openhands browser click 'testid=import-automation-confirm'`, `control-openhands browser wait 'testid=import-automation-modal' --state detached`. Repeat with `qa-f21-beta.automation.json`. Both arrive disabled, under **Inactive 2**.+- **Grid cards (`F21.card-grid`).** Run `control-openhands browser reload`, `control-openhands browser snapshot 'role=main'` and `control-openhands browser screenshot --feature F21.card-grid --name grid`. Each card shows its name, prompt, pills (`pull_request.opened` + GitHub logo for Beta, `cron` for Alpha), **No activity yet**, and `Runs 0 / Recent success — / Avg. duration —`; both Play buttons are `[disabled]`.+- **Kebab menu (`F21.kebab-menu`).** Run `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F21 Alpha >> role=button[name="Automation actions"]'` and `control-openhands browser snapshot 'role=list >> has-text=Export'`: buttons `Run now [disabled]`, `View`, `Export`, `Edit`, `Turn on`, `Delete`. `control-openhands browser press Escape`, then `control-openhands browser count 'role=list >> has-text=Export'` is `0`. Reopen it and click `role=heading[name="Dashboard"]`; the count is `0` again.+- **Turn on (`F21.toggle`).** Open Alpha's kebab as above, run `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Turn on"]'`, then `control-openhands browser reload` and `control-openhands browser snapshot 'role=main'`. No dialog appears; an **Active 1** group holds QA_F21 Alpha, the Automations tile reads `2 / 1 active`, and Alpha's Play is enabled (`control-openhands browser enabled '[data-testid^="automation-card-"] >> has-text=QA_F21 Alpha >> role=button[name="Run now"]'` is `true`).+- **Run now from Play (`F21.run-now`).** Run `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F21 Alpha >> role=button[name="Run now"]'`, `control-openhands browser wait-text 'Automation dispatched'` and `control-openhands browser screenshot --feature F21.run-now --name toast`. The URL stays `/automations`, the status strip reads **Pending**, then **Running**, and Total runs becomes `1`. About 40 s later, after a reload, the strip reads **Successful** with the agent's summary and the sidebar lists a conversation titled `QA_F21 Alpha — <UTC timestamp>` (`control-openhands conversation list`).+- **List view (`F21.view-toggle`, `F21.list-row`).** Run `control-openhands browser click 'testid=automations-view-toggle'`, `control-openhands browser click 'testid=automations-view-toggle-list'`, `control-openhands browser reload`, `control-openhands browser count '[data-testid^="automation-list-row-"]'` (`2`) and `control-openhands browser eval "localStorage.getItem('openhands-automations-view')"` (`"list"`). Then `control-openhands browser text '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Alpha'` reads `QA_F21 Alpha / 0 0 1 1 * / <relative time> / <status>`, and `control-openhands browser attr '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Alpha >> role=link >> nth=0' aria-label` is `QA_F21 Alpha <status>` (for example `QA_F21 Alpha Running`). Screenshot with `control-openhands browser screenshot --feature F21.list-row --name list`. Escape closes the open view menu (`control-openhands browser count 'testid=automations-view-toggle-list'` is `0`).+- **Hover previews (`F21.row-tooltip`, `F21.summary-hovercard`).** After Alpha's run has succeeded, in list view run `control-openhands browser tooltip '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Alpha >> role=link >> nth=0'`: `QA_F21 Alpha / Trigger / 0 0 1 1 * / Status / Successful / Last run / <relative time> / Task / <the run summary>` (a row without runs shows only Trigger and `Status / No activity yet`). `control-openhands browser tooltip '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Alpha >> role=button[name="Run now"]'` is `Run now`. In grid view (`control-openhands browser click 'testid=automations-view-toggle'`, `control-openhands browser click 'testid=automations-view-toggle-grid'`), `control-openhands browser tooltip '[data-testid^="automation-card-"] >> has-text=QA_F21 Alpha >> text=Replied'` (the start of the truncated summary) returns the full summary, for example `Replied with the single word "pong" as requested, without running any tools.` Switch back with `testid=automations-view-toggle` and `testid=automations-view-toggle-list`: the next bullets count list rows.+- **Sparkline deep link (`F21.sparkline-deeplink`).** After Alpha has a run, run `control-openhands browser attr '[data-testid^="automation-activity-"] >> role=link >> nth=0' href`, `control-openhands browser click '[data-testid^="automation-activity-"] >> role=link >> nth=0'`, `control-openhands browser url` and `control-openhands browser testids --filter run`. The href and URL are `/automations/<id>?run=<runId>`, and `automation-run-highlight-<runId>` is visible. Return with `control-openhands browser goto /automations`.+- **Search (`F21.search`).** Run `control-openhands browser fill 'role=textbox[name="Search automations..."]' pong` and `control-openhands browser count '[data-testid^="automation-list-row-"]'`. The count is `1` (Alpha matches by prompt only). Then fill `zzqa-nomatch`; `control-openhands browser text 'testid=overview-tile-automations'` still reads `Automations 2 / 1 active`.+- **Filtered empty and Clear filters (`F21.filtered-empty`).** With `zzqa-nomatch` in the search box run `control-openhands browser text 'testid=automations-filtered-empty'` (`No automations match these filters` / `Clear filters`), `control-openhands browser click 'testid=automations-clear-filters'`, `control-openhands browser value 'role=textbox[name="Search automations..."]'` (empty) and the row count (`2`).+- **Filters (`F21.filters`).** Run `control-openhands browser click 'testid=automations-filters >> testid=dropdown-trigger >> nth=0'`, `control-openhands browser snapshot 'testid=automations-filters-menu'` (Filter by status `All statuses`, Filter by trigger `All triggers`, Sort automations `Latest run`), `control-openhands browser click 'testid=automations-filter-status >> testid=dropdown-trigger'`, `control-openhands browser click 'testid=automations-filter-status-disabled'`, then `control-openhands browser text 'testid=automations-filters >> testid=dropdown-trigger >> nth=0'` (`Filters 1`) and the row text (only QA_F21 Beta). The popover stays open: `control-openhands browser count 'testid=automations-filters-menu'` is `1` and `control-openhands browser attr 'testid=automations-filters >> testid=dropdown-trigger >> nth=0' aria-expanded` is `true`. In the same popover run `control-openhands browser click 'testid=automations-filter-trigger >> testid=dropdown-trigger'` and `control-openhands browser click 'testid=automations-filter-trigger-schedule'`: the badge is `Filters 2`, `testid=automations-filtered-empty` appears and the menu count is still `1` (`control-openhands browser screenshot --feature F21.filters --name two-filters`). `control-openhands browser click 'testid=automations-filters-reset'`: both rows return, the button reads `Filters` and the popover stays open. Trigger **Event-driven** (`automations-filter-trigger-event`, chosen in the same open popover) alone leaves only QA_F21 Beta. An outside click closes the popover: `control-openhands browser click 'role=heading[name="Dashboard"]'`, then the menu count is `0` and `aria-expanded` is `false`. Run `control-openhands browser reload` to clear the filter (filters are page state): the next bullets need Alpha visible.+- **Turn off (`F21.toggle`).** In list view run `control-openhands browser click '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Alpha >> role=button[name="Automation actions"]'`, `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Turn off"]'`, `control-openhands browser count 'testid=confirmation-modal'` (`0`, no confirmation), `control-openhands browser reload`. The page shows **Inactive 2** with the tile at `0 active`, and Play reports `enabled` `false`.+- **Edit from the dashboard (`F21.edit`).** Turn off (above) left both automations in the Inactive group, as Sort needs. Open Alpha's kebab, `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Edit"]'`, `control-openhands browser value 'testid=edit-automation-name'` (`QA_F21 Alpha`; `edit-automation-cron` is `0 0 1 1 *`, `edit-automation-model` is `Active profile`), `control-openhands browser fill 'testid=edit-automation-name' 'QA_F21 Zulu'`, `control-openhands browser click 'testid=edit-automation-save'`, `control-openhands browser wait 'testid=edit-automation-save' --state detached`, `control-openhands browser reload`. `control-openhands api GET /api/automation/v1` shows `QA_F21 Zulu` with the schedule unchanged.+- **Sort (`F21.sort`).** With QA_F21 Zulu (1 run) and QA_F21 Beta (no runs) both inactive, open Filters, `control-openhands browser click 'testid=automations-sort >> testid=dropdown-trigger'`, `control-openhands browser click 'testid=automations-sort-name'`, then `control-openhands browser text '[data-testid^="automation-list-row-"] >> nth=0'`. Beta comes first, the badge reads `Filters 1` and the popover stays open. Fill the search with `zzqa-nomatch` and click `testid=automations-clear-filters` (a click outside the popover, which closes it): the badge stays `Filters 1` and Beta stays first (the sort is kept). Open Filters and the sort field again and choose `automations-sort-runs`; Zulu comes first. Close the popover with `control-openhands browser click 'role=heading[name="Dashboard"]'` (`browser count 'testid=automations-filters-menu'` is `0`).+- **Export (`F21.export`).** Open Zulu's kebab, `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="Export"]'`, then `control-openhands browser downloads --last 1 --inspect`. The download path ends in `qa-f21-zulu.automation.json` (under `<run>/private/downloads/`); the inspected head holds `"version": 1`, `"kind": "automation"` and a `spec` with name, trigger, `enabled`, prompt, `model` (`null` for Active profile), timeout and timezone.+- **Open the detail page (`F21.open-detail`).** Kebab `role=list >> has-text=Export >> role=button[name="View"]`, `control-openhands browser click '[data-testid^="automation-list-row-"] >> has-text=QA_F21 Zulu >> role=link >> nth=0'`, `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F21 Zulu >> role=heading'` (grid: switch first with `control-openhands browser click 'testid=automations-view-toggle'` and `control-openhands browser click 'testid=automations-view-toggle-grid'`; the later bullets use cards), and `control-openhands browser focus '[data-testid^="automation-card-"] >> has-text=QA_F21 Beta'` + `control-openhands browser press Enter` each make `control-openhands browser url` read `/automations/<that automation's id>`. Go back with `control-openhands browser back`.+- **Git Sync button (`F21.git-sync-button`).** `control-openhands browser click 'testid=automations-git-sync'`, then `control-openhands browser url`: `/automations/git-sync` (F24).+- **Needs attention, kebab Run now (`F21.overview-tiles`, `F21.run-now`, `F21.filters`).** Run `control-openhands browser goto /automations` (the Git Sync button left `/automations/git-sync`), import `qa-f21-fail.automation.json` as above, turn it on from its kebab, then `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F21 Fail >> role=button[name="Automation actions"]'`, `control-openhands browser enabled 'role=list >> has-text=Export >> role=button[name="Run now"]'` (`true`), click it, `control-openhands browser wait-text 'Automation dispatched'`. The 1 s timeout run ends `FAILED` after about 3-4 minutes (check with `control-openhands api GET /api/automation/v1/<id>/runs`; the id is in `api GET /api/automation/v1`). Then `control-openhands browser reload`, `control-openhands browser text 'testid=overview-tile-needs-attention'` (`Needs attention 1 / Latest run failed`), and `control-openhands browser screenshot --feature F21.overview-tiles --name needs-attention`. The Fail card shows **Failed** with `Timed out: command timed out or was killed`, a red sparkline bar and `Recent success 0%`; Total runs is `2`. Open Filters and choose status `automations-filter-status-failing` (`testid=automations-filter-status >> testid=dropdown-trigger`, then `testid=automations-filter-status-failing`): only QA_F21 Fail is left. In the still-open popover click `testid=automations-filters-reset` (all three automations return), then close it with `control-openhands browser click 'role=heading[name="Dashboard"]'`: the next bullets need QA_F21 Fail and QA_F21 Beta visible.+- **Run now error (`F21.run-now-error`).** Arrange a stale card: with the dashboard open, run `control-openhands api DELETE /api/automation/v1/<QA_F21 Fail id> --write` and `control-openhands browser toasts --history --clear` (empties the toast history), then click `'[data-testid^="automation-card-"] >> has-text=QA_F21 Fail >> role=button[name="Run now"]'`, then `control-openhands browser toasts --history` and `control-openhands browser screenshot --feature F21.run-now-error --name error-toast`. The history holds exactly one toast, `Automation not found`, and no `Request failed with status code 404`. `browser errors --app-only` then lists the induced 404 on `/dispatch`. Expected: the card then drops out without a reload: `control-openhands browser wait '[data-testid^="automation-card-"] >> has-text=QA_F21 Fail' --state detached --timeout 10000` succeeds. Known failure: the wait times out and the card stays until `control-openhands browser reload` (#18062, see Gotchas).+- **Delete with confirmation (`F21.delete`).** Open Beta's kebab and click `role=list >> has-text=Export >> role=button[name="Delete"]`. `control-openhands browser snapshot 'role=dialog[name="Delete automation"]'` shows dialog `Delete automation` with `Close`, the heading, `Delete "QA_F21 Beta"? This cannot be undone.`, `Cancel` and `Delete`; focus starts on Cancel (`control-openhands browser eval "document.activeElement.textContent"` is `Cancel`). Take `control-openhands browser screenshot --feature F21.delete --name dialog`. `control-openhands browser click 'role=dialog[name="Delete automation"] >> role=button[name="Cancel"]'` closes it (`control-openhands browser count 'role=dialog[name="Delete automation"]'` is `0`) with the card kept. Reopen and close it with the X (`control-openhands browser click 'role=dialog[name="Delete automation"] >> role=button[name="Close"]'`), then reopen and `control-openhands browser press Escape`: the dialog count is `0` and the card count `1` each time. Reopen, then `control-openhands browser click 'role=dialog[name="Delete automation"] >> role=button[name="Delete"]'`, `control-openhands browser reload` and `control-openhands browser count '[data-testid^="automation-card-"] >> has-text=QA_F21 Beta'`. The count is `0`. Delete the remaining fixtures the same way (rows work too) until `testid=automations-empty` returns.+- **Load more (`F21.load-more`).** Arrange 51 inert automations (event trigger that never fires): `for i in $(seq -w 1 51); do control-openhands api POST /api/automation/v1/preset/prompt --write --data "{\"name\":\"QA_F21 Page $i\",\"prompt\":\"QA paging fixture; never runs.\",\"trigger\":{\"type\":\"event\",\"source\":\"qa-f21\",\"on\":\"qa.f21.never\"}}"; done`. Then `control-openhands browser goto /automations`, `control-openhands browser wait 'role=button[name="Load more"]'`, row/card count `50`, `control-openhands browser click 'role=button[name="Load more"]'`, `control-openhands browser wait 'role=button[name="Load more"]' --state detached`, count `51`. The preset fixtures arrive enabled (`51 active`) but never fire. Keep them for Phone (it needs at least one automation) and clean up after it.+- **Phone (`F21.phone`, `F21.subpage-nav`).** With at least one automation, run `control-openhands browser viewport phone`, `control-openhands browser bbox 'role=main'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`), `control-openhands browser screenshot --feature F21.phone --name dashboard`, `control-openhands browser click 'testid=automations-navbar-mobile >> testid=automations-navigation-templates'` (URL `/automations/templates`) and back through `automations-navigation-list`. Open the first card's kebab and run `control-openhands browser bbox 'role=list >> has-text=Export'`: the menu is `insideViewport` `true` and sits above the kebab (flipped). Take `control-openhands browser screenshot --feature F21.phone --name kebab`, then `control-openhands browser press Escape` and `control-openhands browser viewport desktop`. Now clean up the paging fixtures with `control-openhands api DELETE /api/automation/v1/<id> --write` for each `QA_F21 Page` id from `control-openhands api GET '/api/automation/v1?limit=100'` (UI deletion is covered above) until `total` is `0`.+- **Errors.** After each group, `control-openhands browser errors --app-only` shows no page errors; the only app errors are the induced 404s for the deleted QA_F21 Fail: `/dispatch` and the stale card's `/runs?limit=20&offset=0`. The backend-down recipes add 502s on `/api/automation/health`, `/sdk-version` and the list while the service is stopped; clear them with `browser errors --clear` after `restart`.++## Gotchas++- Both sub-page navs are always in the DOM (one hidden by CSS). Unscoped `testid=automations-navigation-templates` is a strict-mode violation; scope it with `testid=automations-navbar-desktop >> ` or `testid=automations-navbar-mobile >> `.+- The pin toggle is invisible until the Automate item is hovered on a fine pointer: `browser hover 'testid=sidebar-automations-link'` before clicking it. The pin is stored per backend and org in `localStorage` (`oh:pinned-home-route:<backend>:<org>`); unpin before leaving the run.+- `testid=dropdown-trigger` is reused by the backend selector, the Filters button and every inner dropdown. Always scope it (`testid=automations-filters >> testid=dropdown-trigger >> nth=0` for the Filters button, `testid=automations-filter-status >> testid=dropdown-trigger` for a field).+- The Filters popover stays open while choices change and closes only on a click outside it or on the Filters button; Escape does not close it. Open, it covers the right part of the list (in list view the first rows' Play buttons): close it with a click on `role=heading[name="Dashboard"]` before clicking row or card controls.+- A card whose automation was deleted elsewhere stays on the dashboard after its Run now fails with `Automation not found`. Expected: the card drops out once the dispatch returns 404. Known failure: nothing refetches the list after the failed dispatch, so the card stays until a reload or another list refetch (still there 2 minutes later) (#18062).+- The delete confirmation has no test ids; scope it as the named dialog `role=dialog[name="Delete automation"]`. It opens with focus on Cancel.+- Delete closes the dialog at once and shows no success toast; confirm with a reload. Turn off on the dashboard never asks for confirmation (home cards do).+- The kebab menu has no test ids; `role=list >> has-text=Export` is the reliable scope. A card's own **Run now** has the same accessible name as the kebab item, so scope Play to the card.+- Imported automations are always disabled (`Import automation` says so), and Run now is disabled until you **Turn on**. Use the yearly cron `0 0 1 1 *` or an event trigger so an enabled fixture never fires by itself, and turn it back off.+- Run now uses the active LLM profile when the automation's model is `Active profile`. A successful run creates a conversation titled `<automation name> — <UTC timestamp>` that stays after the automation is deleted. Delete it separately (`control-openhands conversation list`, conversations family) to leave the run clean.+- A timeout of 1 s does not fail fast: the run sat in `Installing dependencies` and failed with `Timed out: command timed out or was killed` about 3-4 minutes after dispatch. Budget for that when you need a failing run for Needs attention.+- The Automations tile counts only loaded pages: with 51 automations it reads `50` until **Load more** is clicked, although the API `total` is 51.+- The row health dot and label reflect the latest run only; a disabled automation with no runs reads `No activity yet`, not `Disabled`.+- In grid view a cron automation without `schedule_human` shows the pill `cron`, while list view shows the raw expression (`0 0 1 1 *`).+- The view mode persists in `localStorage` (`openhands-automations-view`), and the toggle is disabled when the org has no automations. Switch back to Grid before deleting the last automation, or the next run starts in List.+- Filters, search and sort are page state only: a reload resets them.+- `service stop automation` stops only this run's automation service; `restart` brings the whole stack back with the same state and the browser on the same page. Run `control-openhands doctor` afterwards.+- The **Automation dispatched** toast lasts only a few seconds: run `browser wait-text 'Automation dispatched'` right after the click, not after a long `--observe` window.+- `browser screenshot --full-page` at phone width does not capture below the fold, because the page scrolls inside the main pane; screenshot sections or use `bbox`.diff --git a/.agents/skills/verify-openhands/references/feature-map/F22-automation-creation.md b/.agents/skills/verify-openhands/references/feature-map/F22-automation-creation.mdnew file mode 100644index 0000000000..d8ad51f082--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F22-automation-creation.md@@ -0,0 +1,114 @@+# F22 — Creating automations: templates, setup and import++A user adds an automation in three ways. The **Templates** sub-page+(`/automations/templates`) lists the prebuilt catalog from+`@openhands/extensions` (6 featured, 17 Beta) with search; picking a card+either opens a manifest-driven setup dialog at `/automations/new/<id>`+(prerequisites → form → review → **Confirm and create**), or first asks where a+GitHub/Slack responder should run, or first asks the user to install missing+MCP integrations, or seeds a conversation with the entry's launch prompt.+**Add Automation → Create Automation** explains how to ask the agent and opens a+chat pre-filled with `Create an automation`. **Add Automation →+Import automation** reads an exported JSON file, previews it and creates it+disabled.++Source: `src/routes/automation-templates.tsx`, `src/routes/automation-setup-route.tsx`, `src/components/features/automations/` (`recommended-automations-launcher.tsx`, `recommended-automations-section.tsx`, `responder-deployment-modal.tsx`, `add-automation-modal.tsx`, `create-instructions.tsx`, `import-automation-modal.tsx`, `agent-profile-selector.tsx`), `src/components/features/manifest/`, `src/manifests/`, `src/hooks/use-launch-skill-in-chat.ts`, `src/hooks/use-responder-url-secret.ts`, `src/utils/automation-export.ts`, `src/api/automation-service/automation-service.api.ts`, `node_modules/@openhands/extensions/automations/`.++## Sub-features++- `F22.templates-page`: `/automations/templates` shows the h1 **Templates**, a description, a search box, **Start from a proven workflow** with a count badge (6) and a **Beta** section (17).+- `F22.template-card`: each card shows an icon or logo stack, name, category, two-line description, a plus badge and integration pills (`N MCPs to connect before launch`, `Needs external setup` for Jira/Bitbucket; `Connected` once installed, which needs a working integration and was not reached here); a `+N` overflow button opens a popover without launching the card.+- `F22.templates-search`: the search box narrows cards by name, category, description, launch prompt and integration names; a query that matches nothing should say so.+- `F22.template-launch-setup`: a card whose entry ships a setup form (custom-automation, news-digest, github-pr-reviewer, qa-changes, …) navigates to `/automations/new/<id>`.+- `F22.template-launch-conversation`: a card without a setup form and with no installable integration missing creates a conversation and pre-fills its composer with the entry's launch command (for example `/ticket-to-code-change:setup`); nothing is sent until the user presses send.+- `F22.template-mcp-install-queue`: a card with missing required integrations opens each one's install dialog in turn; Cancel abandons the launch without creating anything.+- `F22.responder-deployment-choice`: on a local backend a GitHub/Slack-only responder card first asks **Choose how your responder should run**; **Continue with local setup** creates the `OPENHANDS_URL` secret and continues, **Open OpenHands Cloud integrations** opens Cloud in a new tab, X and Escape cancel.+- `F22.setup-prerequisites`: **Before you start** lists the entry's integrations with the reason each is needed and **Manage integrations** (`/mcp`); Continue is disabled while a required integration is missing; an entry with nothing to check skips the step.+- `F22.setup-action-kind`: the **Action** combobox (custom-automation: Prompt / Plugin / Upload tarball) swaps the action fields and keeps shared values.+- `F22.setup-form-validation`: Continue checks fields locally (`This field is required.`, `Must be at least N characters.`, `Must be at most N.`) and a field blur sends the draft to the service, whose errors appear under the field (`Value error, Invalid cron expression: …`).+- `F22.setup-agent-profile`: the **Agent profile** combobox appears only for actions that create through `/v1` (Upload tarball and bundle entries), not for Prompt or Plugin; it lists `Default` and every saved agent profile and shows `Default` while no profile is chosen, picking a profile hides the **LLM profile** field, switching to Prompt or Plugin clears the choice, and the automation is created with that `agent_profile_id`.+- `F22.setup-plugin-create`: the **Plugin** action takes plugin sources and a prompt, and a picked **Timezone** carries through Review into the created automation (`preset_metadata.plugins`, `trigger.timezone`).+- `F22.setup-tarball-create`: the **Upload tarball** action requires a `.tar`/`.tar.gz` file, shows its file name in Review and creates an automation with the uploaded tarball and the entrypoint.+- `F22.setup-repository-list`: a repository list field has **Add** (disabled while the input is empty) and a **Remove** per row; an empty required list is refused.+- `F22.setup-review-confirm`: **Review** lists every value (`Not set` for blanks); **Back** keeps the values; **Confirm and create** creates the automation (enabled) and replaces the URL with its detail page.+- `F22.setup-bundle-create`: a bundle entry (Daily news digest) uploads its script tarball and creates an automation with the bundle's entrypoint, without any account.+- `F22.setup-unsupported`: an entry this deployment cannot run (qa-changes needs event triggers) shows **Not available**, the unmet requirements, **Close** and **Set up in a conversation**.+- `F22.setup-fallback-conversation`: **Set up in a conversation** creates a conversation seeded with the entry's setup message.+- `F22.setup-close`: X or Escape goes back in history; on a cold deep link it replaces the location with `/automations`.+- `F22.setup-unknown-id`: `/automations/new/<id>` for an id no catalog entry claims is a 404.+- `F22.create-helper-conversation`: **Add Automation → Create Automation** opens **How to create an automation**; its **Create Automation** closes the dialog, opens `/conversations` and pre-fills the composer with `Create an automation`; an agent asked to create an automation creates it.+- `F22.import-picker`: **Add Automation → Import automation** opens a dialog that explains the format (docs link), says the import is disabled, and offers a dropzone and **Choose file**.+- `F22.import-validation`: a file that is not JSON shows the toast `The selected file is not valid JSON.`; a JSON file that breaks the format shows one toast listing every issue; the dialog stays on the picker.+- `F22.import-preview`: a valid file switches the dialog to a preview (Name, Trigger, Prompt, Plugins) with the disabled notice, **Cancel** and **Import automation**.+- `F22.import-confirm`: **Import automation** reads `Importing...` while pending, closes the dialog, shows `Imported "<name>" as disabled. View automation`, and the automation is listed disabled; the toast link opens its detail page.+- `F22.import-choose-file`: **Choose file**, and a click anywhere on the dropzone, open the browser's file chooser; the chosen file is previewed.+- `F22.import-dropzone`: dragging a file over the dropzone highlights it (`data-active="true"`); dropping a `.json` file previews it like **Choose file**.+- `F22.phone`: the Templates grid, the setup dialog and the import dialog fit a 390 px viewport without horizontal overflow.++## How to get to it (user POV)++- Sidebar **Automate** (`sidebar-automations-link`), then **Templates** in the Automate sub-page nav (`automations-navbar-desktop >> automations-navigation-templates`; at phone width `automations-navbar-mobile`). The command menu has no Templates entry (searching `template` gives **No commands found**).+- Direct URLs `/automations/templates` and `/automations/new/<catalog-id>` (for example `/automations/new/custom-automation`, `/automations/new/news-digest`, `/automations/new/qa-changes`). A deep link opens the setup dialog over the page; it bypasses the responder and install-queue dialogs that a card click shows first.+- Template cards elsewhere use the same launcher: the **Recommended automations** rail on home/New Chat (F03) and on the empty dashboard (F21.empty-rail), and the onboarding say-hello step (F01).+- Dashboard header **Add Automation** (`automations-add-automation`) → **Create Automation** (`automations-add-automation-create`) or **Import automation** (`automations-import-automation`). The empty dashboard also shows the Create Automation instructions inline (`automations-empty >> automations-create-automation`).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` (the setup form's **LLM profile** field lists saved profiles; the agent check needs a model).+- No automation named `QA_F22 …` or `Daily news digest` (`control-openhands api GET '/api/automation/v1?limit=100'`), no `OPENHANDS_URL` secret (`control-openhands api GET /api/settings/secrets`) and no MCP server installed (`control-openhands api GET /api/settings`, `mcp_config` empty). An existing `OPENHANDS_URL` skips the secret creation in the responder recipe; an installed Slack/Linear/Tavily server skips its install dialog.+- Import fixtures (arrange only; each command prints the path, `$OH_VERIFY_RUN/evidence/_fixtures/<name>`):+ `control-openhands fixture file --name qa-f22-import.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F22 Imported","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":true,"prompt":"Reply with the single word: pong. Do not run any tools.","plugins":["github:OpenHands/extensions/plugins/qa-none"]}}'`,+ `control-openhands fixture file --name qa-f22-view.automation.json --content '{"version":1,"kind":"automation","spec":{"name":"QA_F22 View","trigger":{"type":"cron","schedule":"0 0 1 1 *"},"enabled":true,"prompt":"Reply with the single word: pong. Do not run any tools."}}'`,+ `control-openhands fixture file --name qa-f22-broken.json --content '{"version": 1, "kind": '` and+ `control-openhands fixture file --name qa-f22-schema.json --content '{"version":2,"kind":"automation","spec":{"name":"","trigger":{"type":"event"},"enabled":"yes","prompt":"x"}}'`.+- Every automation created here uses the yearly cron `0 0 1 1 *`, so none fires during the run.+- Tarball fixture (arrange only): `control-openhands fixture tarball --name qa-f22-tarball` writes `$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-tarball.tar.gz` (one `main.py` that prints `pong`).+- Blocked here: completing `F22.template-mcp-install-queue` (and launching a card whose only missing integration is installable, such as `research-brief-writer`) needs a real Slack, Linear or Tavily credential: the install dialog tests the connection before saving.++- **Templates page (`F22.templates-page`).** From `/` run `control-openhands browser click 'testid=sidebar-automations-link' --expect-url '/automations$'`, `control-openhands browser click 'testid=automations-navbar-desktop >> testid=automations-navigation-templates' --expect-url '/automations/templates'`, `control-openhands browser text 'role=main >> role=heading[level=1]'` (`Templates`), `control-openhands browser count '[data-testid^="recommended-automation-card-"]'` (`23`) and `control-openhands browser count 'testid=recommended-automations-beta-section >> [data-testid^="recommended-automation-card-"]'` (`17`); `browser text 'testid=recommended-automations-beta-heading'` is `Beta` and `17`. `control-openhands browser snapshot 'role=main' --max-lines 60` shows `heading "Start from a proven workflow"` with the count `6`. Take `control-openhands browser screenshot --feature F22.templates-page --name grid`. `control-openhands browser goto /automations/templates` renders the same page.+- **Cards and pills (`F22.template-card`).** Run `control-openhands browser testids 'testid=recommended-automation-card-research-brief-writer' --hidden`: `recommended-automation-icon-…`, `recommended-automation-plus-…`, `recommended-automation-pills-…` and `recommended-automation-pills-research-brief-writer-overflow` (`Show 1 more`). `control-openhands browser testids 'role=main' --hidden --filter integration` lists `automation-integration-external-jira` and `automation-integration-external-bitbucket` (`Needs external setup`). `control-openhands browser click 'testid=recommended-automation-pills-research-brief-writer-overflow'` opens a popover (`browser snapshot 'role=dialog'`: `dialog: 2 MCPs to connect before launch`) and the URL stays `/automations/templates`; `control-openhands browser press Escape` closes it (`browser count 'role=dialog'` `0`).+- **Search (`F22.templates-search`).** Run `control-openhands browser fill 'role=main >> placeholder=Search automations...' tavily` and `control-openhands browser testids 'role=main' --filter recommended-automation-card`: only `recommended-automation-card-research-brief-writer` (matched through its Tavily integration). Then `control-openhands browser fill 'role=main >> placeholder=Search automations...' qa-no-such-template`, `control-openhands browser count 'testid=recommended-automations-section'` and `control-openhands browser screenshot --feature F22.templates-search --name no-match`. Expected: a "no templates match" message. Actual: the count is `0` and `browser text 'role=main'` is only the title and description; the area under the search box is blank (recorded as `fail`). Clear with `control-openhands browser fill 'role=main >> placeholder=Search automations...' ''` (23 cards again).+- **Card opens setup, prerequisites (`F22.template-launch-setup`, `F22.setup-prerequisites`).** Run `control-openhands browser click 'testid=recommended-automation-card-custom-automation' --expect-url '/automations/new/custom-automation'` and `control-openhands browser snapshot 'testid=setup-dialog'`: heading `Before you start`, `GitHub Optional. Used when you choose a GitHub repository…`, link `Manage integrations` (`/mcp`) and `Continue`; `control-openhands browser enabled 'testid=setup-continue-button'` is `true` (an optional integration only warns). Run `control-openhands browser click 'testid=setup-continue-button'`; the heading becomes `Custom automation` and `browser testids 'testid=setup-dialog'` lists `setup-action-kind`, `setup-field-schedule` (`0 9 * * *`), `setup-field-timezone` (`UTC`), `setup-field-name`, `setup-field-model`, `setup-field-timeout`, `setup-field-prompt`, `setup-field-repository` and `setup-field-ref`. There is no Trigger selector here because this deployment only supports `cron`, and no `automation-agent-profile` because the default Prompt action cannot take one (`F22.setup-agent-profile`).+- **Validation (`F22.setup-form-validation`).** Click `testid=setup-continue-button` with the form untouched: `control-openhands browser text 'testid=setup-field-name-error'` and `... 'testid=setup-field-prompt-error'` are `This field is required.` Fill `testid=setup-field-timeout` with `5000`, `testid=setup-field-name` with `QA_F22 Custom`, `testid=setup-field-prompt` with `Reply with the single word: pong. Do not run any tools.`, click Continue: `browser text 'testid=setup-field-timeout-error'` is `Must be at most 1800.` Fill the timeout with `60`. Service preflight: `control-openhands browser fill 'testid=setup-field-schedule' 'every day'`, `control-openhands browser press Tab`, `control-openhands browser wait 'testid=setup-field-schedule-error' --timeout 5000`, then `browser text 'testid=setup-field-schedule-error'`: `Value error, Invalid cron expression: every day` (from `POST /api/automation/v1/validate`, see `browser network --last 5`). Fill the schedule with `0 0 1 1 *`, press Tab, and `control-openhands browser wait 'testid=setup-field-schedule-error' --state detached --timeout 5000` succeeds.+- **Action kinds (`F22.setup-action-kind`).** Run `control-openhands browser click 'testid=setup-action-kind'`, `control-openhands browser snapshot 'role=listbox'` (`Prompt` selected, `Plugin`, `Upload tarball`); the snapshot closes the listbox, so click `testid=setup-action-kind` again and then `control-openhands browser click 'role=listbox >> role=option[name="Plugin"]'`: `browser testids 'testid=setup-dialog'` now includes `setup-field-plugins`. Choose `Upload tarball` the same way: `setup-field-tarball`, `setup-field-entrypoint` and `setup-field-setupScript` replace prompt, repository and ref. Choose `Prompt` again; `control-openhands browser value 'testid=setup-field-name'` is still `QA_F22 Custom` and `setup-field-prompt` still holds the prompt.+- **Agent profile (`F22.setup-agent-profile`).** In the same form (Prompt action, name `QA_F22 Custom`, prompt and schedule `0 0 1 1 *` filled), `control-openhands browser count 'testid=automation-agent-profile'` is `0`; after `control-openhands browser choose 'testid=setup-action-kind' 'Plugin'` it is still `0`, and after `control-openhands browser choose 'testid=setup-action-kind' 'Upload tarball'` it is `1` (only actions that create through `/v1` can carry a profile; the preset endpoints behind Prompt and Plugin reject `agent_profile_id`). Run `control-openhands browser value 'testid=automation-agent-profile'`, `control-openhands browser click 'testid=automation-agent-profile'` and `control-openhands browser snapshot 'role=listbox'`. Expected: the value is `Default` and the listbox has `option "Default" [selected]` and `option "default"` (the seeded agent profile from `api GET /api/agent-profiles`), the same as on a fresh Upload tarball form (`F22.setup-tarball-create`). Known failure: the value is `""` and `option "Default"` has no `[selected]`: switching to Prompt or Plugin stores an empty profile id, and the selector shows that as a blank field instead of `Default` (#18061). `control-openhands browser press Escape` closes the listbox and leaves the dialog open (`browser count 'testid=setup-dialog'` is `1`). Run `control-openhands browser choose 'testid=automation-agent-profile' 'default'`: `browser count 'testid=setup-field-model'` is `0` (LLM profile hidden); `browser choose 'testid=automation-agent-profile' 'Default'` brings it back (`1`). Pick `default` again, then `control-openhands browser choose 'testid=setup-action-kind' 'Prompt'`: the selector is gone and `setup-field-model` is back (`1`). Choose `Upload tarball` once more and run `control-openhands browser value 'testid=automation-agent-profile'`. Expected: `Default` (the choice was cleared, shown as on a fresh form). Known failure: `""`, the same blank field (choosing `Default` from the list blanks it too) (#18061). Choose `Prompt` again before continuing. Creating an automation with a profile is in the Upload tarball bullet below.+- **Review and create (`F22.setup-review-confirm`).** Run `control-openhands browser click 'testid=setup-field-model'`, `control-openhands browser click 'role=listbox >> role=option[name="deepseek-flash"]'`, `control-openhands browser click 'testid=setup-continue-button'`, `control-openhands browser wait 'testid=setup-review' --timeout 10000` and `control-openhands browser snapshot 'testid=setup-dialog'`: heading `Review`, terms Action `Prompt`, Schedule `0 0 1 1 *`, Timezone `UTC`, Automation name, LLM profile `deepseek-flash`, Timeout `60`, Prompt, Repository `Not set`, Branch or ref `Not set`, and buttons `Back` and `Confirm and create`. Take `browser screenshot --feature F22.setup-review-confirm --name review`. `control-openhands browser click 'testid=setup-back-button'` returns to the form with `setup-field-name` still `QA_F22 Custom`; click Continue, wait for `setup-review` again, then `control-openhands browser click 'testid=setup-continue-button' --expect-url '/automations/[0-9a-f-]{8,}'`. `browser url` is `/automations/<id>` (the id of the new automation); after `control-openhands browser reload`, `control-openhands browser text 'role=heading[level=1]'` is `QA_F22 Custom` and `browser text 'testid=active-status-badge-active'` is `Active` (the detail page has no `main` landmark: `'role=main >> …'` times out there), and `api GET '/api/automation/v1?limit=100'` shows it `enabled: true`, `trigger.schedule` `0 0 1 1 *`, `timeout` `60`, `model` `deepseek-flash`. `control-openhands browser back` lands on `/automations/templates` (the setup URL was replaced).+- **Plugin action and timezone (`F22.setup-plugin-create`).** Run `control-openhands browser goto /automations/new/custom-automation`, click `testid=setup-continue-button`, then `control-openhands browser choose 'testid=setup-action-kind' 'Plugin'` and `control-openhands browser choose 'testid=setup-field-timezone' 'Europe/Berlin'`. Fill `testid=setup-field-schedule` with `0 0 1 1 *`, `testid=setup-field-name` with `QA_F22 Plugin`, `testid=setup-field-plugins` with `github:OpenHands/extensions/plugins/qa-none` and `testid=setup-field-prompt` with `Reply with the single word: pong. Do not run any tools.`; click Continue and `browser wait 'testid=setup-review' --timeout 10000`. `browser snapshot 'testid=setup-dialog'`: Action `Plugin`, Timezone `Europe/Berlin`, LLM profile `Not set`, Timeout `Not set`, Plugins `github:OpenHands/extensions/plugins/qa-none`. `control-openhands browser click 'testid=setup-continue-button' --expect-url '/automations/[0-9a-f-]{8,}' --timeout 60000`; `api GET '/api/automation/v1?limit=100'` shows `QA_F22 Plugin` enabled with `trigger.timezone` `Europe/Berlin` and `preset_metadata` `{preset_type: plugin, plugins: [{source: github:OpenHands/extensions/plugins/qa-none}]}`.+- **Upload tarball action, with an agent profile (`F22.setup-tarball-create`, `F22.setup-agent-profile`).** Run `control-openhands browser goto /automations/new/custom-automation`, click `testid=setup-continue-button`, `control-openhands browser choose 'testid=setup-action-kind' 'Upload tarball'` (Entrypoint defaults to `python3 main.py`, and on this fresh form `control-openhands browser value 'testid=automation-agent-profile'` is `Default`), fill `testid=setup-field-name` with `QA_F22 Tarball` and `testid=setup-field-schedule` with `0 0 1 1 *`, click Continue: `browser text 'testid=setup-field-tarball-error'` is `This field is required.` Run `control-openhands browser upload 'testid=setup-field-tarball' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-tarball.tar.gz"` and `control-openhands browser choose 'testid=automation-agent-profile' 'default'` (`browser count 'testid=setup-field-model'` is `0`); take `control-openhands browser screenshot 'testid=setup-dialog' --feature F22.setup-agent-profile --name upload-profile`. Click Continue, `browser wait 'testid=setup-review' --timeout 10000`: Review shows Action `Upload tarball`, LLM profile `Not set`, Tarball `qa-f22-tarball.tar.gz`, Entrypoint `python3 main.py`, Setup script `Not set` (Review does not list the agent profile). `control-openhands browser click 'testid=setup-continue-button' --expect-url '/automations/[0-9a-f-]{8,}' --timeout 60000`; `browser text 'role=heading[level=1]'` is `QA_F22 Tarball`, and `control-openhands api GET /api/automation/v1/<id>` (the id in the URL) shows it enabled with `entrypoint` `python3 main.py`, a `tarball_path` `oh-internal://uploads/…`, `model` `null` and `agent_profile_id` equal to the `default` profile's `id` from `control-openhands api GET /api/agent-profiles`.+- **Close (`F22.setup-close`).** From `/automations/templates` (`control-openhands browser goto /automations/templates`; the previous bullet ends on the new automation's page), `control-openhands browser click 'testid=recommended-automation-card-news-digest' --expect-url '/automations/new/news-digest'` then `control-openhands browser click 'testid=setup-dialog-close' --expect-url '/automations/templates'`; the same with `control-openhands browser press Escape` instead of X also returns to `/automations/templates`. Cold deep link: `control-openhands browser goto /automations/new/news-digest`, `control-openhands browser click 'testid=setup-dialog-close' --expect-url '/automations$'` (replaced, not back).+- **Bundle entry, min length (`F22.setup-bundle-create`, `F22.setup-form-validation`).** From `/automations/templates` (`control-openhands browser goto /automations/templates`; Close ends on `/automations`) click `testid=recommended-automation-card-news-digest` (`--expect-url '/automations/new/news-digest'`): there is no prerequisites step and the form shows `automation-agent-profile` (a bundle creates through `/v1`, so it offers a profile; leave it on `Default`), `setup-field-schedule` (`0 8 * * *`), `setup-field-timezone`, `setup-field-feeds` (three default feeds) and `setup-field-topics`. Fill `testid=setup-field-feeds` with `short` and click Continue: `browser text 'testid=setup-field-feeds-error'` is `Must be at least 8 characters.` Close (`testid=setup-dialog-close`), click the card again (the draft is gone), fill `testid=setup-field-schedule` with `0 0 1 1 *`, click Continue, `browser wait 'testid=setup-review' --timeout 10000`, then `control-openhands browser click 'testid=setup-continue-button' --expect-url '/automations/[0-9a-f-]{8,}' --timeout 60000`. The detail h1 is `Daily news digest`; `api GET '/api/automation/v1?limit=100'` shows it enabled with `entrypoint` `python3 main.py`, a `tarball_path` `oh-internal://uploads/…` and `timeout` `900`.+- **Repository list (`F22.setup-repository-list`).** Run `control-openhands browser goto /automations/new/github-pr-reviewer` (no prerequisites step locally). `control-openhands browser enabled 'testid=setup-list-repositories-add'` is `false`; fill `testid=setup-field-repositories` with `qa-org/qa-repo` (`enabled` turns `true`), click `testid=setup-list-repositories-add`: `browser text 'testid=setup-list-repositories'` starts `qa-org/qa-repo` / `Remove` and the input is empty again. `control-openhands browser click 'testid=setup-list-repositories-remove-qa-org/qa-repo'` removes it (count `0`); Continue then shows `setup-field-repositories-error` `This field is required.` Close the dialog.+- **Blocking prerequisite (`F22.setup-prerequisites`).** Run `control-openhands browser goto /automations/new/incident-retrospective-drafter`, `control-openhands browser snapshot 'testid=setup-dialog'` (Slack, Linear and Notion with reasons) and `control-openhands browser enabled 'testid=setup-continue-button'`: `false` while Slack and Linear are not installed.+- **Not available and fallback (`F22.setup-unsupported`, `F22.setup-fallback-conversation`).** Run `control-openhands browser goto /automations/new/qa-changes` and `control-openhands browser snapshot 'testid=setup-dialog'`: heading `Not available`, `This deployment does not support everything this automation needs.`, `setup-unmet-requirements` `webhookDelivery, event`, buttons `Close` and `Set up in a conversation`. Run `control-openhands browser click 'testid=setup-fallback-conversation' --expect-url '/conversations/[0-9a-f]' --timeout 60000` and `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerText"`: `/qa-changes`, a blank line and `This deployment cannot run the webhook-driven QA automation directly. Set it up in this conversation instead: …`. The message is pre-filled, not sent (no model cost until the user presses send).+- **Unknown id (`F22.setup-unknown-id`).** `control-openhands browser goto /automations/new/qa-no-such-template` then `control-openhands browser snapshot`: `heading "404"` and `Not Found`.+- **Responder choice (`F22.responder-deployment-choice`).** On `/automations/templates` (`control-openhands browser goto /automations/templates`; the previous bullet ends on a 404 page) run `control-openhands browser click 'testid=recommended-automation-card-slack-channel-monitor'` and `control-openhands browser snapshot 'testid=responder-deployment-modal'`: `Choose how your responder should run`, `Poll locally on your laptop` / `Continue with local setup`, `Use OpenHands Cloud` / `Open OpenHands Cloud integrations`. `control-openhands browser press Escape` and, after reopening, `control-openhands browser click 'testid=responder-deployment-modal-close'` each make `browser count 'testid=responder-deployment-modal'` `0`. Reopen and `control-openhands browser click 'testid=responder-deployment-open-openhands-cloud'`: the modal closes and `control-openhands browser tabs` lists tab 1 at `https://app.all-hands.dev/settings/integrations` (it can take a second to appear; rerun `browser tabs`). Close it with `control-openhands browser close-tab 1`. Reopen and `control-openhands browser click 'testid=responder-deployment-continue-local'`, `control-openhands browser wait 'testid=responder-deployment-modal' --state detached --timeout 10000`: the Slack install dialog (`testid=mcp-install-modal`, `dialog "Slack"`) opens next and `api GET /api/settings/secrets` now lists `OPENHANDS_URL`. Close it with `control-openhands browser click 'testid=mcp-install-cancel'`.+- **Install queue (`F22.template-mcp-install-queue`).** Run `control-openhands browser click 'testid=recommended-automation-card-linear-triage-assistant'`: `dialog "Linear"` (URL `https://mcp.linear.app/mcp`, optional API key). `control-openhands browser click 'testid=mcp-install-cancel'`; `browser count 'role=dialog'` is `0`, the URL stays `/automations/templates`, `control-openhands conversation list` has no new conversation and `api GET /api/settings` still has an empty `mcp_config`. Completing the queue is blocked: **Install** first tests the connection (Linear without a key: `Connection failed: HTTPStatusError: Client error '401 Unauthorized'…`; Tavily `research-brief-writer` with a dummy key: `Connection timed out. Check the URL and try again.`), so it never launches without a working credential.+- **Prompt launch (`F22.template-launch-conversation`).** Use a card whose required integrations all need external setup, so no install dialog queues: on `/automations/templates` run `control-openhands browser click 'testid=recommended-automation-pills-jira-issue-to-bitbucket-pr-overflow'` (`dialog: Bitbucket Needs external setup`), `control-openhands browser press Escape`, then `control-openhands browser click 'testid=recommended-automation-card-jira-issue-to-bitbucket-pr' --expect-url '/conversations/[0-9a-f]' --timeout 60000`. `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerText"` is `/ticket-to-code-change:setup`, and `control-openhands conversation events <id> --kinds MessageEvent --from-start` (id from the URL) has `total` `0` even 20 s later: the launch command is pre-filled, not sent (the featured copy promises "a pre-filled conversation"). Do not press send (no model cost). Take `browser screenshot --feature F22.template-launch-conversation --name prefilled`. Cards with an installable missing integration (`research-brief-writer`, Tavily) go through the install queue first and are blocked here (see Preconditions).+- **Create Automation helper (`F22.create-helper-conversation`).** On `/automations` (`control-openhands browser goto /automations`; Prompt launch ends on a conversation) run `control-openhands browser click 'testid=automations-add-automation'`, `control-openhands browser click 'testid=automations-add-automation-create'`, `control-openhands browser text 'testid=add-automation-modal >> testid=automations-create-instructions-example'` (`Create an automation`), then `control-openhands browser click 'testid=add-automation-modal >> testid=automations-create-automation' --expect-url '/conversations'` and `control-openhands browser eval "document.querySelector('[data-testid=chat-input]').innerText"`: the composer holds `Create an automation`, it has focus (`control-openhands browser eval "document.activeElement.getAttribute('data-testid')"` is `chat-input`), and the dialog is gone (`control-openhands browser count 'testid=add-automation-modal'` is `0`). Take `control-openhands browser screenshot --feature F22.create-helper-conversation --name prefilled`. Nothing is sent until the user presses send. The agent half (`conversation start` reloads `/` and replaces the composer text): `control-openhands conversation start --prompt "Create an automation now, without asking questions: name QA_F22 Agent, cron schedule 0 0 1 1 * in UTC, prompt: Reply with the single word pong. Then reply with only its id." --wait --timeout 400` finishes, and `control-openhands browser goto /automations` then `control-openhands browser count '[data-testid^="automation-card-"] >> has-text=QA_F22 Agent'` is `1`.+- **Import picker (`F22.import-picker`).** On `/automations` run `control-openhands browser click 'testid=automations-add-automation'`, `control-openhands browser click 'testid=automations-import-automation'`, `control-openhands browser attr 'testid=import-automation-modal' data-view` (`picker`) and `control-openhands browser snapshot 'testid=import-automation-modal'`: heading `Import automation`, the explanation with link `File format documentation` (`https://docs.openhands.dev/openhands/usage/agent-canvas/managing-automations#exported-file-format`), `The imported automation will be disabled until you review and enable it.`, `Drop a .json file here`, `or`, `Choose file`.+- **Bad files (`F22.import-validation`).** In the open picker run `control-openhands browser upload 'testid=automations-import-file' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-broken.json"` and `control-openhands browser toasts`: `The selected file is not valid JSON.` Then upload `qa-f22-schema.json` the same way: one toast reads `version: expected 1`, `spec.name: expected a non-empty string`, `spec.trigger.source: required for an event trigger`, `spec.trigger.on: required for an event trigger`, `spec.enabled: expected a boolean` (one per line). `data-view` stays `picker`.+- **Preview and cancel (`F22.import-preview`).** Upload `qa-f22-import.automation.json`: `data-view` is `preview` and `browser snapshot 'testid=import-automation-modal'` shows `Review the automation details before importing.`, Name `QA_F22 Imported`, Trigger `0 0 1 1 * · UTC`, the Prompt, Plugins `github:OpenHands/extensions/plugins/qa-none`, the disabled notice, `Cancel` and `Import automation`. `control-openhands browser click 'testid=import-automation-cancel'` closes it (`count` `0`); reopening shows `data-view` `picker` again.+- **Import (`F22.import-confirm`).** Reopen the dialog, upload `qa-f22-import.automation.json`, then `control-openhands browser click 'testid=import-automation-confirm' --observe 'testid=import-automation-confirm' --observe-ms 3000` (observed `Importing...` for about 50 ms, then `<absent>`) and `control-openhands browser toasts`: `Imported "QA_F22 Imported" as disabled. View automation`. The card `[data-testid^="automation-card-"] >> has-text=QA_F22 Imported` is under **Inactive**, and `api GET /api/automation/v1/<id>` has `enabled: false`, `state` `INACTIVE` and the plugin in `preset_metadata.plugins`. The toast lasts about 5 s, so follow its link in the very next command: import `qa-f22-view.automation.json` the same way, then immediately `control-openhands browser click 'role=status >> role=link[name="View automation"]' --expect-url '/automations/[0-9a-f-]{8,}'`; `browser text 'role=heading[level=1]'` is `QA_F22 View`.+- **Choose file (`F22.import-choose-file`).** On `/automations` (`control-openhands browser goto /automations`; Import ends on QA_F22 View's page) open Add Automation → Import automation and run `control-openhands browser upload-via 'testid=import-automation-choose-file' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-import.automation.json"` (answers the real file chooser): `browser attr 'testid=import-automation-modal' data-view` is `preview`. Close with `testid=import-automation-modal-close`, reopen, and `control-openhands browser upload-via 'testid=import-automation-dropzone >> text=Drop a .json file here' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-import.automation.json"`: `preview` again. `control-openhands browser press Escape` closes the dialog (`browser count 'testid=import-automation-modal'` `0`).+- **Drop a file (`F22.import-dropzone`).** Open the import dialog again and run `control-openhands browser drop-files 'testid=import-automation-dropzone' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-import.automation.json" --stage over`: `browser attr 'testid=import-automation-dropzone' data-active` is `true` (focus border). Close and reopen the dialog, then `control-openhands browser drop-files 'testid=import-automation-dropzone' "$OH_VERIFY_RUN/evidence/_fixtures/qa-f22-import.automation.json"`: `data-view` is `preview` with Name `QA_F22 Imported` (`browser text 'testid=import-automation-modal'`). Close with `testid=import-automation-modal-close`.+- **Phone (`F22.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser goto /automations/templates`, `control-openhands browser bbox 'testid=recommended-automations-section'` (`pageHorizontalOverflow` `false`) and `browser screenshot --feature F22.phone --name templates`. Click `testid=recommended-automation-card-custom-automation`, then `testid=setup-continue-button`; `browser bbox 'testid=setup-dialog'` is `insideViewport` `true` with no page overflow (`--name setup`). Close it, `control-openhands browser goto /automations`, open Add Automation → Import automation, upload `qa-f22-import.automation.json`; `browser bbox 'testid=import-automation-modal'` is `insideViewport` `true` (`--name import-preview`). Close with `testid=import-automation-modal-close`, then `control-openhands browser viewport desktop`.+- **Cleanup.** Deleting an automation is F21's flow; here remove the fixtures with `control-openhands api DELETE /api/automation/v1/<id> --write` for each `QA_F22 …` (Custom, Plugin, Tarball, Imported, View, Agent) and `Daily news digest` id from `control-openhands api GET '/api/automation/v1?limit=100'`. Delete `OPENHANDS_URL` in Settings → Secrets (`control-openhands browser click 'testid=secret-item >> has-text=OPENHANDS_URL >> testid=delete-secret-button'`, then `testid=confirmation-modal >> testid=confirm-button`, as in F14.delete) unless the next recipe wants it. The fallback and agent conversations stay in the conversation list (F04 deletes them). With zero automations, `control-openhands browser goto /automations` and `control-openhands browser click 'testid=automations-empty >> testid=automations-create-automation' --expect-url '/conversations'` pre-fill the composer from the empty-state entry point too (`browser eval "document.querySelector('[data-testid=chat-input]').innerText"` is `Create an automation`).++## Gotchas++- A card click and a deep link are different paths: from the grid, GitHub/Slack-only responders (`qa-changes`, `github-agents-md-maintainer`, `slack-channel-monitor`, …) first show the responder choice and then the GitHub/Slack install dialog, so their setup form is reachable locally only by URL (`/automations/new/<id>`).+- A card's `N MCPs to connect before launch` pill counts optional integrations too: Custom automation shows `1 MCPs to connect before launch` for GitHub, yet opens its setup at once because GitHub is optional there (#17959).+- The featured-section copy says picking a card opens "a pre-filled conversation"; most featured cards open a setup form instead.+- The setup dialog's comboboxes (Action, Agent profile, Timezone, LLM profile) are autocomplete inputs: click the field and pick the option in the same breath, scoped as `role=listbox >> role=option[name="…"]`. A `browser snapshot` between the two closes the listbox (reproduced twice), and the option click then times out after 30 s; click the field again.+- Service preflight runs 400 ms after a blur, not on every keystroke; `browser press Tab` then `browser wait` for the `-error` element.+- **Confirm and create** creates the automation enabled; only imports arrive disabled. Use a yearly cron (`0 0 1 1 *`) so nothing fires during the run.+- The **Daily news digest** entry names its automation `Daily news digest` (no `QA_` prefix); remember it in cleanup.+- The Agent profile combobox exists only while the chosen action creates through `/v1` (Upload tarball, bundle entries): the automation service rejects `agent_profile_id` on `/v1/preset/prompt` and `/v1/preset/plugin`, so the Prompt and Plugin actions hide it and switching to them clears a chosen profile. Leave it on `Default` except in the Upload tarball bullet. A cleared choice (after a switch through Prompt or Plugin, or after picking `Default`) shows as a blank field rather than `Default` (`F22.setup-agent-profile`, #18061).+- The automation detail page has no `main` landmark: read its title with `browser text 'role=heading[level=1]'`, not `'role=main >> …'`.+- The import success toast is the only path to **View automation** and disappears after about 5 s.+- **Continue with local setup** silently creates the `OPENHANDS_URL` secret (value: the app origin) the first time; F14's list then has an extra row.+- The **Install** button in a template's install dialog verifies the MCP connection before saving, so dummy credentials cannot complete the queue; nothing is saved on failure.+- Creating the first automation ticks **Schedule a task** in the sidebar Getting-started checklist (F02); a run that checks the checklist should do so before this file.+- Known issue #17959: a template search with no matches leaves a blank area with no message (`F22.templates-search`).diff --git a/.agents/skills/verify-openhands/references/feature-map/F23-automation-detail.md b/.agents/skills/verify-openhands/references/feature-map/F23-automation-detail.mdnew file mode 100644index 0000000000..360fa9e9bf--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F23-automation-detail.md@@ -0,0 +1,130 @@+# F23 — Automation detail, runs and editing++The detail page (`/automations/<id>`) shows one automation: a **Back to+Automations** link, a header with the name, an **Active**/**Inactive** badge,+**Run now**, an on/off switch and a kebab (Export, Tarball, Edit, Turn on/off,+Delete); a **Why this is paused** banner when it was turned off; the Prompt (or,+for a script automation, the Script bundle); Configuration (trigger, schedule or+event source/type/filter, LLM profile); an Activity card (Created, Last run);+and the **Activity Log** of runs with status, summary, cost, a logs dialog, a+link to each run's conversation and JSON/CSV export. The **Edit automation**+dialog changes name, prompt, agent and LLM profile, timeout and the schedule.++Source: `src/routes/automation-detail.tsx`, `src/components/features/automations/detail/`, `src/components/features/automations/delete-confirmation-modal.tsx`, `src/hooks/query/use-automation-detail.ts`, `src/hooks/query/use-bash-command-logs.ts`, `src/hooks/query/use-automation-tarball-files.ts`, `src/utils/automation-schedule.ts`, `src/utils/automation-timeout.ts`, `src/utils/automation-disabled-reason.ts`, `src/utils/automation-activity-log-export.ts`.++## Sub-features++- `F23.open-detail`: a dashboard card, a list row, the kebab **View** and a direct URL open `/automations/<id>`; browser Back from a run's conversation returns to it.+- `F23.back-link`: **Back to Automations** (on the page and on the not-found state) returns to `/automations`.+- `F23.loading`: `detail-skeleton` stands in while the automation loads.+- `F23.not-found`: an unknown id shows **Automation not found** with "The automation you're looking for doesn't exist or has been deleted." and the back link.+- `F23.backend-unavailable`: with the automation service down, the page shows **Automations Unavailable** and **Retry**; Retry recovers once the service is back.+- `F23.load-error`: when the health check is still good but the automation request fails, the page shows **Failed to load automations** and **Retry**.+- `F23.header`: the header shows the name, the Active/Inactive badge, **Run now** (disabled while inactive), the switch (`Turn on`/`Turn off`) and the **Automation actions** kebab with Export, Tarball, Edit, Turn on/Turn off and Delete.+- `F23.toggle`: the header switch flips the enabled flag at once (no confirmation); the badge, switch and Run now follow and survive a reload.+- `F23.disabled-reason`: after **Turn off**, the banner `automation-disabled-reason-banner` reads **Why this is paused** / **Turned off manually** / **Paused <time>**; it is gone while active.+- `F23.run-now`: **Run now** dispatches a run with the toast **Automation dispatched** and a Pending row appears in the log (the button reads **Starting…** only for the few ms of the request).+- `F23.run-now-error`: a failed dispatch shows exactly one error toast with the API message; when the automation is gone (`Automation not found`), the page then shows the **Automation not found** state.+- `F23.run-status-polling`: while a run is Pending or Running the log refetches every 3 s, so Pending → Running → Successful/Failed, the summary, the cost and the conversation link appear without a reload; the Activity card's **Last run** updates too.+- `F23.activity-log`: **Activity Log** shows **No activity yet** with Export disabled before the first run, then one row per run (newest first): start time, summary, cost (`$0.0000` format, `run-cost`), a logs icon, status badge (`run-status-icon-<status>`).+- `F23.run-task-outcome`: a Completed run whose agent finished with a task outcome other than success shows that outcome instead of **Successful**: `blocked` and `partial_success` read **Blocked** / **Partial** with `run-status-icon-warning`, an unrecognised status reads **Needs review** (`run-status-icon-needs-review`); the row summary is the agent's `outcome_summary`, and the Logs dialog's Task section repeats it.+- `F23.activity-log-more`: with more than 20 runs a **Load more** button grows the page by 20.+- `F23.run-no-conversation`: a finished run without a conversation reads **No Conversation**; only a script run (no agent) gets "No conversation — this run executed a script. Use View logs for its output."+- `F23.run-linked-conversation`: a run row with a conversation is a link labelled `View conversation for run at <time>` to `/conversations/<conversation_id>`, whose title is `<automation name> — <UTC timestamp>`.+- `F23.run-logs-modal`: the row's terminal icon (**View logs**) opens the **Logs** dialog with Run, Task (status, summary, `automation-task-metadata`) and System sections and Output/Error tabs showing the run command's stdout/stderr; Escape and the X close it without navigating.+- `F23.debug-with-openhands`: in the Logs dialog of a **Failed** run, **Debug with OpenHands** starts a conversation seeded with the automation, the error and the run id, and opens it.+- `F23.activity-log-export`: **Export JSON** / **Export CSV** download `<name-slug>.activity-log.json|csv` with every run, including `conversation_url`.+- `F23.run-deeplink`: `?run=<runId>` highlights that run (`automation-run-highlight-<runId>`, class `bg-focus/10`) and scrolls to it; an unknown run id highlights nothing.+- `F23.prompt-collapse`: a prompt taller than about 10 lines is clipped to 240 px with a fade (`automation-prompt-fade`) and **View More**; **View Less** collapses it again.+- `F23.configuration`: a cron automation shows Trigger **Schedule**, the Schedule and **LLM profile** (`Active profile` or the profile name).+- `F23.configuration-event`: an event automation shows Trigger **Event**, **Event Source**, **Event Type** and **Filter**, truncated at 60 characters with **Show more**/**Show less**.+- `F23.plugins-repo`: an automation created with repositories and plugins shows **Repositories** (with a branch badge) and a **Plugins** card with one chip per plugin.+- `F23.script-section`: a script (tarball) automation shows **Script** with the entrypoint and the bundle's files in place of the Prompt.+- `F23.export`: kebab **Export** downloads `<name-slug>.automation.json` (`version`, `kind: "automation"`, `spec`).+- `F23.tarball`: kebab **Tarball** downloads the automation's code bundle.+- `F23.delete`: kebab **Delete** asks `Delete "<name>"? This cannot be undone.`; Cancel keeps it, Delete removes it and returns to `/automations`.+- `F23.edit-open`: kebab **Edit** opens **Edit automation** prefilled with Name, Prompt ("Edits apply to future runs only."), Agent profile, LLM profile, Timeout (seconds) with its hint, and the schedule.+- `F23.edit-close`: X, **Cancel**, a backdrop click and Escape close the dialog without saving; reopening shows the stored values.+- `F23.edit-validation`: an empty name (**Name is required**), a bad timeout (**Timeout must be a valid number** / **must be positive** / **cannot exceed 1800 seconds**) and a bad cron (**Enter a valid cron expression** / **This cron expression will never run**) are refused inline.+- `F23.edit-save`: Save with no change just closes (no request); a change sends one PATCH, shows **Saving...**, the toast **Automation updated**, and the detail page and API reflect it.+- `F23.edit-schedule`: Frequency offers Daily, Weekdays (Mon–Fri) and Weekly; Weekly adds **Day of week**; with **Time of day** they are saved as a cron expression and read back on reopen.+- `F23.edit-time-cleared`: clearing **Time of day** on a preset schedule and saving is refused with a message instead of being dropped.+- `F23.edit-cron`: a custom cron schedule shows Frequency **Custom** and Time of day disabled, and an editable **Cron expression**.+- `F23.edit-event-readonly`: for an event automation the dialog shows Trigger Event, Event Source, Event Type and Filter as read-only text and no schedule fields.+- `F23.edit-save-error`: a failed save shows exactly one error toast with the API message and keeps the dialog open.+- `F23.phone`: at 390×844 the detail page has no horizontal overflow, and the Edit dialog fits with its title, X and Save reachable.++## How to get to it (user POV)++- Dashboard (`/automations`, F21): click a card's heading, a list row link, or the kebab **Automation actions** → **View**; a sparkline bar opens `/automations/<id>?run=<runId>` (F21.sparkline-deeplink).+- Direct URL `/automations/<id>` and `/automations/<id>?run=<runId>`. Get `<id>` from `control-openhands browser url` after opening a card, or from `control-openhands api GET /api/automation/v1`; get `<runId>` from `control-openhands api GET /api/automation/v1/<id>/runs`.+- Edit automation: the detail kebab **Edit** (exercised here); the dashboard kebab **Edit** opens the same dialog (F21.edit).+- Browser Back from a run's conversation returns to the detail page.+- The detail page has no command-menu entry and no keyboard shortcut.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and an active LLM profile for the runs: `control-openhands llm preset deepseek` (`--api-key-file <file>` when the key is in a file); the edit recipes also expect `deepseek-pro` in the LLM profile list.+- No `QA_F23` automations and no **Daily news digest** exist (`control-openhands api GET /api/automation/v1`).+- Arrange three fixtures through the API (arrange only; F22 owns creating automations in the UI). Each prints the new automation in `body` (`body.id` is `<id>`):+ `control-openhands api POST /api/automation/v1/preset/prompt --write --data '{"name":"QA_F23 Pong","prompt":"Reply with the single word: pong. Do not run any tools.","trigger":{"type":"cron","schedule":"0 9 * * *","timezone":"UTC"},"enabled":false}'`,+ `control-openhands api POST /api/automation/v1/preset/prompt --write --data '{"name":"QA_F23 Fail","prompt":"Reply with the single word: pong.","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":true}'`,+ `control-openhands api POST /api/automation/v1/preset/plugin --write --data '{"name":"QA_F23 Event","prompt":"QA line 1: reply pong.\nQA line 2: reply pong.\nQA line 3: reply pong.\nQA line 4: reply pong.\nQA line 5: reply pong.\nQA line 6: reply pong.\nQA line 7: reply pong.\nQA line 8: reply pong.\nQA line 9: reply pong.\nQA line 10: reply pong.\nQA line 11: reply pong.\nQA line 12: reply pong.\nQA line 13: reply pong.\nQA line 14: reply pong.\nQA line 15: reply pong.","plugins":[{"source":"github:qa-example/qa-plugin"}],"repos":[{"url":"https://github.com/qa-example/qa-repo","ref":"main"}],"trigger":{"type":"event","source":"github","on":"pull_request.opened","filter":"pull_request.draft == `false` && pull_request.base.ref == repository.default_branch"},"enabled":false}'`.+ Pong is a daily preset (`0 9 * * *`) created off; Fail is a yearly custom cron (`0 0 1 1 *`) created on, so it never fires by itself; Event never fires (no GitHub webhooks).+- Desktop viewport. Open a fixture's page the way a user does: `control-openhands browser goto /automations`, then `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=<name> >> role=heading' --expect-url '/automations/[0-9a-f-]+'`. Below this is called "open <name>".++- **Open from the dashboard (`F23.open-detail`, `F23.header`).** Open QA_F23 Pong, then `control-openhands browser url` (`/automations/<id>`), `control-openhands browser snapshot` and `control-openhands browser screenshot --feature F23.header --name inactive`. The snapshot shows link `Back to Automations`, heading `QA_F23 Pong` (level 1), `Inactive`, `button "Run now" [disabled]`, `switch "Turn on"` and `button "Automation actions"`, then the Prompt, Configuration, Activity (`Last run Never`) and Activity Log (`No activity yet`, `Export JSON [disabled]`, `Export CSV [disabled]`) sections. Run `control-openhands browser click 'role=button[name="Automation actions"]'` and `control-openhands browser snapshot 'role=list >> has-text=Tarball'`: buttons `Export`, `Tarball`, `Edit`, `Turn on`, `Delete`. `control-openhands browser press Escape` closes it (`browser count 'role=list >> has-text=Tarball'` is `0`).+- **Other ways in (`F23.open-detail`, `F23.back-link`).** `control-openhands browser click 'role=link[name="Back to Automations"]' --expect-url '/automations(\?|$)'`; then `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F23 Pong >> role=button[name="Automation actions"]'` and `control-openhands browser click 'role=list >> has-text=Export >> role=button[name="View"]' --expect-url '/automations/[0-9a-f-]+'` land on the same `/automations/<id>`. List view too: `control-openhands browser goto /automations`, `control-openhands browser click 'testid=automations-view-toggle'`, `control-openhands browser click 'testid=automations-view-toggle-list'`, `control-openhands browser click '[data-testid^="automation-list-row-"] >> has-text=QA_F23 Pong >> role=link >> nth=0' --expect-url '/automations/[0-9a-f-]+'`; then restore grid (`goto /automations`, the toggle, `testid=automations-view-toggle-grid`; `browser eval "localStorage.getItem('openhands-automations-view')"` is `"grid"`). `control-openhands browser goto /automations/<id>` (direct URL) shows the same page.+- **States: loading and not found (`F23.loading`, `F23.not-found`).** `control-openhands browser goto /automations/00000000-0000-0000-0000-000000000000` and at once `control-openhands browser count 'testid=detail-skeleton'` (`1`). `control-openhands browser wait-text 'Automation not found'` succeeds after about 7 s, `detail-skeleton` is then `0`, and `control-openhands browser snapshot 'role=paragraph >> text=Automation not found >> xpath=..'` lists both paragraphs and link `Back to Automations`. Screenshot with `--feature F23.not-found --name not-found`; `control-openhands browser click 'role=link[name="Back to Automations"]' --expect-url '/automations(\?|$)'`. `browser errors --app-only` lists the four induced `404`s on `/api/automation/v1/00000000-...`.+- **Backend unavailable (`F23.backend-unavailable`).** On QA_F23 Pong: `control-openhands service stop automation`, `control-openhands browser goto /automations/<id>`, `control-openhands browser wait-text 'Automations Unavailable'` and `control-openhands browser text 'role=button[name="Retry"] >> xpath=..'`: `Automations Unavailable`, `The automations backend is not available right now. Please try again later or check that the automation service is running.`, `Retry`. Then `control-openhands restart`, `control-openhands browser click 'role=button[name="Retry"]'` and `control-openhands browser wait 'role=heading[name="QA_F23 Pong"]'`: the page recovers without a reload.+- **Load error (`F23.load-error`).** `control-openhands browser goto /automations` (a fresh load, so the detail is not cached), wait for the card, `control-openhands service stop automation`, then within 30 s `control-openhands browser click '[data-testid^="automation-card-"] >> has-text=QA_F23 Pong >> role=heading' --expect-url '/automations/[0-9a-f-]+'` and `control-openhands browser wait-text 'Failed to load automations'` (after the retries, about 7 s). `control-openhands browser text 'role=button[name="Retry"] >> xpath=..'` is `Failed to load automations` / `Retry`. `control-openhands restart`, click Retry, and the detail page returns.+- **Turn on with the switch (`F23.toggle`).** On Pong run `control-openhands browser click 'role=switch[name="Turn on"]'`, `control-openhands browser wait 'testid=active-status-badge-active' --timeout 5000` and `control-openhands browser count 'testid=confirmation-modal'` (`0`: no confirmation). After `control-openhands browser reload`, `control-openhands browser text 'testid=active-status-badge-active'` is `Active`, `control-openhands browser attr 'role=switch[name="Turn off"]' aria-checked` is `true` and `control-openhands browser enabled 'role=button[name="Run now"]'` is `true`.+- **Run now and live status (`F23.run-now`, `F23.run-status-polling`, `F23.activity-log`).** Run `control-openhands browser click 'role=button[name="Run now"]'`, then at once `control-openhands browser toasts` (`Automation dispatched`) and `control-openhands browser testids 'testid=automation-activity-log'` (`run-status-icon-pending`). Without reloading, repeat `control-openhands browser text 'testid=automation-activity-log'` every few seconds: `Pending`, then `Running` (`run-status-icon-running`) after about 5-20 s, then about 30-60 s after dispatch `<weekday, month day, year at h:mm AM>`, the agent's summary (for example `Replied with the single word "pong" as requested, without running any tools.`), a cost such as `$0.0018` and `Successful` (`run-status-icon-completed`, `run-cost` with title `Cost`). `control-openhands browser text 'role=heading[name="Activity"][exact] >> xpath=ancestor::div[2]'` (without `[exact]` it also matches **Activity Log** and returns two texts) reads `Last run` / `Just now`. Screenshot with `control-openhands browser screenshot --feature F23.run-status-polling --name completed`.+- **Linked conversation (`F23.run-linked-conversation`).** Run `control-openhands browser attr 'testid=automation-activity-log >> role=link' href` (`/conversations/<conversation_id>`) and `... aria-label` (`View conversation for run at <time>`), then `control-openhands browser click 'testid=automation-activity-log >> role=link' --expect-url '/conversations/'` and `control-openhands browser text 'testid=conversation-name'`: `QA_F23 Pong — <YYYY-MM-DD HH:MM:SS> UTC`. `control-openhands browser back` returns to the detail page (`browser wait 'testid=automation-activity-log'`).+- **Run deep link (`F23.run-deeplink`).** Get `<runId>` from `control-openhands api GET /api/automation/v1/<id>/runs` (`body.runs[0].id`). `control-openhands browser goto '/automations/<id>?run=<runId>'`, `control-openhands browser wait 'testid=automation-run-highlight-<runId>'` and `control-openhands browser attr 'testid=automation-run-highlight-<runId>' class` (`bg-focus/10`). With `?run=00000000-0000-0000-0000-000000000000`, `control-openhands browser testids --filter highlight` lists nothing.+- **Logs dialog (`F23.run-logs-modal`).** Run `control-openhands browser click 'testid=automation-activity-log >> title=View logs'`, `control-openhands browser url` (unchanged: the click does not follow the row link) and `control-openhands browser snapshot 'role=dialog'`: `dialog "Logs"` with `Run` `COMPLETED`, `Task` `Successful` plus the summary and `Task metadata` (`automation-task-metadata`: the finish tool's extra fields, for example `{ "message": "pong", "summary": "Replied with the single word pong as requested" }`; the keys vary with what the agent sent), `System` `No system issues reported.`, and tabs `Output [selected]` / `Error`. `control-openhands browser text 'testid=run-logs-output-stdout'` is the run command's stdout: it starts `[setup] Fetching SDK version from automation service` and contains `=== EXECUTION MODE ===` and `mode: LOCAL` (the same text `control-openhands api GET '/api/bash/bash_events/search?kind__eq=BashOutput&command_id__eq=<bash_command_id>'` returns; `bash_command_id` from the runs API). Screenshot with `--feature F23.run-logs-modal --name output`. `control-openhands browser click 'role=dialog >> role=tab[name="Error"]'` selects Error (`aria-selected` `true`); `control-openhands browser press Escape` makes `browser count 'role=dialog'` `0`. Request scope: `control-openhands browser reload` (a reopened dialog reuses its cached logs), `control-openhands browser network --clear`, click `testid=automation-activity-log >> title=View logs` again and run `control-openhands browser network --filter bash`: only `GET /api/bash/bash_events/search` (server level, `200`), no `/api/conversations/<id>/bash/...` although this run has a conversation. Escape.+- **Export the log (`F23.activity-log-export`).** `control-openhands browser click 'testid=activity-log-export-json'` then `control-openhands browser downloads --last 1 --inspect`: `qa-f23-pong.activity-log.json` with `runs[]` holding `run_id`, `automation_name`, `trigger`, `start_time`, `end_time`, `duration_seconds`, `status` `COMPLETED`, `conversation_id` and `conversation_url` (`http://127.0.0.1:<port>/conversations/<id>`). `control-openhands browser click 'testid=activity-log-export-csv'` and the same `downloads` call: `qa-f23-pong.activity-log.csv` with header `run_id,automation_id,automation_name,trigger,start_time,end_time,duration_seconds,status,conversation_id,conversation_url,error,cost,phase`.+- **Export and Tarball (`F23.export`, `F23.tarball`).** `control-openhands browser click 'role=button[name="Automation actions"]'`, `control-openhands browser click 'role=list >> has-text=Tarball >> role=button[name="Export"]'`, `control-openhands browser downloads --last 1 --inspect`: `qa-f23-pong.automation.json` with `"version": 1`, `"kind": "automation"` and `spec` (name, trigger, `enabled`, prompt, `model` `null`, `timeout` `600`, `timezone`). Reopen the kebab and click `role=list >> has-text=Tarball >> role=button[name="Tarball"]`; `control-openhands browser downloads --last 1` lists `QA_F23_Pong.tar` (about 9 KB) and no toast appears. The file is gzip data despite the name: `tar -tzf <path>` lists `main.py`, `finish_tool_hook.py`, `prompt.txt`, `setup.sh`.+- **Turn off and the paused banner (`F23.disabled-reason`, `F23.toggle`).** While Pong is active `control-openhands browser count 'testid=automation-disabled-reason-banner'` is `0`. Open the kebab, `control-openhands browser click 'role=list >> has-text=Tarball >> role=button[name="Turn off"]'`, `control-openhands browser count 'testid=confirmation-modal'` (`0`), `control-openhands browser reload`, `control-openhands browser text 'testid=automation-disabled-reason-banner'`: `Why this is paused` / `Turned off manually` / `Paused Just now` (`automation-disabled-reason-text`, `automation-disabled-reason-timestamp`). The badge reads `Inactive` and Run now is disabled. Screenshot with `--feature F23.disabled-reason --name manual`.+- **Edit fields and closing (`F23.edit-open`, `F23.edit-close`).** On Pong run `control-openhands browser click 'role=button[name="Automation actions"]'`, `control-openhands browser click 'role=list >> has-text=Tarball >> role=button[name="Edit"]'` and `control-openhands browser snapshot 'role=form'`: form `Edit automation` with textbox `Name` (`QA_F23 Pong`), textbox `Prompt` and `Edits apply to future runs only.`, combobox `Agent profile` (`Default`), combobox `LLM profile` (`Active profile`), spinbutton `Timeout (seconds) Optional` (`600`) with `edit-automation-timeout-hint` (`Maximum time a single run may take. Leave empty for the default of 600 seconds (10 minutes); maximum 1800 seconds (30 minutes).`), combobox `Frequency` (`Daily`), textbox `Time of day` (`09:00`), `Cancel` and `Save`. Each of these closes it (`browser count 'testid=edit-automation-save'` is `0`): `control-openhands browser click 'testid=edit-automation-cancel'`, `control-openhands browser click 'role=form[name="Edit automation"] >> xpath=.. >> role=button[name="Cancel"] >> nth=0'` (the X) and `control-openhands browser mouse-click 1400 950` (backdrop). Expected for Escape too, but today `control-openhands browser press Escape` leaves the count at `1` (see Gotchas). After changing the timeout and cancelling, reopening shows `600` again.+- **Validation (`F23.edit-validation`).** In the dialog run `control-openhands browser fill 'testid=edit-automation-name' ''` and `control-openhands browser click 'testid=edit-automation-save'`: `control-openhands browser snapshot 'role=form' --max-lines 6` shows `textbox "Name Name is required" [invalid]` and `alert: Name is required`. Refill the name, then fill `testid=edit-automation-timeout` with `1.5`, `0` and `1801` in turn, clicking Save after each; `control-openhands browser text 'testid=edit-automation-timeout >> xpath=ancestor::label[1]/..'` contains `Timeout must be a valid number`, `Timeout must be positive` and `Timeout cannot exceed 1800 seconds` respectively, and the dialog stays open. Cancel.+- **No-change Save (`F23.edit-save`).** Reopen Edit, `control-openhands browser network --clear`, click `testid=edit-automation-save`, then `control-openhands browser network --last 20`: the dialog is closed and no PATCH was sent; `browser toasts` is empty.+- **Weekly schedule, model and timeout (`F23.edit-schedule`, `F23.edit-save`).** Reopen Edit and run `control-openhands browser click 'testid=edit-automation-frequency'`, `control-openhands browser snapshot 'role=listbox'` (`Daily [selected]`, `Weekdays (Mon–Fri)`, `Weekly`), `control-openhands browser click 'role=option[name="Weekly"]'`, `control-openhands browser click 'testid=edit-automation-weekday'`, `control-openhands browser click 'role=option[name="Wednesday"]'`, `control-openhands browser fill 'testid=edit-automation-time' 10:30`, `control-openhands browser click 'testid=edit-automation-model'`, `control-openhands browser click 'role=option[name="deepseek-pro"]'`, `control-openhands browser fill 'testid=edit-automation-timeout' 300` and `control-openhands browser screenshot --feature F23.edit-schedule --name weekly-form`. Then `control-openhands browser network --clear`, `control-openhands browser click 'testid=edit-automation-save' --observe 'testid=edit-automation-save' --observe-ms 1500` (`Save` → `Saving...` → absent) and `control-openhands browser wait-text 'Automation updated' --timeout 5000`. `browser network --last 20` shows one `PATCH /api/automation/v1/<id>`. After `control-openhands browser reload`, `control-openhands browser text 'role=heading[name="Configuration"] >> xpath=ancestor::div[2]'` reads `Schedule` `30 10 * * 3` and `LLM profile` `deepseek-pro`; `control-openhands api GET /api/automation/v1/<id>` has `timeout` `300` and `enabled` `false`. Reopening Edit shows `Weekly`, `Wednesday`, `10:30` (`browser value 'testid=edit-automation-weekday'` etc.).+- **Cleared time (`F23.edit-time-cleared`).** Reopen Edit, `control-openhands browser fill 'testid=edit-automation-time' ''`, `control-openhands browser network --clear`, click Save. Expected: an inline message and the dialog stays open. Today the dialog closes as if saved, `browser network --last 20` shows no PATCH and the schedule stays `30 10 * * 3`.+- **Custom cron (`F23.edit-cron`).** Open QA_F23 Fail and Edit. `control-openhands browser value 'testid=edit-automation-frequency'` is `Custom` and `control-openhands browser enabled 'testid=edit-automation-frequency'` and `... 'testid=edit-automation-time'` are `false`; `testid=edit-automation-cron` holds `0 0 1 1 *` (placeholder `*/10 * * * *`). Fill the cron with `not a cron`, click Save, and `control-openhands browser text 'testid=edit-automation-cron >> xpath=ancestor::label[1]'` adds `Enter a valid cron expression`; with `0 0 31 2 *` it reads `This cron expression will never run`. Fill `0 0 2 1 *` and `testid=edit-automation-timeout` with `1` (this makes the next run fail), Save, `browser wait-text 'Automation updated'`; after a reload the Configuration shows `0 0 2 1 *`.+- **Failed run, its row and Debug with OpenHands (`F23.run-status-polling`, `F23.run-no-conversation`, `F23.run-logs-modal`, `F23.debug-with-openhands`).** On QA_F23 Fail (timeout `1` from the previous bullet) click `role=button[name="Run now"]` and `control-openhands browser wait-text 'Automation dispatched'`. The run stays Running for about 3-4 minutes and ends `FAILED` (poll `control-openhands api GET /api/automation/v1/<id>/runs`; drive the event automation bullets meanwhile). Then `control-openhands browser goto /automations`, open QA_F23 Fail, `control-openhands browser wait 'testid=automation-activity-log >> testid=run-status-icon-failed'` and `control-openhands browser text 'testid=automation-activity-log'`: the newest row reads `<time>`, `Timed out: command timed out or was killed`, `Failed`. Expected beside the time: `No Conversation` (this is a prompt automation); today it reads `No conversation — this run executed a script. Use View logs for its output.` Run `control-openhands browser click 'testid=automation-activity-log >> title=View logs >> nth=0'` and `control-openhands browser snapshot 'role=dialog'`: `Run` `FAILED`, `Task` `No task outcome reported.`, `System` `Error: Timed out: command timed out or was killed` and `Status detail: ...`, the Output tab with the `[setup] Fetching SDK version ...` lines, and button `Debug with OpenHands`. Screenshot with `--feature F23.debug-with-openhands --name failed-logs`. `control-openhands browser click 'testid=debug-automation-button' --expect-url '/conversations/'` opens a new conversation; `control-openhands conversation events <conversation id from browser url> --kinds MessageEvent` starts `The scheduled automation "QA_F23 Fail" failed during a run. Please investigate the error and fix the root cause.`, and `control-openhands browser eval "document.body.innerText.includes('Timed out: command timed out or was killed')"` is `true` (the page also shows the run id). The agent then works on that prompt with the active profile.+- **Task outcome badge (`F23.run-task-outcome`).** Arrange (API, arrange only) `control-openhands api POST /api/automation/v1/preset/prompt --write --data '{"name":"QA_F23 Blocked","prompt":"Do not run any tools. Call the finish tool right away with status \"blocked\" and outcome_summary \"QA blocked on purpose\".","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":true}'` (a good thing to do while the Fail run is still running). Open QA_F23 Blocked, click `role=button[name="Run now"]`, and poll `control-openhands browser text 'testid=automation-activity-log'` until it leaves Running (about 35 s): `<time>`, `QA blocked on purpose`, a cost such as `$0.0016`, `Blocked`; `control-openhands browser testids 'testid=automation-activity-log'` lists `run-status-icon-warning` (not `-completed`) although `api GET /api/automation/v1/<id>/runs` has `status` `COMPLETED` and `run_metadata.finish_tool_response.status` `blocked`. `control-openhands browser click 'testid=automation-activity-log >> title=View logs'` and `browser snapshot 'role=dialog'`: `Run` `COMPLETED`, `Task` `Blocked` / `QA blocked on purpose` / `Task metadata` `{ "message": ... }`. Screenshot with `--feature F23.run-task-outcome --name blocked`, Escape. `partial_success` (**Partial**) and an unknown status (**Needs review**, `run-status-icon-needs-review`) follow the same path; only `blocked` was driven.+- **Event automation (`F23.prompt-collapse`, `F23.configuration-event`, `F23.plugins-repo`).** Open QA_F23 Event. `control-openhands browser bbox 'testid=automation-prompt-content'` is 240 px high, `testid=automation-prompt-fade` is present and `control-openhands browser text 'testid=automation-prompt-toggle'` is `View More`; screenshot with `--feature F23.prompt-collapse --name collapsed`. Click the toggle: height 360, no fade, text `View Less`; click again to collapse. `control-openhands browser text 'role=heading[name="Configuration"] >> xpath=ancestor::div[2]'` reads `Trigger Event`, `Event Source github`, `Event Type pull_request.opened`, `Filter pull_request.draft == `false` && pull_request.base.ref == re…`, `Show more`, `LLM profile Active profile`. `control-openhands browser click 'role=button[name="Show more"]'` shows the full filter and `control-openhands browser attr 'role=button[name="Show less"]' aria-expanded` is `true`. Expected: **Repositories** `https://github.com/qa-example/qa-repo` with a `main` badge and a **Plugins** card with `github:qa-example/qa-plugin`. Today `control-openhands browser count 'role=heading[name="Plugins"]'` is `0` and no Repositories field renders (see Gotchas); screenshot with `--feature F23.plugins-repo --name event-no-plugins`.+- **Event trigger in Edit (`F23.edit-event-readonly`).** On QA_F23 Event open Edit: `control-openhands browser count 'testid=edit-automation-frequency'` is `0` and `control-openhands browser text 'role=form[name="Edit automation"] >> text=Event Source >> xpath=ancestor::div[2]'` reads `Trigger Event / Event Source github / Event Type pull_request.opened / Filter <full filter>`. Screenshot with `--feature F23.edit-event-readonly --name event`, then Cancel.+- **Phone (`F23.phone`).** Run `control-openhands browser viewport phone`, open QA_F23 Pong, `control-openhands browser bbox 'role=heading[name="QA_F23 Pong"] >> xpath=ancestor::div[3]'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F23.phone --name detail` (the name and Run now wrap). Open Edit, then `control-openhands browser bbox 'role=form[name="Edit automation"] >> xpath=..'` and `control-openhands browser bbox 'testid=edit-automation-save'`. Expected: both `insideViewport` `true`. Today the dialog is about 940 px high with `y` about `-48`, Save sits at `y` 831 (`insideViewport` `false`), the X at a negative `y` (about -30), and `control-openhands browser scroll 'testid=edit-automation-save'` cannot move it; screenshot with `--feature F23.phone --name edit-weekly`. Cancel and `control-openhands browser viewport desktop`.+- **Run now and save errors (`F23.run-now-error`, `F23.edit-save-error`).** Arrange a stale page: open QA_F23 Fail, then `control-openhands api DELETE /api/automation/v1/<Fail id> --write`. Run `control-openhands browser toasts --history --clear` (empties the toast history), click `role=button[name="Run now"]`, then `control-openhands browser toasts --history` and `control-openhands browser screenshot --feature F23.run-now-error --name toasts`: exactly one toast, `Automation not found`, and no `Request failed with status code 404`. Expected: the page then shows **Automation not found**: `control-openhands browser wait 'role=heading[name="QA_F23 Fail"]' --state detached --timeout 15000` succeeds (the not-found state takes about 7 s, as in States) and `control-openhands browser snapshot 'role=paragraph >> text=Automation not found >> xpath=..'` lists link `Back to Automations` (do not use `wait-text 'Automation not found'` here: the toast has the same text). Known failure: the wait times out and the page keeps heading `QA_F23 Fail`, `Active` and an enabled **Run now** (`control-openhands browser enabled 'role=button[name="Run now"]'` is `true`) until a reload (#18062). The save error does not reuse that page (it is gone once #18062 is fixed): arrange a second fixture, `control-openhands api POST /api/automation/v1/preset/prompt --write --data '{"name":"QA_F23 Stale","prompt":"Reply with the single word: pong.","trigger":{"type":"cron","schedule":"0 0 1 1 *","timezone":"UTC"},"enabled":false}'` (`body.id` is `<stale-id>`), then open QA_F23 Stale (`control-openhands browser goto /automations` and the card heading, as in Preconditions), `control-openhands browser click 'role=button[name="Automation actions"]'` and `control-openhands browser click 'role=list >> has-text=Tarball >> role=button[name="Edit"]'`. With the dialog open, `control-openhands api DELETE /api/automation/v1/<stale-id> --write` and `control-openhands browser toasts --history --clear`. Fill `testid=edit-automation-name` with `QA_F23 Stale renamed` and click `testid=edit-automation-save`: the dialog stays open (`browser count 'testid=edit-automation-save'` `1`, `browser value 'testid=edit-automation-name'` still `QA_F23 Stale renamed`), and `control-openhands browser toasts --history` holds exactly one toast, `Automation not found`; screenshot with `--feature F23.edit-save-error --name toast`. Close it with `control-openhands browser click 'testid=edit-automation-cancel'`. `browser errors --app-only` lists the induced `POST /api/automation/v1/<Fail id>/dispatch` and `PATCH /api/automation/v1/<stale-id>` 404s; both fixtures are already deleted.+- **Load more runs (`F23.activity-log-more`).** Not run: it needs more than 20 runs of one automation (about 35 s and one model call each). With them, `control-openhands browser click 'testid=automation-activity-log >> role=button[name="Load more"]'` grows the list from 20 to 40 rows.+- **Script automation (`F23.script-section`).** Arrange a script automation through F22's bundle entry (UI arrange; F22 owns the creation proof): `control-openhands browser goto /automations/templates`, `control-openhands browser click 'testid=recommended-automation-card-news-digest' --expect-url '/automations/new/news-digest'`, `control-openhands browser fill 'testid=setup-field-schedule' '0 0 1 1 *'`, `control-openhands browser click 'testid=setup-continue-button'`, `control-openhands browser wait 'testid=setup-review' --timeout 10000`, `control-openhands browser click 'testid=setup-continue-button' --expect-url '/automations/[0-9a-f-]{8,}' --timeout 60000`. The detail page of **Daily news digest** shows `role=heading[name="Script"]` and no Prompt (`browser count 'role=heading[name="Prompt"]'` is `0`); `control-openhands browser text 'testid=automation-script-entrypoint'` is `python3 main.py`, and `browser eval "Array.from(document.querySelectorAll('[data-testid=automation-script-file]')).map(e=>e.innerText.split('\n').slice(0,2).join(' | '))"` lists `main.py | Entrypoint` first, then `config.json` (both with line-numbered source). Screenshot with `--feature F23.script-section --name news-digest`. `automation-script-unavailable` (bundle unreadable) was not reached. Do not Run now: the script fetches public feeds and starts a model-backed conversation. Delete it in the Delete bullet.+- **Delete (`F23.delete`).** Open QA_F23 Event, click the kebab and `role=list >> has-text=Tarball >> role=button[name="Delete"]`. `control-openhands browser snapshot 'role=dialog[name="Delete automation"]'` shows `Delete "QA_F23 Event"? This cannot be undone.`, `Cancel` and `Delete` (the same dialog as F21.delete). `control-openhands browser click 'role=dialog[name="Delete automation"] >> role=button[name="Cancel"]'` keeps the page (`control-openhands browser count 'role=dialog[name="Delete automation"]'` is `0`). Reopen and `control-openhands browser click 'role=dialog[name="Delete automation"] >> role=button[name="Delete"]' --expect-url '/automations(\?|$)'`; `control-openhands api GET /api/automation/v1` no longer lists it. Delete QA_F23 Pong, QA_F23 Blocked and Daily news digest the same way (and QA_F23 Fail if the error bullet was skipped); `api GET /api/automation/v1` shows `"total": 0`.+- **Errors.** After each group `control-openhands browser errors --app-only` shows no page errors; the only app errors are the induced ones (404s for the unknown id and the deleted fixture, 502s while the service is stopped).++## Gotchas++- The detail page has no `main` landmark: `browser snapshot 'role=main'` times out. Snapshot the page, or scope by section headings (`role=heading[name="Configuration"] >> xpath=ancestor::div[2]`).+- The kebab menu has no test ids; `role=list >> has-text=Tarball` scopes the detail kebab (the dashboard kebab has no Tarball, so F21 uses `has-text=Export`).+- Both the X and the footer button of the Edit dialog are named **Cancel**; use `testid=edit-automation-cancel` for the footer and `role=form[name="Edit automation"] >> xpath=.. >> role=button[name="Cancel"] >> nth=0` for the X. The dialog has no `role=dialog`.+- Known defect: Escape does not close the Edit dialog (the handler sits on the non-focusable backdrop `div`) (#17563). The delete confirmation, by contrast, is a `role=dialog` that Escape closes.+- Known defect: at phone height the Edit dialog has no `max-height` or scrolling, so its title, X and Save are clipped and unreachable by scrolling (#17563).+- Known defect: clearing **Time of day** on a preset schedule is silently ignored (#17948); Save closes the dialog with no request and no message.+- On a local backend the Logs dialog reads every run's output from the server-level `/api/bash/bash_events/search`, with or without a conversation. It caches what it fetched: reload before checking its requests with `browser network`.+- Known defect: prompt runs also have a `bash_command_id`, so every row shows the logs icon, and a prompt run that ended without a conversation is labelled as a script run (`F23.run-no-conversation`) (#17948).+- Known defect: the Repositories, Plugins and Notification fields read top-level `repository`, `branch`, `plugins` and `notification`, which this automation service (1.17.0) does not return: it keeps repos and plugins under `preset_metadata`. They never render on a local stack (#17952).+- The Schedule field shows the raw cron (`0 9 * * *`) and no timezone: the service returns no `schedule_human` and no top-level `timezone`, so the Edit dialog also omits its `Timezone:` hint.+- `run-phase` never appeared in the log here (`phase_code` stays `null` on the local service), so the phase chip is not reachable on this stack.+- An LLM profile that does not exist (`model: "qa-no-such-profile"`) does not fail the run: it ran and succeeded with the active profile. Use timeout `1` to get a failed run; it takes several minutes to fail.+- `Load more` in the log (`F23.activity-log-more`) needs more than 20 runs of one automation; at about 35 s and one model call each it is left out of a normal pass (not-run).+- The script section needs a tarball automation. The account-free way to get one is F22's **Daily news digest** bundle entry (it uploads its bundle and creates the automation); the custom-automation **Upload tarball** action needs a file you pack yourself. Its Edit dialog still shows an empty **Prompt** field next to the cron, although a script automation has no prompt.+- **Starting…** on Run now lasts only for the dispatch request (under 50 ms locally); `--observe` does not catch it.+- The run row is a plain `<a href>`, so opening a run's conversation reloads the whole app (a `document` request in `browser network`), unlike sidebar navigation.+- A 404 detail request is retried three times before **Automation not found** shows (about 7 s of skeleton) (#17948); wait with `wait-text`, not `count`.+- `browser fill` on the Timeout spinbutton with letters fails in Playwright and, after its 30 s retry, the dialog was found closed; use numeric values (`1.5`, `0`, `1801`) to reach the timeout errors.+- The Tarball download is named `<name>.tar` (spaces become `_`) but is gzip-compressed (#17948); `browser downloads --inspect` does not list tar entries, so inspect it with `tar -tzf`.+- **Debug with OpenHands** starts a real agent with the `openhands-automation` skill and the automation API key. It acts on live automations: here it looked up `QA_F23 Fail` by name (a newer fixture with the same name), PATCHed its timeout back to 600 and dispatched it, which adds runs and conversations. Stop it once it has started: on its page `control-openhands browser click 'testid=stop-button'`, then `control-openhands conversation wait <id> --until paused,finished,idle --timeout 45` (`paused`).+- A successful run leaves a conversation `<name> — <UTC timestamp>` that stays after the automation is deleted (conversations family owns deleting it).diff --git a/.agents/skills/verify-openhands/references/feature-map/F24-git-sync.md b/.agents/skills/verify-openhands/references/feature-map/F24-git-sync.mdnew file mode 100644index 0000000000..5a2958ebe1--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F24-git-sync.md@@ -0,0 +1,103 @@+# F24 — Automation Git Sync++Git Sync keeps an organization's automation definitions in a git repository.+From the Automate dashboard an admin opens a Git Sync page with a **Sync Status**+card (enabled and encryption pills, repository, branch, path, last synced commit+and time, interval, pending changes, **Sync now** with a live activity row) and a+**Configuration** form (enable switch, interval, repository URL, branch, path,+commit author, access token, encryption key). Saving first checks that the+repository is reachable; **Save and sync now** saves and then runs a cycle that+commits every changed automation under `<path>/<slug>/` and pushes it.++Source: `src/routes/automation-git-sync.tsx`, `src/components/features/automations/git-sync/`, `src/hooks/query/use-git-sync.ts`, `src/types/git-sync.ts`, `src/routes/automations-list.tsx` (the **Git Sync** button).++## Sub-features++- `F24.open`: the **Git Sync** button on the Automate dashboard and the direct URL open the page (h1 `Git Sync`); **Back to Automations** returns to `/automations`.+- `F24.loading`: a skeleton (`git-sync-skeleton`) shows while health, permissions and status load.+- `F24.overview-unconfigured`: with nothing configured the card reads `Disabled`, `Not encrypted`, Repository `Not configured`, Branch `main`, Path `automations`, `Never synced` twice, `Manual only`, Pending `0`, and **Sync now** is disabled.+- `F24.form-dirty`: **Save Changes** and **Save and sync now** stay disabled until a field differs from the stored value (reverting disables them again); **Save and sync now** also needs **Enable Git Sync** on.+- `F24.check-failure`: a change to repository URL, branch or token is checked first (`Checking repository...`); an unreachable repo shows `Could not reach the repository with these settings` with git's output and the hint `Fix the settings above, or press Save again to store them anyway.`, saves nothing, and a second Save stores the values anyway.+- `F24.save-and-sync`: **Save and sync now** with a reachable repo saves (toast `Git Sync settings saved.`), then runs a cycle: the activity row goes `Syncing... started Ns ago` → `Sync complete`, and the card shows the short commit and `Last synced Ns ago`.+- `F24.sync-now`: a changed automation raises Pending changes (amber); **Sync now** shows `Syncing...` with `1 pending`, ends `Sync complete`, drops Pending to `0` and pushes `<path>/<slug>/automation.yaml` to the branch.+- `F24.sync-failure`: a failing cycle ends `Sync failed` and shows the **Last sync error** banner with git's message and its age; the banner survives a reload and disappears after the next successful cycle.+- `F24.encryption`: saving an encryption key turns the pill to `Encrypted` and the placeholder to `An encryption key is currently set`; automations exported afterwards are ciphertext; **Clear existing encryption key** disables the input and saving it returns to `Not encrypted`.+- `F24.token`: the access token is a password field that is never shown again; changing it runs the reachability check; **Clear existing token** disables the input and saves a cleared token.+- `F24.author`: commit author name and email are optional; an invalid email is refused by the browser before any request; saved values are used as the author of the next sync commit (the fields reload blank).+- `F24.interval`: **Sync every (seconds)** saves `N` as `Every Ns`, blank or `0` as `Manual only`, and refuses negative numbers.+- `F24.pause`: turning **Enable Git Sync** off and saving (no reachability check) shows `Disabled`, disables **Sync now** and keeps the configuration; turning it back on restores `Enabled`.+- `F24.sync-disabled-error`: **Sync now** on a page that still shows `Enabled` after sync was turned off elsewhere shows the toast `Enable Git Sync before triggering a sync.`; the pill catches up on the next idle poll (≤ 15 s).+- `F24.background-sync`: with an interval set, the backend runs cycles on its own and the open page picks up the new commit on its idle poll, without a reload.+- `F24.repo-link`: an http(s) repository is shown as a link (new tab) to the browsable URL without `.git` and without embedded credentials; a local path stays plain text.+- `F24.repo-link-ssh`: an scp-style ssh remote (`git@host:org/repo.git`) is also shown as a link, rebuilt over https (`https://host/org/repo`); the label keeps the configured value.+- `F24.sync-delete`: deleting a synced automation raises Pending changes; the next cycle commits the removal of its `<path>/<slug>/` folder.+- `F24.field-defaults`: emptying **Branch** or **Path** and saving clears the override instead of storing an empty value: the card and inputs fall back to `main` and `automations`.+- `F24.clear-repo`: emptying the repository URL is checked (`No repository URL is configured.`), and a second Save clears it: the card returns to `Not configured` and `Disabled`.+- `F24.backend-down`: with the automation service down the page shows **Automations Unavailable** with **Retry**; Retry after the service is back shows the page with the stored configuration.+- `F24.phone`: the page fits a 390 px viewport without horizontal overflow; the card's fields stay in two columns.+- `F24.unsupported`: an automation backend without the Git Sync API (status 404) shows `Git Sync is not available on this backend` with **Back to Automations**; the dashboard still shows the **Git Sync** button there.+- `F24.no-access`: a user without `manage_automations` (Cloud member) sees `Git Sync is managed by organization admins`, and the dashboard hides the **Git Sync** button.+- `F24.conflict`: saving a repository, branch and path that another organization already syncs is refused (409) with a toast naming the conflict.+- `F24.error-state`: any other status failure shows the generic automation error panel with **Retry**.++## How to get to it (user POV)++- Sidebar **Automate** (`sidebar-automations-link`), then the **Git Sync** button in the dashboard header (`automations-git-sync`). Only users who can manage automations see it (always, locally).+- Direct URL `/automations/git-sync`.+- No command-menu entry, keyboard shortcut or Automate sub-navigation tab leads here; the page shows no Dashboard/Templates tabs (see Gotchas).+- Leave with **Back to Automations** (a link, not a button) at the top of the page.++## Driving it with control-openhands++Preconditions:++- Baseline state (fresh `launch --new`, doctored, `onboard --skip`). No LLM profile is needed: sync cycles run git only.+- Git Sync is unconfigured: `control-openhands api GET /api/automation/v1/git-sync/status` shows `"repo_url": ""`, `"enabled": false` and `"last_synced_commit": null`.+- A local repository to push to: `control-openhands fixture git-repo --name qa-sync-remote`. Its `path` output is `<repo-path>` below (`$OH_VERIFY_RUN/workspace/qa-sync-remote`). Sync to branch `qa-sync`, not `main`: the fixture is a non-bare repo with `main` checked out, and git refuses pushes to a checked-out branch. Remote state is read with plain `git -C <repo-path> ...` (read-only second view).+- An inert automation for the pending-changes bullets, created right before **Sync a changed automation**: `control-openhands api POST /api/automation/v1/preset/prompt --write --data '{"name":"QA_F24 Sync","prompt":"QA git sync fixture; never runs.","trigger":{"type":"event","source":"qa-f24","on":"qa.f24.never"}}'`. Its `id` is `<automation-id>`; later bullets mark it changed with `control-openhands api PATCH /api/automation/v1/<automation-id> --write --data '{"enabled":false}'` (or `true`), which is arrange, not proof. **Sync a deletion** deletes it again.++- **Open from the dashboard (`F24.open`, `F24.loading`).** Run `control-openhands browser goto /automations`, then `control-openhands browser click 'testid=automations-git-sync' --expect-url '/automations/git-sync(\?|$)' --observe 'testid=git-sync-skeleton' --observe-ms 2000`. The observation lists the skeleton (state `""`) for a few tens of ms, then `<absent>`. `control-openhands browser text 'h1'` is `Git Sync`. Run `control-openhands browser click 'role=link[name="Back to Automations"]' --expect-url '/automations(\?|$)'`; the URL is `/automations`. Then `control-openhands browser goto /automations/git-sync` (direct URL) and `control-openhands browser screenshot --feature F24.open --name page-desktop --full-page`.+- **Unconfigured card (`F24.overview-unconfigured`).** Run `control-openhands browser text 'role=heading[name="Sync Status"] >> xpath=ancestor::div[2]'`. It reads `Sync Status / Disabled / Not encrypted / Sync now / Repository / Not configured / Branch / main / Path / automations / Last synced commit / Never synced / Last synced / Never synced / Sync every (seconds) / Manual only / Pending changes / 0` (newline-separated). `control-openhands browser enabled 'testid=git-sync-now-button'` is `false`.+- **Dirty tracking (`F24.form-dirty`).** `control-openhands browser enabled 'testid=git-sync-save-button'` and `enabled 'testid=git-sync-save-and-sync-button'` are both `false`. Run `control-openhands browser fill 'testid=git-sync-interval-input' 300`: Save is `true`, Save and sync stays `false` (sync is off). `control-openhands browser fill 'testid=git-sync-interval-input' 0`: Save is `false` again. Run `control-openhands browser click 'testid=git-sync-enabled-switch >> xpath=ancestor::label'`; `control-openhands browser eval "document.querySelector('[data-testid=git-sync-enabled-switch]').checked"` is `true` and both buttons are `true`. Click the label again; Save is `false`.+- **Unreachable repository (`F24.check-failure`).** Run `control-openhands browser fill 'testid=git-sync-repo-url-input' /nonexistent/qa-missing.git` and `control-openhands browser click 'testid=git-sync-save-button' --observe 'testid=git-sync-save-button' --observe-ms 3000`; the observation includes `Checking repository...`. Run `control-openhands browser wait 'testid=git-sync-check-failure' --timeout 25000` and `control-openhands browser text 'testid=git-sync-check-failure'`: `Could not reach the repository with these settings`, git's `fatal: '/nonexistent/qa-missing.git' does not appear to be a git repository`, then `Fix the settings above, or press Save again to store them anyway.` Take `control-openhands browser screenshot 'testid=git-sync-check-failure' --feature F24.check-failure --name failure-block`. `control-openhands api GET /api/automation/v1/git-sync/status` still has `"repo_url": ""`. Click `testid=git-sync-save-button` again, then `control-openhands browser wait-text 'Git Sync settings saved.' --timeout 10000`; `browser count 'testid=git-sync-check-failure'` is `0`. After `control-openhands browser reload`, `control-openhands browser text 'testid=git-sync-enabled-pill'` is `Enabled` (configuring a repo turns sync on) and the card shows `/nonexistent/qa-missing.git` as plain text (`browser count 'testid=git-sync-repo-link'` is `0`).+- **Failing cycle (`F24.sync-failure`).** Run `control-openhands browser click 'testid=git-sync-now-button' --observe 'testid=git-sync-activity-row' --observe-ms 8000`. The observation goes `Syncing...` / `started 0s ago` (counting up each second) and ends `Sync failed`; `control-openhands browser attr 'testid=git-sync-activity-row' data-state` is `failed`. Run `control-openhands browser wait 'testid=git-sync-error-banner' --timeout 20000` and `control-openhands browser text 'testid=git-sync-error-banner'`: `Last sync error`, `git command failed (128): git clone --origin origin /nonexistent/qa-missing.git .`, `fatal: repository '/nonexistent/qa-missing.git' does not exist`, `Ns ago`. Screenshot with `control-openhands browser screenshot --feature F24.sync-failure --name failed`. After `control-openhands browser reload` the banner count is `1` and the activity row count is `0` (the row is page-local).+- **Configure and Save and sync (`F24.save-and-sync`).** Run `control-openhands browser fill 'testid=git-sync-repo-url-input' "$OH_VERIFY_RUN/workspace/qa-sync-remote"`, `control-openhands browser fill 'testid=git-sync-branch-input' qa-sync`, `control-openhands browser fill 'testid=git-sync-path-input' qa-automations`, then `control-openhands browser click 'testid=git-sync-save-and-sync-button' --observe 'testid=git-sync-activity-row' --observe-ms 10000`. The observation goes `Syncing... started 0s ago` → `Sync complete` within a few seconds; `browser count 'testid=git-sync-check-failure'` and `browser count 'testid=git-sync-error-banner'` are `0` (a successful cycle clears the last error). The toast `Git Sync settings saved.` also fires, but it is gone before a 10 s observation ends; to see it, run `control-openhands browser wait-text 'Git Sync settings saved.' --timeout 5000` right after the click instead of `--observe`. The card text (as in Unconfigured card) shows `<repo-path>`, `qa-sync`, `qa-automations`, a 7-character commit and `Last synced / Ns ago`. `git -C <repo-path> log --oneline qa-sync` shows the fixture's `Initial fixture commit` (the cycle created the branch).+- **Sync a changed automation (`F24.sync-now`).** Create `QA_F24 Sync` (Preconditions), `control-openhands browser reload`, then `control-openhands browser text 'text=Pending changes >> xpath=ancestor::div[1]/..'` (`Pending changes / 1`) and `control-openhands browser attr 'text=Pending changes >> xpath=ancestor::div[1]/.. >> span.text-warning' class` (`text-warning`). Screenshot with `control-openhands browser screenshot --feature F24.sync-now --name pending`. Run `control-openhands browser click 'testid=git-sync-now-button' --observe 'testid=git-sync-activity-row' --observe-ms 8000`: `Syncing... / started 0s ago / 1 pending`, then `control-openhands browser text 'testid=git-sync-activity-row'` is `Sync complete` and Pending changes reads `0`. `git -C <repo-path> log --oneline qa-sync` has a new `Sync automations from agent server` commit whose short hash matches the card's Last synced commit, and `git -C <repo-path> ls-tree -r --name-only qa-sync` lists `qa-automations/qa-f24-sync/automation.yaml` and `qa-automations/qa-f24-sync/tarball/...`.+- **Commit author (`F24.author`).** Run `control-openhands browser fill 'testid=git-sync-author-email-input' not-an-email`, `control-openhands browser network --clear`, `control-openhands browser click 'testid=git-sync-save-button'`, then `control-openhands browser eval "document.querySelector('[data-testid=git-sync-author-email-input]').validationMessage"` (`Please include an '@' in the email address. 'not-an-email' is missing an '@'.`); `control-openhands browser network` lists no `git-sync/config` request. Fill `testid=git-sync-author-name-input` with `'QA F24 Bot'` and `testid=git-sync-author-email-input` with `[email protected]`, click Save, `control-openhands browser wait-text 'Git Sync settings saved.' --timeout 10000`, `control-openhands browser reload`; `control-openhands browser value 'testid=git-sync-author-name-input'` is `""` (the fields never show the stored author). Mark the automation changed (PATCH `{"enabled":false}`), `control-openhands browser reload`, click `testid=git-sync-now-button`, `control-openhands browser wait '[data-testid=git-sync-activity-row]:not([data-state=running])' --timeout 30000`; then `git -C <repo-path> log -1 --format='%an <%ae>' qa-sync` is `QA F24 Bot <[email protected]>`.+- **Encryption key (`F24.encryption`).** `control-openhands browser attr 'testid=git-sync-encryption-key-input' placeholder` is `No encryption key set`. Fill it with `qa-f24-dummy-key`, click Save (no `Checking repository...`: the key is not checked), wait for `Git Sync settings saved.`, `control-openhands browser reload`: `browser text 'testid=git-sync-encryption-pill'` is `Encrypted`, the placeholder is `An encryption key is currently set` and the input value is `""`. Mark the automation changed (PATCH `{"enabled":true}`), reload, click **Sync now** and wait as in Commit author; `git -C <repo-path> show qa-sync:qa-automations/qa-f24-sync/automation.yaml | head -c 20` starts with `gAAAAA` (ciphertext, not YAML). Then fill the key input with any text, run `control-openhands browser click 'testid=git-sync-clear-encryption-key-switch >> xpath=ancestor::label'`: `control-openhands browser enabled 'testid=git-sync-encryption-key-input'` is `false` and its value is `""`. Click Save, wait for the toast, reload: the pill is `Not encrypted`, the placeholder `No encryption key set`, and the clear switch is unchecked again.+- **Access token (`F24.token`).** `control-openhands browser attr 'testid=git-sync-token-input' type` is `password` and the placeholder `Leave blank to keep the current token`. Fill it with `qa-dummy-token`, run `control-openhands browser network --clear`, click Save with `--observe 'testid=git-sync-save-button' --observe-ms 2000` (shows `Checking repository...`), wait for the toast; `control-openhands browser network --last 6` lists `/api/automation/v1/git-sync/check` then `/api/automation/v1/git-sync/config`. After reload the token input is `""`. Run `control-openhands browser click 'testid=git-sync-clear-token-switch >> xpath=ancestor::label'`; `browser enabled 'testid=git-sync-token-input'` is `false`. Click Save, wait for the toast, reload; `browser eval "document.querySelector('[data-testid=git-sync-clear-token-switch]').checked"` is `false`.+- **Interval (`F24.interval`).** Fill `testid=git-sync-interval-input` with `300`, Save, wait for the toast, reload: the card's `Sync every (seconds)` field reads `Every 300s` (`control-openhands browser text 'role=heading[name="Sync Status"] >> xpath=ancestor::div[2]'`) and the input value is `300`. Fill it with `''`, Save, reload: `Manual only` and input `0`. Fill `-5` and click Save: `browser eval "document.querySelector('[data-testid=git-sync-interval-input]').validationMessage"` is `Value must be greater than or equal to 0.`; reload to drop the draft.+- **Pause and resume (`F24.pause`).** Click `testid=git-sync-enabled-switch >> xpath=ancestor::label`; `browser enabled 'testid=git-sync-save-and-sync-button'` is `false`. Run `control-openhands browser network --clear`, click Save, wait for the toast; `control-openhands browser network` lists no `git-sync/check`. After reload the pill is `Disabled`, `enabled 'testid=git-sync-now-button'` is `false` and the card still shows `<repo-path>`; screenshot `--feature F24.pause --name disabled`. Click the switch label again, Save, wait for the toast: the pill is `Enabled`.+- **Trigger while disabled elsewhere (`F24.sync-disabled-error`).** With the page showing `Enabled`, arrange `control-openhands api PUT /api/automation/v1/git-sync/config --write --data '{"enabled":false}'` (another admin pausing), then immediately `control-openhands browser click 'testid=git-sync-now-button'` and `control-openhands browser wait-text 'Enable Git Sync before triggering a sync.' --timeout 5000`. The pill still says `Enabled` at first; `control-openhands browser wait 'testid=git-sync-enabled-pill >> has-text=Disabled' --timeout 20000` succeeds within about 15 s. `browser errors --app-only` lists the induced `503` on `/api/automation/v1/git-sync/sync` (expected). Turn sync back on through the form (switch label, Save).+- **Repository link (`F24.repo-link`).** Fill `testid=git-sync-repo-url-input` with `https://qa-user:[email protected]/qa-org/qa-repo.git`, click Save, `browser wait 'testid=git-sync-check-failure' --timeout 30000` (git's output redacts the URL as `https://***@git.example.invalid/...`; the failure itself is `CONNECT tunnel failed, response 502` behind the sandbox proxy, a resolve error elsewhere), click Save again, wait for the toast, reload. `control-openhands browser attr 'testid=git-sync-repo-link' href` is `https://git.example.invalid/qa-org/qa-repo` and `attr ... target` is `_blank`. Expected: the link text hides the credentials too. Today `control-openhands browser text 'testid=git-sync-repo-link'` is `https://qa-user:[email protected]/qa-org/qa-repo.git` (fail; see Gotchas). Screenshot with `control-openhands browser screenshot 'role=heading[name="Sync Status"] >> xpath=ancestor::div[2]' --feature F24.repo-link --name https-link`. Restore: fill the URL with `"$OH_VERIFY_RUN/workspace/qa-sync-remote"`, Save, wait for the toast; `browser count 'testid=git-sync-repo-link'` is `0` (a local path is plain text).+- **Interval cycle (`F24.background-sync`).** Read the current short commit from the card (`control-openhands browser text 'text=Last synced commit >> xpath=ancestor::div[1]/..'`, `<old-hash>`). Fill `testid=git-sync-interval-input` with `20`, Save, wait for the toast; the card reads `Every 20s`. Mark the automation changed (PATCH `{"enabled":false}`), do not reload, and run `control-openhands browser wait 'text="<old-hash>"' --state detached --timeout 60000`. It succeeds within about 35 s (interval plus the page's 15 s idle poll); the card shows a new hash and `Last synced / Ns ago`, matching `git -C <repo-path> log --oneline -1 qa-sync`. Set the interval back to `0` (fill, Save, toast) so later bullets are not raced by background cycles.+- **Sync a deletion (`F24.sync-delete`).** Arrange the deletion (owned by F21): `control-openhands api DELETE /api/automation/v1/<automation-id> --write` (status `204`). `control-openhands browser reload`; `browser text 'text=Pending changes >> xpath=ancestor::div[1]/..'` is `Pending changes / 1`. Run `control-openhands browser click 'testid=git-sync-now-button' --observe 'testid=git-sync-activity-row' --observe-ms 6000` (`Syncing... / started 0s ago / 1 pending` → `Sync complete`); Pending changes reads `0`. `git -C <repo-path> log --oneline -1 qa-sync` is a new `Sync automations from agent server` commit matching the card's Last synced commit, and `git -C <repo-path> ls-tree -r --name-only qa-sync` lists only the fixture's `README.md` and `src/...` files: `qa-automations/qa-f24-sync/` is gone.+- **Empty branch and path (`F24.field-defaults`).** Run `control-openhands browser fill 'testid=git-sync-branch-input' ''` and `browser fill 'testid=git-sync-path-input' ''`, then `browser click 'testid=git-sync-save-button' --observe 'testid=git-sync-save-button' --observe-ms 2000` (`Checking repository...`: the branch changed; `main` exists in the fixture, so the check passes) and `browser wait-text 'Git Sync settings saved.' --timeout 10000`. After `browser reload` the card reads Branch `main` and Path `automations`, `browser value 'testid=git-sync-branch-input'` is `main` and `browser value 'testid=git-sync-path-input'` is `automations`; `control-openhands api GET /api/automation/v1/git-sync/status` has `"branch": "main"` and `"path": "automations"`. Do not press **Sync now** here: `main` is the fixture's checked-out branch.+- **ssh remote link (`F24.repo-link-ssh`).** Fill `testid=git-sync-repo-url-input` with `[email protected]:qa-org/qa-repo.git`, click Save, `browser wait 'testid=git-sync-check-failure' --timeout 30000` (here git reports `ssh: not found`; with ssh installed it is an auth or host-key failure), click Save again, wait for the toast, reload. `control-openhands browser attr 'testid=git-sync-repo-link' href` is `https://github.com/qa-org/qa-repo`, `attr ... target` is `_blank` and `browser text 'testid=git-sync-repo-link'` is `[email protected]:qa-org/qa-repo.git`.+- **Clear the repository (`F24.clear-repo`).** Fill `testid=git-sync-repo-url-input` with `''`, click Save, `control-openhands browser wait 'testid=git-sync-check-failure' --timeout 25000`; its text is `Could not reach the repository with these settings / No repository URL is configured. / Fix the settings above, ...`. Click Save again, wait for the toast, reload: the card reads `Disabled` and Repository `Not configured` (branch, path and last commit stay), and the URL input is `""` with its placeholder `https://github.com/org/repo.git`.+- **Phone layout (`F24.phone`).** Run `control-openhands browser viewport phone`, `control-openhands browser bbox 'role=heading[name="Sync Status"] >> xpath=ancestor::div[2]'` (`insideViewport` `true`, `pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F24.phone --name status`: two columns of fields, long paths wrap. Then `control-openhands browser scroll 'testid=git-sync-repo-url-input'`, `control-openhands browser bbox 'testid=git-sync-save-and-sync-button'` (`pageHorizontalOverflow` `false`) and `control-openhands browser screenshot --feature F24.phone --name form`. Return with `control-openhands browser viewport desktop`.+- **Automation service down (`F24.backend-down`).** Run `control-openhands service stop automation`, `control-openhands browser reload` and `control-openhands browser wait-text 'Automations Unavailable' --timeout 40000`; the page shows the heading, `The automations backend is not available right now...` and **Retry**, and no Back link. Screenshot with `control-openhands browser screenshot --feature F24.backend-down --name unavailable`. `control-openhands browser network --clear`, `control-openhands browser click 'role=button[name="Retry"]'`; `control-openhands browser network` shows a new `/api/automation/health` request and the panel stays. Run `control-openhands restart`, click Retry again and `control-openhands browser wait 'testid=git-sync-enabled-pill' --timeout 15000`: the page is back with the stored configuration. `control-openhands doctor` is `ok`.+- **Old backend (`F24.unsupported`).** Needs a second, fresh run on an automation release without the Git Sync API (1.7.1 is the last one; 1.8.0 added `git_sync/router.py`). Stop the main run first if memory is short, then `export OH_VERIFY_RUN=$(OH_VERIFY_RUN= control-openhands launch --new --automation-ref 1.7.1 --print-run)` (uvx installs the tag from GitHub), `control-openhands doctor` (`ok`) and `control-openhands onboard --skip`. `control-openhands api GET /api/automation/v1/git-sync/status` is `404`. Run `control-openhands browser goto /automations/git-sync` and `control-openhands browser wait-text 'Git Sync is not available on this backend' --timeout 20000`; the page also reads `The automation backend is running a version without the Git Sync API. Update it to a version that supports Git Sync.` with **Back to Automations** below it. Screenshot with `control-openhands browser screenshot --feature F24.unsupported --name unsupported`. `control-openhands browser click 'role=link[name="Back to Automations"]' --expect-url '/automations(\?|$)'` returns to the dashboard, where `browser count 'testid=automations-git-sync'` is still `1`. `browser errors --app-only` lists only the expected `404` on `git-sync/status`. `control-openhands stop` this run.+- **No permission (`F24.no-access`).** Blocked: local backends always grant `manage_automations`. Needs a Cloud backend signed in as an organization member (not admin or owner); expected `Git Sync is managed by organization admins` / `Only organization admins and owners can view and configure Git Sync.` at `/automations/git-sync`, and `control-openhands browser count 'testid=automations-git-sync'` `0` on `/automations`.+- **Repository taken by another org (`F24.conflict`).** Blocked: the local backend has one organization. Needs two Cloud orgs; saving the same URL, branch and path in the second shows the error toast `Another organization already syncs this repository, branch and path. Sharing them would import each other's automations; use a different repository or path.` and keeps the form dirty for a retry.+- **Status error (`F24.error-state`).** Not driven: no non-mocked way makes `GET /api/automation/v1/git-sync/status` fail with a non-404 status while `/api/automation/health` is ok. Expected: the generic automation error panel with **Retry**.+- **Clean up.** The fixture automation was deleted in **Sync a deletion** (`control-openhands api GET /api/automation/v1` lists none) and Git Sync is cleared by **Clear the repository**; the fixture repo goes away with the run. Check `control-openhands browser errors --app-only` on the main run: `pageErrors` is `0`, and only the induced `503` on `git-sync/sync` from **Trigger while disabled elsewhere** and the `502`s on `/api/automation/health`, `git-sync/status`, `telemetry/consent` and `sdk-version` while the service was stopped are expected.++## Gotchas++- Configuring a repository is what turns sync on: the backend's pause switch defaults to on, so the first save of a URL flips the pill to `Enabled` even though the switch was never touched, and clearing the URL turns it off again. The switch's help text (`Turning it on requires a backend that was started with git sync enabled.`) is stale: this run has no `AUTOMATION_GIT_SYNC_*` variables and enabling works (#17950).+- A local path (or `file://` URL) is a valid remote, which is what makes this family drivable without credentials. Use a branch other than the fixture's checked-out `main`: git's default `receive.denyCurrentBranch` refuses pushes to a non-bare repo's checked-out branch (not driven here; every recipe uses `qa-sync`).+- The reachability check runs only when repository URL, branch or token changed (`git ls-remote`, 20 s timeout). Interval, path, author, encryption key and the enable switch save without it. A check that cannot run at all (old backend, network error) never blocks a save.+- The second Save after a failed check saves the same values without checking again; editing any checked field re-arms the check.+- The activity row (`git-sync-activity-row`, `data-state` `running`/`succeeded`/`failed`) is page state: it disappears on reload and does not appear for a background cycle that starts and ends between two idle polls (15 s). Assert background cycles through the commit hash, not the row.+- Toasts (`Git Sync settings saved.`, `Enable Git Sync before triggering a sync.`) last a few seconds: read them with `browser wait-text` immediately after the click, never after a long `--observe` window.+- Save's label cycles `Save Changes` → `Checking repository...` (only when a checked field changed) → `Saving...` → `Save Changes` in about 100 ms against a local repo; `--observe 'testid=git-sync-save-button'` records it.+- Saving an encryption key does not re-encrypt what is already in the repository: files stay readable YAML until each automation changes and is exported again (observed; the help text says files are encrypted "before they are committed") (OpenHands/automation#551).+- Nothing on the page says whether a token is stored: the token placeholder is always `Leave blank to keep the current token`, and the author fields always reload blank. Prove author changes from the commit (`git log --format='%an <%ae>'`).+- The Repository field shows `repo_url` verbatim. A URL with embedded credentials (`https://user:token@host/...`) is displayed in clear text as the link's label, while the href and the check output redact them (`F24.repo-link` fail; Canvas UI) (#17950). Never type a real token into the URL.+- The page has no Automate sub-navigation (Dashboard / Templates) and no command-menu entry; leave through **Back to Automations** (`role=link`, not a button).+- Unused strings `AUTOMATIONS$GIT_SYNC$ENABLE_BLOCKED_ERROR` and `NOT_LOCAL_*` exist in translations; no current UI path shows them.+- Deleted automations stay in Pending changes until a cycle pushes the removal; after cleanup with sync off the card can read `Pending changes 2`. **Sync a deletion** pushes it while the repository is still configured.+- An untouched **Enable Git Sync** switch follows the server: after another admin pauses sync, the next idle poll flips both the pill and the switch off, so turning it back on is one label click plus Save.+- `F24.unsupported` needs `--automation-ref` (uvx fetches `git+https://github.com/OpenHands/[email protected]`); without GitHub access it stays blocked. The control CLI does not forward `OH_AUTOMATION_VERSION`, so a PyPI release cannot be selected directly.+- Arrange with `api ... --write` only to mark automations changed or to simulate another admin; the save, check and sync steps must go through the form.diff --git a/.agents/skills/verify-openhands/references/feature-map/F25-backends-and-cloud.md b/.agents/skills/verify-openhands/references/feature-map/F25-backends-and-cloud.mdnew file mode 100644index 0000000000..1f78169d05--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F25-backends-and-cloud.md@@ -0,0 +1,116 @@+# F25 — Backends, Cloud and sharing++One Canvas can drive several agent servers. The backend selector at the bottom+of the sidebar lists every registered backend with a live status dot and+switches between them; its footer opens **Add Backend** (OpenHands Cloud login+through an OAuth device flow, or a local/remote agent server by host and API+key) and **Manage Backends** (select, edit, remove, and Cloud "Log back in").+When the active backend is unreachable the whole app is replaced by Manage+backends in recovery mode. Cloud backends add organization rows, a Cloud+settings link and public sharing of conversations (read-only at+`/shared/conversations/:id`); `/oauth/device/verify` is the device-approval page.+Everything except the Cloud account itself can be driven locally with a second+`control-openhands` stack as the extra backend.++Source: `src/components/features/backends/`, `src/contexts/active-backend-context.tsx`, `src/api/backend-registry/`, `src/hooks/query/use-backends-health.ts`, `src/routes/device-verify.tsx`, `src/routes/shared-conversation.tsx`, `src/components/features/conversation/conversation-name-context-menu.tsx`, `src/api/cloud/`, `specs/backend-management.md`.++## Sub-features++- `F25.selector-dropdown`: clicking (or hovering) the selector opens a listbox of backends, each option named `<status> <name>` with a status dot, and a footer with **Add Backend** and **Manage Backends**.+- `F25.add-backend-modal`: **Add Backend** opens "Choose how you want to connect" with a description, a **Learn more** link to the deployment docs and two tabs, **OpenHands Cloud** (selected) and **Agent-server**. Escape does not close it; the X does.+- `F25.cloud-advanced-host`: on the Cloud tab, **Advanced** reveals a **Host** field (placeholder `https://app.all-hands.dev`) for a self-hosted Cloud.+- `F25.cloud-device-flow`: **Connect to OpenHands** opens a popup and shows `Starting authentication...`, then `Waiting for authorization...` with the verification link and **Cancel**; Cancel returns to the idle button and closes the popup. An unreachable host shows `Failed to start device flow: ...` with **Try again**. Approving the code (adds a backend named OpenHands Cloud) needs a Cloud account.+- `F25.agent-server-guidance`: the Agent-server tab has a **Local / Remote** toggle. Local shows a collapsible **Before you connect** with `agent-canvas --backend-only --port 8001` and a local-setup docs link; Remote shows **Recommended setup**, **Connection details** and a remote-setup docs link.+- `F25.add-agent-server`: **Connect** stays disabled until Host Name and a valid Host are filled (and, on Remote, an API key). A dead host or a wrong key shows `Could not connect to <host>` with the reason inline; a reachable host with the right key adds the backend, makes it active (BM-001) and redirects a `/conversations/<id>` page to `/conversations` without an error toast, also on the backend's first activation, without asking the new backend for the old conversation id.+- `F25.switch-backend`: choosing another option shows a full-screen `Switching to <name>` overlay for about a second, then the sidebar and pages show that backend's data; on `/conversations/<id>` the app moves to `/conversations` (BM-002).+- `F25.backend-pinned-url`: in-app links carry `?backend=<id>`; opening such a URL pins the tab to that backend; an unknown id is ignored.+- `F25.manage-backends`: Manage backends lists every backend with status dot, name, version (`v1.50.1`), host, status text and a LOCAL/CLOUD pill, plus Edit and Remove; Escape, a backdrop click, X and **Done** close it.+- `F25.manage-add`: **Add Backend** in Manage backends opens the same Add form stacked over Manage; its X returns to Manage, and a successful add keeps Manage open with the new row while the new backend becomes active.+- `F25.manage-select`: clicking a healthy row makes that backend active and closes the modal; on a detail page it leaves it for that section's list, like the selector does (BM-002).+- `F25.edit-backend`: the pencil opens "Edit backend" pre-filled (key masked) with a `Connected · Local v<version>` badge; empty name and invalid host show `Name is required` and `Enter a valid URL (e.g. http://localhost:8080)` and disable Save; Save re-tests the connection, keeps the modal open with `Could not connect to <host>` on failure, and persists on success.+- `F25.edit-cancel`: **Cancel** and the X in Edit backend close only the Edit modal and discard the draft; Manage backends stays open with the stored values.+- `F25.edit-escape`: Escape in the Edit modal should not discard the draft (the modal disables Escape). Known failure, see Gotchas.+- `F25.health-status`: a backend that stops answering turns its dot red (`Disconnected`) within one 10 s probe; its Manage row reads `Disconnected (check URL or network)` with a red detail line and cannot be selected.+- `F25.recovery-gate`: reloading while the active backend is down shows only `agent-server-onboarding-screen` with Manage backends in recovery mode (no X, no Done, Escape ignored, primary **Add Backend**); choosing a healthy row restores the app.+- `F25.remove-backend`: the trash icon asks `Remove backend "<name>"? If it is active, the app will switch back to Local.`; Cancel keeps it, Confirm removes it and an active removed backend falls back to Local (BM-003).+- `F25.collapsed-entry`: with the rail collapsed, the backend icon's popover offers the same Add Backend and Manage Backends items, and both modals open.+- `F25.phone`: at 390 px the drawer's selector opens both modals inside the viewport without horizontal overflow.+- `F25.device-verify-page`: `/oauth/device/verify` shows a "Device Authorization" code form; with `?user_code=` it shows "Device Authorization Request", the code, a Security Notice and Cancel / Authorize Device. On a local stack Authorize and Continue end in the `Error` card with **Try Again**.+- `F25.shared-conversation-view`: `/shared/conversations/<id>` is a standalone read-only page (no app shell); on a local backend it reads `Conversation not found`.+- `F25.share-publicly`: on a Cloud backend the conversation menu has a **Public Share** toggle with copy-link and open-link buttons; on a local backend the item is absent.+- `F25.cloud-org-rows`: each Cloud backend appears once per organization as `<name> – <org>` (`Personal Workspace` for the user's own), and choosing one scopes lists to that org.+- `F25.cloud-log-back-in`: a logged-out Cloud row shows `Logged out` and a **Log back in** button that reruns the device flow.+- `F25.cloud-settings-link`: with a Cloud backend active the gear next to the selector opens `<cloud host>/settings?org=<org>` in a new tab.+- `F25.cloud-sandbox-states`: Cloud conversations show waiting, archived and error sandbox states in chat.+- `F25.locked-cloud`: a Canvas served with `--lock-to-cloud <url>` shows only the Cloud login (no close) on first run, and its selector footer reads **Reconnect to Cloud** with no add, edit or remove.++## How to get to it (user POV)++- Sidebar, bottom: the backend selector (`backend-selector`; click or hover) → options, **Add Backend** (`add-backend-menu-item`), **Manage Backends** (`manage-backends-menu-item`).+- Collapsed rail: hover the backend icon (`collapsed-backend-selector-link`) → the same footer items.+- Phone: hamburger (`sidebar-mobile-menu-toggle`) → drawer → backend selector.+- Manage backends → **Add Backend** (`manage-backends-add`) opens the same Add form.+- Direct URLs: any in-app URL with `?backend=<id>`; `/oauth/device/verify[?user_code=CODE]`; `/shared/conversations/<id>`.+- Conversation header name → "..." (`conversation-name >> ellipsis-button`) for Public Share (Cloud only).+- Reloading with an unreachable active backend opens the recovery gate.+- Onboarding's backend step and the public-mode API-key screen also add backends; they belong to F01. The ChatGPT subscription card is F10 (`F10.subscription`) and the provider balance card is F27 (`F27.usage-provider-balance`).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` on this run.+- One conversation on this run: `control-openhands conversation start --prompt "Reply with exactly: QA_F25_PONG" --wait --timeout 180`; note its `<id>`. The conversation only has to exist: F25 never reads the reply, so a run that ends in `error` (for example a key without balance, saved with `llm preset deepseek --no-validate`) is enough.+- A second stack to add as a backend, started without a browser and never driven directly: `export OH_VERIFY_RUN_2=$(OH_VERIFY_RUN= control-openhands launch --new --build never --no-browser --print-run)`, then `control-openhands status --run "$OH_VERIFY_RUN_2"`; its `baseUrl` is `<second-url>` below and its key is `$OH_VERIFY_RUN_2/private/session-key`. It has no conversations.+- No backend named `QA_Second` or `QA_Renamed` exists (the selector lists only `Local`).+- Bullets run in order: Add creates `QA_Second`, Edit renames it to `QA_Renamed`, Remove deletes it.+- Blocked here (no OpenHands Cloud account): approving the device flow, `F25.cloud-org-rows`, `F25.cloud-log-back-in`, `F25.cloud-settings-link`, `F25.cloud-sandbox-states`, `F25.share-publicly` (toggle), and `F25.locked-cloud`, which also needs a launcher flag (see Gotchas).++- **Open the selector (`F25.selector-dropdown`).** From `/conversations` run `control-openhands browser click 'testid=backend-selector'` and `control-openhands browser snapshot 'testid=backend-selector'`. The snapshot shows `listbox` with `option "Connected Local"`, a separator, `button "Add Backend"` and `button "Manage Backends"`. Screenshot with `control-openhands browser screenshot --feature F25.selector-dropdown --name open`. Hover opens it too: `browser press Escape`, move the pointer away with `control-openhands browser hover 'testid=command-menu-trigger'` (hovering a selector the pointer is already on does nothing), `control-openhands browser hover 'testid=backend-selector'`, then the same snapshot shows `combobox "Local" [expanded]` and the two footer buttons.+- **Add Backend modal (`F25.add-backend-modal`).** Run `control-openhands browser click 'testid=add-backend-menu-item'` and `control-openhands browser snapshot 'testid=add-backend-modal'`: heading `Choose how you want to connect`, link `Compare Cloud, self-hosted, and Enterprise deployment options` (`/url: https://docs.openhands.dev/overview/introduction`, text `Learn more`) and tab `OpenHands Cloud ...` `[selected]` next to tab `Agent-server ...`. `control-openhands browser press Escape` leaves `browser count 'testid=add-backend-modal'` at `1`; `control-openhands browser click 'testid=add-backend-close'` makes it `0`.+- **Advanced host (`F25.cloud-advanced-host`).** Reopen with `browser click 'testid=backend-selector'` and `browser click 'testid=add-backend-menu-item'`, run `control-openhands browser click 'testid=add-backend-advanced-toggle'`, then `control-openhands browser attr 'testid=add-backend-advanced-toggle' aria-expanded` (`true`) and `control-openhands browser snapshot 'testid=add-backend-cloud-panel'` (textbox `Host` with placeholder `https://app.all-hands.dev`).+- **Device flow error (`F25.cloud-device-flow`).** Run `control-openhands browser fill 'testid=add-backend-cloud-host' http://127.0.0.1:9`, `control-openhands browser click 'testid=add-backend-login-button' --observe 'testid=add-backend-device-flow'` and `control-openhands browser wait 'testid=add-backend-auth-error' --timeout 15000`. The observation goes `Starting authentication...` → `Failed to start device flow: Failed to fetch` / `Try again`, and `control-openhands browser network --last 5` shows `POST /oauth/device/authorize` to `http://127.0.0.1:9`. `control-openhands browser click 'testid=add-backend-auth-retry'` starts again and fails the same way. Each attempt leaves an `about:blank` popup: `control-openhands browser tabs`, then `control-openhands browser close-tab <i>` for each extra page and `control-openhands browser tab 0`. Close the modal with `testid=add-backend-close`.+- **Device flow awaiting and Cancel (`F25.cloud-device-flow`).** Reopen Add Backend (Cloud tab, default host), run `control-openhands browser click 'testid=add-backend-login-button' --observe 'testid=add-backend-device-flow' --observe-ms 6000`, then `control-openhands browser snapshot 'testid=add-backend-device-flow'`. If `https://app.all-hands.dev` is reachable (`control-openhands browser network --external --last 5` lists it), the snapshot shows `Waiting for authorization...`, `Browser opened. Complete sign-in to continue. If browser didn't open, visit:`, a link `https://app.all-hands.dev/oauth/device/verify?user_code=<code>` and button `Cancel`; `browser tabs` lists a second page on that URL. Screenshot with `--feature F25.cloud-device-flow --name awaiting`, then `control-openhands browser click 'testid=add-backend-auth-cancel'`: the panel is back to `Connect to OpenHands` / `Advanced` and `browser tabs` lists one page. Never approve the code. If Cloud is unreachable you get the error state of the previous bullet instead.+- **Agent-server guidance (`F25.agent-server-guidance`).** Run `control-openhands browser click 'testid=add-backend-option-agent-server'` and `control-openhands browser snapshot 'testid=add-backend-agent-server-panel'`: radiogroup `Agent-server location` with `Local` checked, heading `Before you connect`, textboxes `Host Name`, `Host`, `API Key` and `button "Connect" [disabled]`. `control-openhands browser click 'testid=add-backend-local-guidance-toggle'` and `browser snapshot 'testid=add-backend-local-guidance'` show the code `agent-canvas --backend-only --port 8001` and link `Read the local backend setup guide`. `control-openhands browser click 'testid=add-backend-location-option-remote'` and `control-openhands browser click 'testid=add-backend-remote-guidance-toggle'`; `browser snapshot 'testid=add-backend-remote-guidance'` shows `Recommended setup`, `Connection details` and `Read the remote backend setup guide`.+- **Connect rules and errors (`F25.add-agent-server`).** Still on Remote: `control-openhands browser fill 'testid=add-backend-name' QA_Second`, `control-openhands browser fill 'testid=add-backend-host' 127.0.0.1:9`; `control-openhands browser enabled 'testid=add-backend-submit'` is `false` (Remote needs a key). `control-openhands browser fill 'testid=add-backend-api-key' wrong-key` makes it `true`. `control-openhands browser click 'testid=add-backend-location-option-local'` keeps the fields. `control-openhands browser click 'testid=add-backend-submit' --observe 'testid=add-backend-submit'` shows `Checking…`, then `control-openhands browser text 'testid=add-backend-error'` starts `Could not connect to http://127.0.0.1:9` / `Disconnected (check URL or network). ...`. Fill `add-backend-host` with `<second-url>` and submit again: the error reads `Could not connect to <second-url>` / `Invalid API key`. Close with `testid=add-backend-close`.+- **Add the second backend (`F25.add-agent-server`).** Run `control-openhands browser goto /conversations/<id>`, `browser click 'testid=backend-selector'`, `browser click 'testid=add-backend-menu-item'`, `browser click 'testid=add-backend-option-agent-server'`, fill `add-backend-name` with `QA_Second` and `add-backend-host` with `<second-url>`, then `control-openhands browser fill 'testid=add-backend-api-key' --value-file "$OH_VERIFY_RUN_2/private/session-key"` and `control-openhands browser click 'testid=add-backend-submit' --expect-url '/conversations(\?|$)'`. The URL is `/conversations`, `browser count 'testid=add-backend-modal'` is `0`, `browser snapshot 'testid=backend-selector'` shows `combobox "QA_Second"`, and `browser count 'testid=conversation-card'` is `0`. Before anything reloads the page, `control-openhands browser toasts --history` lists only `Loading...` and the new backend's `Your LLM isn't set up yet, so conversations won't run. ...` (the second stack has no LLM profile; no error toast), and `control-openhands browser network --external --filter 'ids='` lists no request: the new backend is never asked for the first stack's conversation id. (`--external` leaves out this stack's own `GET /api/conversations?ids=<id>` from the `goto /conversations/<id>` above, which the request log keeps across page loads; `<second-url>` is another origin, so a request to it is listed.) The new backend asks its own telemetry consent ("This preference is saved for the local backend “QA_Second”"): run `control-openhands onboard --skip` (it leaves the browser on `/`). After `control-openhands browser reload` the selector still reads `QA_Second`.+- **Switch with the overlay (`F25.switch-backend`).** From `/` run `browser click 'testid=backend-selector'` and `control-openhands browser click 'testid=backend-selector >> role=option[name="Connected Local"]' --observe 'testid=environment-switch-overlay' --observe-ms 2500`. The observation shows `Switching to Local`, then `<absent>` about one second later; the selector reads `Local` and `browser count 'testid=conversation-card'` is `1`. Then `control-openhands browser click 'testid=conversation-card' --expect-url '/conversations/[0-9a-f-]+'`, open the selector and `control-openhands browser click 'testid=backend-selector >> role=option[name="Connected QA_Second"]' --expect-url '/conversations(\?|$)'`: the URL is `/conversations`, the selector reads `QA_Second` and the card count is `0`.+- **Pinned URL (`F25.backend-pinned-url`).** With `QA_Second` active run `control-openhands browser goto '/conversations/<id>?backend=default-local'` and `control-openhands browser wait 'testid=chat-interface'`: the selector reads `Local` and the conversation opens. `control-openhands browser goto '/conversations?backend=qa-unknown-id'` keeps `Local` (card count `1`). The sidebar card links themselves end in `?backend=default-local` (`browser snapshot`).+- **Manage list and closing (`F25.manage-backends`).** Run `browser click 'testid=backend-selector'`, `control-openhands browser click 'testid=manage-backends-menu-item'` and `control-openhands browser snapshot 'testid=manage-backends-modal'`: heading `Manage backends`, two rows `Connected Local v1.50.1 <this run's URL> Connected Local` and `Connected QA_Second v1.50.1 <second-url> Connected Local`, each with `Edit` and `Remove`, then `Add Backend` and `Done`. `browser text 'testid=manage-backends-status-QA_Second'` is `Connected` and `browser text 'testid=manage-backends-version-QA_Second'` is `v1.50.1` (whatever `doctor` reports). Screenshot with `--feature F25.manage-backends --name list`. Close it four ways, reopening between: `browser press Escape`, `control-openhands browser mouse-click 20 500` (backdrop), `browser click 'testid=close-manage-backends-modal'`, `browser click 'testid=manage-backends-done'`; each time `browser count 'testid=manage-backends-modal'` is `0`.+- **Select from Manage (`F25.manage-select`).** With `Local` active, `control-openhands browser click 'testid=conversation-card' --expect-url '/conversations/[0-9a-f-]+'`, open Manage Backends, then `control-openhands browser click 'testid=manage-backends-row-QA_Second >> role=button >> nth=0' --expect-url '/conversations(\?|$)'`. Like the selector, the app leaves the detail page for `/conversations` (BM-002): `browser count 'testid=manage-backends-modal'` is `0`, the selector reads `QA_Second`, `browser count 'testid=chat-interface'` and `browser count 'testid=conversation-card'` are `0`, and `browser screenshot --feature F25.manage-select --name after-select` shows QA_Second's Home with its empty conversation list.+- **Edit validation and errors (`F25.edit-backend`).** Open Manage Backends, `control-openhands browser click 'testid=manage-backends-edit-QA_Second'`, then `browser value 'testid=edit-backend-host'` (`<second-url>`), `browser attr 'testid=edit-backend-api-key' type` (`password`) and `browser text 'testid=edit-backend-status'` (`Connected`, `·`, `Local`, `v1.50.1` on separate lines). Fill `edit-backend-name` with an empty string and `edit-backend-host` with `not a host`, then `browser focus 'testid=edit-backend-api-key'` and `browser snapshot 'testid=edit-backend-form'`: alerts `Name is required` and `Enter a valid URL (e.g. http://localhost:8080)`; `browser enabled 'testid=edit-backend-submit'` is `false`.+- **Escape in Edit (`F25.edit-escape`).** In the same Edit modal press `control-openhands browser press Escape`. Expected: the Edit modal stays (it disables Escape) or only it closes. Today `browser count 'testid=edit-backend-modal'` and `browser count 'testid=manage-backends-modal'` are both `0`: the whole stack closes and the draft is lost. Nothing was saved (`browser snapshot 'testid=backend-selector'` still reads `QA_Second`).+- **Edit and save (`F25.edit-backend`).** Reopen Manage Backends and the pencil. Fill `edit-backend-host` with `http://127.0.0.1:9`, `browser click 'testid=edit-backend-submit'`, `browser wait 'testid=edit-backend-error' --timeout 10000`: the text starts `Could not connect to http://127.0.0.1:9` and the modal stays. Fill the host back with `<second-url>` and `edit-backend-name` with `QA_Renamed`, click `edit-backend-submit`, then `control-openhands browser wait 'testid=edit-backend-modal' --state detached --timeout 10000`; `browser count 'testid=manage-backends-row-QA_Renamed'` is `1`. Click `manage-backends-done`, `browser reload`: the selector reads `QA_Renamed`.+- **Health status (`F25.health-status`).** Run `control-openhands service stop agent-server --run "$OH_VERIFY_RUN_2"`, then on the open page `control-openhands browser wait 'testid=backend-selector >> role=status[name="Disconnected"]' --timeout 25000`. `browser click 'testid=backend-selector'` and `browser snapshot 'testid=backend-selector'` show `option "Disconnected QA_Renamed"` next to `option "Connected Local"`. In Manage Backends `browser text 'testid=manage-backends-status-QA_Renamed'` is `Disconnected (check URL or network)`, `testid=manage-backends-status-detail-QA_Renamed` repeats it with `Check that the backend URL is correct ...`, and `browser enabled 'testid=manage-backends-row-QA_Renamed >> role=button >> nth=0'` is `false`. An error toast with the same text also appears. Screenshot with `--feature F25.health-status --name manage-down`.+- **Recovery gate (`F25.recovery-gate`).** Close the modal, `control-openhands browser reload`, then `control-openhands browser wait 'testid=manage-backends-modal' --timeout 20000`. `browser testids` lists `agent-server-onboarding-screen` and the Manage rows but no sidebar; `browser count 'testid=close-manage-backends-modal'` and `browser count 'testid=manage-backends-done'` are `0`, and `browser press Escape` leaves the modal (`count` `1`). `control-openhands browser click 'testid=manage-backends-row-Local >> role=button >> nth=0'` and `browser wait 'testid=agent-server-onboarding-screen' --state detached --timeout 15000` restore the app: selector `Local`, card count `1`. Screenshot the gate with `--feature F25.recovery-gate --name gate` before choosing.+- **Remove the active backend (`F25.remove-backend`).** Run `control-openhands restart --run "$OH_VERIFY_RUN_2"`, `browser click 'testid=backend-selector'`, `browser wait 'testid=backend-selector >> role=option[name="Connected QA_Renamed"]' --timeout 25000` and click that option (selector reads `QA_Renamed`). Open Manage Backends, `control-openhands browser click 'testid=manage-backends-remove-QA_Renamed'`; `browser text 'testid=confirmation-modal'` reads `Remove backend "QA_Renamed"? If it is active, the app will switch back to Local.` `control-openhands browser click 'testid=confirmation-modal >> role=button[name="Cancel"]'` keeps the row (`count 'testid=manage-backends-row-QA_Renamed'` `1`). Click the trash again, then `control-openhands browser click 'testid=confirmation-modal >> testid=confirm-button'`: the row count is `0`. Click Done and `browser reload`: the selector reads `Local`, `browser count 'testid=backend-selector >> role=option'` (dropdown open) is `1`, and the card count is `1`.+- **Add from Manage, Edit Cancel and X (`F25.manage-add`, `F25.edit-cancel`).** The second stack is running again after the previous bullet. Run `browser goto /conversations/<id>`, `browser wait 'testid=chat-interface'`, open the selector, click `manage-backends-menu-item`, then `control-openhands browser click 'testid=manage-backends-add'` and `control-openhands browser wait 'testid=add-backend-modal' --timeout 5000` (`visible`); `browser count 'testid=manage-backends-modal'` is `1` underneath. `browser click 'testid=add-backend-close'`: the Add count is `0` and the Manage count stays `1`. Click `manage-backends-add` again, `add-backend-option-agent-server`, fill `add-backend-name` with `QA_Second`, `add-backend-host` with `<second-url>` and `add-backend-api-key` with `--value-file "$OH_VERIFY_RUN_2/private/session-key"`, then `browser click 'testid=add-backend-submit' --expect-url '/conversations(\?|$)'`: the URL is `/conversations`, `count 'testid=add-backend-modal'` is `0`, `count 'testid=manage-backends-modal'` is still `1`, `count 'testid=manage-backends-row-QA_Second'` is `1` and the selector reads `QA_Second` (screenshot `--feature F25.manage-add --name after-add`). No consent prompt this time: it is stored on the second backend. Then `control-openhands browser click 'testid=manage-backends-edit-QA_Second'`, `browser fill 'testid=edit-backend-name' QA_Draft` and `control-openhands browser click 'testid=edit-backend-cancel'`: `count 'testid=edit-backend-modal'` `0`, `count 'testid=manage-backends-modal'` `1`, row `QA_Second` `1`, row `QA_Draft` `0`. Repeat with `control-openhands browser click 'testid=edit-backend-close'`: same counts, and reopening the pencil shows `browser value 'testid=edit-backend-name'` `QA_Second`; leave with `edit-backend-cancel`. Remove it again: `browser click 'testid=manage-backends-remove-QA_Second'`, `browser click 'testid=confirmation-modal >> testid=confirm-button'`, `browser click 'testid=manage-backends-done'` and `browser reload`: the selector reads `Local`.+- **Collapsed rail (`F25.collapsed-entry`).** Run `control-openhands browser click 'testid=sidebar-collapse-toggle'` (`attr 'aside[data-collapsed]' data-collapsed` is `true`), `control-openhands browser hover 'testid=collapsed-backend-selector-link'`, `control-openhands browser click 'testid=add-backend-menu-item'` and `control-openhands browser wait 'testid=add-backend-modal' --timeout 5000` (`visible`). Close it, hover again, click `manage-backends-menu-item` and `browser wait 'testid=manage-backends-modal' --timeout 5000`. Close with Done and expand with `browser click 'testid=sidebar-collapse-toggle'`.+- **Phone (`F25.phone`).** Run `control-openhands browser viewport phone`, `browser goto /conversations`, `control-openhands browser click 'testid=sidebar-mobile-menu-toggle'`, `control-openhands browser click 'testid=sidebar-mobile-drawer >> testid=backend-selector'`, `browser click 'testid=add-backend-menu-item'`, `browser click 'testid=add-backend-option-agent-server'` and `control-openhands browser bbox 'testid=add-backend-modal'`: `insideViewport` `true`, `pageHorizontalOverflow` `false`. Screenshot `--feature F25.phone --name add-modal`. Close it (the drawer stays open), open Manage Backends from the drawer selector the same way and check `bbox 'testid=manage-backends-modal'` the same. Return with `browser viewport desktop`.+- **Device verify page (`F25.device-verify-page`).** Run `control-openhands browser goto /oauth/device/verify` and `browser snapshot`: heading `Device Authorization`, `Enter the code displayed on your device:`, textbox `Device Code:` and button `Continue`, inside the normal app shell. `control-openhands browser fill 'role=textbox[name="Device Code:"]' QA-0000` and `browser click 'role=button[name="Continue"]'` go straight to the result: heading `Error`, `Failed to authorize device. Please try again.`, button `Try Again`; `browser network --filter verify-authenticated` shows `POST /oauth/device/verify-authenticated` `404`. Then `control-openhands browser goto '/oauth/device/verify?user_code=QA-0000'`: heading `Device Authorization Request`, `DEVICE CODE`, `QA-0000`, `Security Notice`, buttons `Cancel` and `Authorize Device` (screenshot `--feature F25.device-verify-page --name with-code`). `browser click 'role=button[name="Cancel"]'` does nothing in a tab the page did not open (URL unchanged). `browser click 'role=button[name="Authorize Device"]'` and `browser wait 'role=heading[name="Error"]'` show the same Error card; **Try Again** reloads to the request.+- **Shared view (`F25.shared-conversation-view`).** Run `control-openhands browser goto /shared/conversations/<id>` and `control-openhands browser wait-text 'Conversation not found' --timeout 15000`. The page has no sidebar; `browser network --filter shared` shows `GET /api/shared-conversations` and `/api/shared-events/search` `404`. Screenshot `--feature F25.shared-conversation-view --name local-not-found`.+- **No Public Share locally (`F25.share-publicly`).** Run `browser goto /conversations/<id>`, `control-openhands browser click 'testid=conversation-name >> testid=ellipsis-button'` and `control-openhands browser count 'testid=share-publicly-button'`: `0` on a local backend (`browser testids --filter button` lists `rename-button`, `show-skills-button`, `show-agent-tools-button`, `export-transcript-button`, `download-trajectory-button`, `display-cost-button` and `delete-button`; `show-hooks-button` and `stop-button` appear only when hooks exist or the conversation is running). The toggle, `copy-share-link-button` and `open-share-link-button` need a Cloud backend: blocked.+- **Cleanup.** `browser press Escape`, then `control-openhands stop --run "$OH_VERIFY_RUN_2"` and `unset OH_VERIFY_RUN_2`. The conversation stays with this run's state.+- **Errors.** `control-openhands browser errors --app-only` after the family shows no page errors. Expected app-origin entries: `POST /oauth/device/verify-authenticated` 404 (twice), the shared-view 404s, the warning `Scripts may close only the windows that were opened by them.` from the device-verify Cancel, and a burst of CORS `console.error`s for `<second-url>` while the second agent server is stopped or restarting (see Gotchas).++## Gotchas++- Export the second run as `OH_VERIFY_RUN_2` and pass it with `--run`; never export it as `OH_VERIFY_RUN`, or the browser commands look for a browser that run does not have. `OH_VERIFY_RUN= control-openhands launch --new ...` keeps the launch from reusing this run.+- The second backend asks its own telemetry consent the first time it becomes active, over whatever page you are on; `onboard --skip` answers it. Consent is stored per backend, so a later `restart` of the second run does not ask again.+- `browser fill <sel> --value-file FILE` takes no positional value; it keeps the key out of the shell history and the evidence. Edit forms show the stored key masked, but `browser snapshot` of the Edit form prints it in clear: do not save that snapshot as evidence with a real key.+- Manage-row test ids use the backend name (`manage-backends-row-QA_Second`), so they change after a rename and are not unique when two backends share a name; the Cloud **Log back in** id uses the backend id instead (`manage-backends-login-<id>-login-button`).+- Selector options are named `<status> <name>` (`Connected Local`, `Disconnected QA_Renamed`): select them with `role=option[name="Connected <name>"]`.+- After a navigating option click, `--expect-url` must allow `?backend=...`: end regexes with `(\?|$)`.+- The Add Backend Agent-server form has no inline "required" messages; it only disables **Connect**. The messages exist in the Edit form.+- Footer clicks from the collapsed popover or the phone drawer open the modals a moment later: `browser wait` for them instead of `count`.+- The device-flow popup survives errors: every failed attempt leaves an `about:blank` tab (#17953). Cancel closes it; after an error close it with `browser close-tab`.+- With the default host the device flow talks to the real `app.all-hands.dev` (`POST /oauth/device/authorize`, then token polling). Starting and cancelling is harmless; never approve a code.+- While the second stack's agent server is stopped or restarting, its ingress answers without CORS headers, so the browser logs `Access to fetch at '<second-url>/api/settings' ... blocked by CORS policy` (also `/server_info`, `/api/conversations/search`, `/api/llm/models/verified`). That is the dead upstream, not a CORS bug; a healthy second stack sends `access-control-allow-origin` for this origin.+- Health is probed every 10 s, so allow up to 25 s for a dot to change. While the active backend is down, any reload lands on the recovery gate: drive the disconnected rows on the page that was already loaded.+- `/oauth/device/verify` is a Cloud page that also ships in Canvas: on a local stack its POST target does not exist, so Authorize always ends in `Error`. The "Authentication Required" state is unreachable (`useIsAuthed` always resolves `true`).+- `/shared/conversations/<id>` on a local backend also raises a raw toast `HTTP request failed (404 Not Found): {"detail":"Not Found"}` next to `Conversation not found` (#17953).+- Known failure (repro candidate, not an exemption): `F25.edit-escape` closes the Manage modal underneath and drops the Edit draft (Cancel and X close only Edit, `F25.edit-cancel`) (#17953).+- The add bullet's `network --external --filter 'ids='` check guards an earlier race: on a backend's first activation from `/conversations/<id>`, about 1 attempt in 5 asked the new backend for the old conversation id. It did not happen in 15 first activations at 4eff80237: each time `QA_Second` was removed, its consent unset with `control-openhands api PATCH /api/settings --run "$OH_VERIFY_RUN_2" --write --data '{"misc_settings_diff":{"app_preferences":{"user_consents_to_analytics":null}}}'` (arrange only) and the backend added again from `/conversations/<id>`. A backend that lacks an id answers `[null]`, which now reads as "not found" (only the `This conversation does not exist…` toast), not as incompatible data. No merged change was shown to fix the race itself (#18009 only changed how a `[null]` answer reads; #18024 only moved the redirect into a shared hook, still called after `addBackend`), so a hit (an `ids=` request to `<second-url>`, now followed by the `This conversation does not exist…` toast) is a new bug to file.+- Toasts are not page or HTTP errors, so `browser errors --app-only` misses them: read `browser toasts --history` after every add or switch, before anything reloads the page (the history starts with each page load).+- `F25.locked-cloud` needs `scripts/static-server.mjs --lock-to-cloud <url>`, which neither `bin/agent-canvas.mjs` nor `control-openhands launch` can pass today; even with it, reconnecting needs a Cloud account.+- The Cloud tab title truncates to `OpenHan…` at 390 px when the Agent-server tab is selected; the layout still fits.diff --git a/.agents/skills/verify-openhands/references/feature-map/F26-runtime-variants.md b/.agents/skills/verify-openhands/references/feature-map/F26-runtime-variants.mdnew file mode 100644index 0000000000..e410682315--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F26-runtime-variants.md@@ -0,0 +1,109 @@+# F26 — Launcher modes, Docker, desktop and library++Agent Canvas ships one UI in several runtime shapes. The npm launcher+(`npx @openhands/agent-canvas`, here `node bin/agent-canvas.mjs`) runs the full+stack, or only the frontend or only the backends, prints its version and stack+info, refuses conflicting flags, and decides whether the session key is+injected into the page (loopback) or the user must paste it (`--public`, or a+non-loopback `--host`). The same stack also ships as a Docker image, an+Electron desktop app and an embeddable React library. Launchers tell the agent+which services exist through `/server_info.runtime_services` and a+`<RUNTIME_SERVICES>` block in every new conversation's system prompt.++Source: `bin/agent-canvas.mjs`, `scripts/dev-with-automation.mjs`, `scripts/bind-host.mjs`, `scripts/static-server.mjs`, `scripts/ingress.mjs`, `scripts/runtime-services-info.mjs`, `config/defaults.json`, `src/api/agent-server-adapter.ts`, `src/api/backend-registry/`, `docker/`, `electron/`, `helm/agent-canvas/`, `src/lib/index.ts`, `docs/SELF_HOSTING.md`.++## Sub-features++- `F26.cli-version`: `--version` and `-v` print the package version and exit 0.+- `F26.cli-info`: `--info` prints the package version, the default agent-server and automation pins, the minimum agent-server version, the default ports and the override env vars.+- `F26.cli-help`: `--help` prints usage, auth modes, options, env vars and examples.+- `F26.cli-flag-conflicts`: `--frontend-only` with `--backend-only`, and `--public` with `--frontend-only`, exit 1 with a one-line error before anything starts.+- `F26.cli-public-needs-key`: `--public` without `LOCAL_BACKEND_API_KEY` exits 1 with guidance.+- `F26.cli-missing-build`: a package without `build/` exits 1 with `No build found` and build instructions.+- `F26.cli-port-in-use`: an occupied ingress (or service) port stops the launch with `Cannot start: the following ports are already in use` naming each busy port.+- `F26.session-key-persist`: in local mode without `LOCAL_BACKEND_API_KEY` the launcher generates a session key, saves it under `$HOME/.openhands/agent-canvas/api-key.txt` and injects the same key again on the next start.+- `F26.session-key-pinned`: `LOCAL_BACKEND_API_KEY=<key>` in local mode injects exactly that key into the page and the API accepts only it (the saved generated key gets 401).+- `F26.frontend-only`: `--frontend-only` serves the SPA; `/server_info`, `/api/*`, `/sockets/*` and `/api/automation/*` answer 503, and the UI opens on the **Add a backend** onboarding step without an error toast.+- `F26.backend-only`: `--backend-only` serves the APIs (key-protected) and answers 503 `No backend configured for this route` for `/` and static assets.+- `F26.cross-connect`: a frontend-only UI connects to a separate backend-only instance through **Add a backend**; the shell then shows that backend as Connected and all API traffic goes to it.+- `F26.remote-backend`: from a normal Canvas, backend selector → **Add Backend** → **Agent-server** → **Remote** shows the self-hosting guidance and connects to another instance (stand-in for a self-hosted VM, `docs/SELF_HOSTING.md`).+- `F26.seeded-local-backend`: the first load of a launcher-served UI seeds one backend `Local` (id `default-local`) with the page origin and the injected key.+- `F26.host-bind-lan`: `--host 0.0.0.0` warns, does not inject the session key, and the UI behaves like `--public` (Add a backend with Next disabled; Skip leads to the API-key screen).+- `F26.host-bind-lan-optin`: the opt-in the launcher's warning recommends (`--allow-lan-session-key`) should restore key injection on a LAN bind. Fails today (flag ignored).+- `F26.host-bind-env`: `OH_BIND_HOST=0.0.0.0` (the environment form of `--host`) prints the same two "not loopback" warnings and does not inject the session key, even with `LOCAL_BACKEND_API_KEY` set.+- `F26.runtime-services`: `/server_info.runtime_services` lists the agent-server, ingress, frontend and automation URLs as the agent sees them, and a new conversation's system prompt carries a matching `<RUNTIME_SERVICES>` block.+- `F26.lib-build`: `npm run build:lib` produces `dist/` where every `package.json` `exports` target exists and the main entry exports `AgentServerUIProviders`, `AgentServerUIRoot`, `CloudOrganizationBoundary` and the telemetry helpers.+- `F26.lib-style-scope`: all bundled CSS is scoped under `[data-agent-server-ui]`, and theme tokens such as `--oh-color-base` live on that scope root (observable in the standalone app).+- `F26.lib-host-app`: mounted in a separate host app, Canvas styles stay inside the scope and `styleOverrides` restyle it. Blocked: no host-app example exists.+- `F26.docker-image`: `docker run ghcr.io/openhands/agent-canvas` serves Canvas at `/canvas`; without `AGENT_CANVAS_ALLOW_LAN_SESSION_KEY=true` the UI asks for the key. Blocked without a Docker daemon.+- `F26.docker-conversation-runtime`: `OH_CONVERSATION_RUNTIME=docker` runs each new conversation in its own container. Blocked without a Docker daemon.+- `F26.helm-chart`: `helm install agent-canvas ./helm/agent-canvas` runs the Docker image as a Kubernetes StatefulSet with a PVC and an Ingress. Blocked without `helm` and a cluster.+- `F26.desktop-boot-splash`: the Electron app first shows a dark splash (logo, **OpenHands Agent Canvas**, spinner, `Starting backend services…`, then live service-log lines, a first-launch note and **Show details**).+- `F26.desktop-main-window`: after boot a native window with a File/Edit/View/Window menu loads `http://localhost:8000` with the key injected (first run, no API-key screen).+- `F26.desktop-external-links`: external links in the desktop window open in the system browser for allowed schemes only. Not driven: the harness cannot click inside the Electron window.++## How to get to it (user POV)++- A terminal: `npx @openhands/agent-canvas [flags]`; from this checkout, `node bin/agent-canvas.mjs [flags]` (what `control-openhands launch` starts with `--port`, and `--public` for public mode).+- The browser at the ingress URL the launcher prints (`http://localhost:8000/` by default).+- Backend selector (`backend-selector`) → **Add Backend** (`add-backend-menu-item`) → **Agent-server** → **Remote**, and **Manage Backends** to remove it (see F25 for the backend registry itself).+- Public mode and the API-key screen are mapped in F01 (`F01.api-key-entry`, `F01.onboarding-backend-step`).+- `npm run build:lib` for the embeddable library; a host app imports `@openhands/agent-canvas` (see `docs/DEVELOPMENT.md`, "Cloud organization recovery in embedded hosts").+- `docker run ... ghcr.io/openhands/agent-canvas` or `npm run build:docker`, then `http://localhost:8000/canvas`.+- `helm install agent-canvas ./helm/agent-canvas` on a Kubernetes cluster (`helm/agent-canvas/README.md`).+- `npm run desktop` (development) or a packaged build from `npm run build:desktop`; the window opens itself.+- ACP agents (Claude Code, Codex, Gemini CLI) are chosen in onboarding (F01) and Settings → Agents (F13); this family does not repeat them.++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) on your own run: `control-openhands launch --new --build never`, `export OH_VERIFY_RUN=<run from the launch JSON>`, `control-openhands doctor`, `control-openhands onboard --skip`. Commands run from the checkout root.+- `F26.desktop-*` need the Electron binary (`node_modules/electron/dist/electron`; `npx --no-install electron --version` downloads it on first use) and `Xvfb` plus ImageMagick `import` for headless capture. The app binds the fixed ports 8000, 18000, 18001 and 3001: check them like the blocks below and keep the run short.+- `F26.runtime-services` needs an active LLM profile (`control-openhands llm preset deepseek`).+- The partial-stack and LAN bullets start extra launchers by hand (harness gap: `launch` has no `--frontend-only`, `--backend-only` or `--host`). Each one needs a free block of ports: these recipes use 18960–18963 and 18970–18973, plus 19961, the editor port a launcher that serves VS Code hands its agent-server (see Gotchas); check them first with `for p in 18960 18961 18962 18963 18970 18971 18972 18973 19961; do (echo > /dev/tcp/127.0.0.1/$p) 2>/dev/null && echo "$p busy"; done` (no output means free). Each launcher gets a private `HOME` and state under `$OH_VERIFY_RUN/private/`, so it never touches `~/.openhands` or your run.++- **Version (`F26.cli-version`).** Run `node bin/agent-canvas.mjs --version; echo "exit=$?"` and `node bin/agent-canvas.mjs -v; echo "exit=$?"`. Each prints one line equal to `jq -r .version package.json` (the checkout's package version, which changes with every release: compare, do not expect a number; e.g. `[ "$(node bin/agent-canvas.mjs --version)" = "$(jq -r .version package.json)" ] && echo same`) and `exit=0`.+- **Info (`F26.cli-info`).** Run `node bin/agent-canvas.mjs --info`. It prints `@openhands/agent-canvas <version>` (the `--version` value), `Default stack versions:` with `agent-server: <pin>` and `automation: <pin>`, `Compatibility:` `agent-server: >= <minimum>`, `Default ports:` `ingress: 8000`, `agent-server: 18000`, `automation: 18001`, and the override variables `OH_AGENT_SERVER_VERSION, OH_AGENT_SERVER_GIT_REF, OH_AGENT_SERVER_LOCAL_PATH` / `OH_AUTOMATION_VERSION, OH_AUTOMATION_GIT_REF`. The three versions are read from `config/defaults.json` (`versions.agentServer`, `versions.automation`, `compatibility.minimumAgentServer`) and move with every pin bump, so compare them with the file instead of expecting numbers: `test "$(node bin/agent-canvas.mjs --info | awk '/^(Default stack versions|Compatibility):/{s=1;next} /^$/{s=0} s{print $NF}' | paste -sd' ' -)" = "$(jq -r '[.versions.agentServer,.versions.automation,.compatibility.minimumAgentServer]|join(" ")' config/defaults.json)" && echo match || echo mismatch` prints `match`, and `printf '%s\n' "$(jq -r .compatibility.minimumAgentServer config/defaults.json)" "$(jq -r .versions.agentServer config/defaults.json)" | sort -VC && echo pin-meets-minimum || echo below-minimum` prints `pin-meets-minimum` (the default Agent Server passes the UI's own version gate).+- **Help (`F26.cli-help`).** Run `node bin/agent-canvas.mjs --help`. It prints `USAGE:`, `AUTH MODES:` (`--public ... Users must paste it when the UI loads.`), `OPTIONS:` (`-p, --port`, `-H, --host`, `--public`, `--frontend-only`, `--backend-only`, `-v, --version`, `--info`, `-h, --help`), `ENVIRONMENT VARIABLES:` and `EXAMPLES:`, exit 0.+- **Conflicting flags (`F26.cli-flag-conflicts`).** Run `node bin/agent-canvas.mjs --frontend-only --backend-only; echo "exit=$?"` → `Error: --frontend-only and --backend-only cannot be used together`, `exit=1`. Run `node bin/agent-canvas.mjs --public --frontend-only; echo "exit=$?"` → `Error: --public cannot be used with --frontend-only`, `exit=1`.+- **Public mode needs a key (`F26.cli-public-needs-key`).** Run `T=$(mktemp -d); env -u LOCAL_BACKEND_API_KEY HOME=$T OH_CANVAS_SAFE_STATE_DIR=$T/state timeout 60 node bin/agent-canvas.mjs --public --port 18990; echo "exit=$?"; rm -rf $T`. After `✓ uvx found` it prints `✗ PUBLIC MODE requires LOCAL_BACKEND_API_KEY environment variable.` and `exit=1`. (The successful `--public` launch is `control-openhands launch --new --public`, mapped in F01.)+- **Missing build (`F26.cli-missing-build`).** Never move this checkout's `build/` (other runs serve it); copy the launcher instead: `T=$(mktemp -d); mkdir -p $T/bin $T/config; cp bin/agent-canvas.mjs $T/bin/; cp package.json $T/; cp config/defaults.json $T/config/; node $T/bin/agent-canvas.mjs --port 18990; echo "exit=$?"; rm -rf $T`. It prints `Error: No build found at <T>/build`, the `npm install` / `npm run build` hint and `exit=1`.+- **Port in use (`F26.cli-port-in-use`).** Point a second launcher at your run's ingress port: `P=$(control-openhands status | jq -r .ports.ingress); T=$(mktemp -d); HOME=$T OH_CANVAS_SAFE_STATE_DIR=$T/state timeout 60 node bin/agent-canvas.mjs --port $P; echo "exit=$?"; rm -rf $T`. It prints `Cannot start: the following ports are already in use:` with `• ingress: port <P>` and `Another agent-canvas instance may already be running.`, then exits 1. Your run is untouched (`control-openhands doctor` stays ok).+- **Backend-only (`F26.backend-only`).** Start it: `Q=$OH_VERIFY_RUN/private/f26-backend; mkdir -p $Q; HOME=$Q/home OH_CANVAS_SAFE_STATE_DIR=$Q/state OH_CANVAS_SAFE_BACKEND_PORT=18961 OH_CANVAS_SAFE_AUTOMATION_PORT=18962 OH_CANVAS_SAFE_VITE_PORT=18963 LOCAL_BACKEND_API_KEY=qa-f26-backend-key OH_SECRET_KEY=qa-f26-secret DO_NOT_TRACK=1 nohup node bin/agent-canvas.mjs --backend-only --port 18960 > $Q/launcher.log 2>&1 & echo $! > $Q/pid`. Wait until `curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:18960/health` is `200` (30–90 s; the first start downloads the agent-server into the private `HOME`). Then `curl -s http://127.0.0.1:18960/` prints `No backend configured for this route` (status 503, also for `/index.html` and `/assets/x.js`), `/server_info` is 200, `/api/settings` is 401 without a key and 200 with `-H 'X-Session-API-Key: qa-f26-backend-key'`. Keep it running for the next two bullets.+- **Frontend-only (`F26.frontend-only`).** Start it: `Q=$OH_VERIFY_RUN/private/f26-frontend; mkdir -p $Q; HOME=$Q/home OH_CANVAS_SAFE_STATE_DIR=$Q/state OH_CANVAS_SAFE_BACKEND_PORT=18971 OH_CANVAS_SAFE_AUTOMATION_PORT=18972 OH_CANVAS_SAFE_VITE_PORT=18973 DO_NOT_TRACK=1 nohup node bin/agent-canvas.mjs --frontend-only --port 18970 > $Q/launcher.log 2>&1 & echo $! > $Q/pid` (ready in a few seconds). `for u in / /server_info /api/settings /sockets/events/x /api/automation/v1 /vscode/; do curl -s -o /dev/null -w "%{http_code} $u\n" http://127.0.0.1:18970$u; done` prints `200 /` and `503` for the four backend paths and for `/vscode/`: the launcher serves the VS Code editor and reserves its path, and `grep -a 'vscode -> 503' $Q/launcher.log` prints `[static] /vscode -> 503 (rejected)` (see Gotchas). In the browser: `control-openhands browser goto http://127.0.0.1:18970/ --allow-external`, `control-openhands browser value 'testid=onboarding-backend-name'` (`Local`), `control-openhands browser value 'testid=onboarding-backend-host'` (`http://127.0.0.1:18970`, the page origin), `sleep 12`, `control-openhands browser toasts --history` (`[]`: no error toast) and `control-openhands browser screenshot --feature F26.frontend-only --name add-backend-step` (the **Add a backend** card).+- **Cross-connect (`F26.cross-connect`).** On that page run `control-openhands browser fill 'testid=onboarding-backend-name' 'QA Backend Only'`, `control-openhands browser fill 'testid=onboarding-backend-host' 'http://127.0.0.1:18960'`, `control-openhands browser fill 'testid=onboarding-backend-api-key' qa-f26-backend-key`, `control-openhands browser click 'testid=onboarding-backend-next'` and `control-openhands browser wait 'testid=onboarding-step-choose-agent' --timeout 20000`. On a backend state that has never answered telemetry consent, the consent dialog opens on top (`control-openhands browser wait 'testid=telemetry-consent-form' --timeout 10000` succeeds; it appears a second or two after the step, so an immediate `browser count` can still read `0`; consent is stored on the backend, so a second pass with the same `$Q` skips it): `control-openhands browser uncheck 'testid=telemetry-consent-form >> role=checkbox'`, `control-openhands browser click 'testid=confirm-telemetry-preferences'`, then `control-openhands browser click 'testid=onboarding-skip'` and `control-openhands browser wait 'testid=root-layout' --timeout 20000`. After `control-openhands browser reload`, `control-openhands browser snapshot 'testid=backend-selector'` shows `status "Connected"` and `combobox "QA Backend Only"`. `control-openhands browser goto http://127.0.0.1:18970/settings/secrets --allow-external` and `control-openhands browser count 'testid=secret-item >> has-text=OPENHANDS_AUTOMATION_API_KEY'` is `1` (the backend-only instance's seeded secret), and `control-openhands browser network --filter 18960 --last 5` shows `byOrigin` with only `http://127.0.0.1:18960`. `control-openhands browser errors --app-only` has `pageErrors` `0`.+- **Remote backend from a normal Canvas (`F26.remote-backend`).** Needs the backend-only instance. Run `control-openhands browser goto /`, `control-openhands browser click 'testid=backend-selector'`, `control-openhands browser click 'testid=add-backend-menu-item'`, `control-openhands browser click 'testid=add-backend-option-agent-server'` and `control-openhands browser click 'testid=add-backend-location-option-remote'`. `control-openhands browser text 'testid=add-backend-agent-server-panel'` includes `Run the remote backend with --public, set a strong LOCAL_BACKEND_API_KEY, and expose it through an SSH tunnel, ngrok, or a TLS reverse proxy.` Fill `testid=add-backend-name` with `QA_Remote`, `testid=add-backend-host` with `http://127.0.0.1:18960` and `testid=add-backend-api-key` with `qa-f26-backend-key`, click `testid=add-backend-submit`, then `control-openhands browser wait 'testid=add-backend-modal' --state detached --timeout 15000`, `control-openhands browser reload` and `control-openhands browser snapshot 'testid=backend-selector'`: `status "Connected"`, `combobox "QA_Remote"` (the new backend becomes active). If you run this bullet without Cross-connect first, the backend-only state has not answered telemetry consent yet: the consent dialog (`This preference is saved for the local backend “QA_Remote” at http://127.0.0.1:18960.`) opens over the page and blocks the selector; answer it as in Cross-connect (`control-openhands browser wait 'testid=telemetry-consent-form' --timeout 10000`, `control-openhands browser uncheck 'testid=telemetry-consent-form >> role=checkbox'`, `control-openhands browser click 'testid=confirm-telemetry-preferences'`). Switch back with `control-openhands browser click 'testid=backend-selector'` and `control-openhands browser click 'role=option[name="Local"]'`, then `control-openhands browser wait 'testid=backend-selector >> role=combobox[name="Local"]' --timeout 5000` (the switch applies after a short delay: a snapshot taken right after the click still reads `combobox "QA_Remote": Local`; after the wait it shows `combobox "Local"`). Clean up: `backend-selector` → `testid=manage-backends-menu-item`; `control-openhands browser text 'testid=manage-backends-row-QA_Remote'` reads `QA_Remote`, `v<version>`, `http://127.0.0.1:18960`, `Connected`, `LOCAL`, where `<version>` is the backend-only instance's own report, `curl -s http://127.0.0.1:18960/server_info | jq -r .version` (the `versions.agentServer` pin in `config/defaults.json` unless your shell exports an `OH_AGENT_SERVER_*` override, which a hand-started launcher inherits); it passes the UI's gate: `printf '%s\n' "$(jq -r .compatibility.minimumAgentServer config/defaults.json)" "$(curl -s http://127.0.0.1:18960/server_info | jq -r .version)" | sort -VC && echo meets-minimum || echo below-minimum` prints `meets-minimum`. Then click `testid=manage-backends-remove-QA_Remote`, `testid=confirmation-modal >> testid=confirm-button`, `testid=manage-backends-done`, `browser reload`.+- **Seeded Local backend (`F26.seeded-local-backend`).** On your run, `control-openhands browser eval "JSON.parse(localStorage.getItem('openhands-backends')).map(b=>({id:b.id,name:b.name,host:b.host,kind:b.kind,hasKey:!!b.apiKey}))"` returns exactly one entry `{id: "default-local", name: "Local", host: "http://127.0.0.1:<ingress>", kind: "local", hasKey: true}` (after the Remote cleanup above), and `control-openhands browser eval "({key: Boolean(window.__AGENT_CANVAS_SESSION_API_KEY__), authRequired: window.__AGENT_CANVAS_AUTH_REQUIRED__ === true})"` is `{key: true, authRequired: false}`.+- **Stop the partial stacks.** `kill -TERM $(cat $OH_VERIFY_RUN/private/f26-frontend/pid) $(cat $OH_VERIFY_RUN/private/f26-backend/pid)`; after about 5 s the ports 18960–18963 and 18970–18973 are free again (check as in Preconditions). Kill by the saved pid only, never by pattern.+- **LAN bind (`F26.host-bind-lan`).** Start a full stack on all interfaces: `Q=$OH_VERIFY_RUN/private/f26-lan; mkdir -p $Q; HOME=$Q/home OH_CANVAS_SAFE_STATE_DIR=$Q/state OH_CANVAS_SAFE_BACKEND_PORT=18961 OH_CANVAS_SAFE_AUTOMATION_PORT=18962 OH_CANVAS_SAFE_VITE_PORT=18963 LOCAL_BACKEND_API_KEY=qa-f26-lan-key OH_SECRET_KEY=qa-f26-secret DO_NOT_TRACK=1 nohup node bin/agent-canvas.mjs --host 0.0.0.0 --port 18960 > $Q/launcher.log 2>&1 & echo $! > $Q/pid`, and wait until `curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:18960/` is `200`. `grep -a 'not loopback' $Q/launcher.log` shows `[auth] Bind host 0.0.0.0 is not loopback — session key will not be injected into HTML` and `[static] WARNING: bind host 0.0.0.0 is not loopback; refusing to inject the session API key into HTML.` Then `control-openhands browser goto http://127.0.0.1:18960/ --allow-external` and `control-openhands browser eval "({key: Boolean(window.__AGENT_CANVAS_SESSION_API_KEY__), authRequired: window.__AGENT_CANVAS_AUTH_REQUIRED__ === true})"` → `{key: false, authRequired: true}`. The onboarding shows `testid=onboarding-step-check-backend` with `control-openhands browser enabled 'testid=onboarding-backend-next'` `false` (no key typed). `control-openhands browser click 'testid=onboarding-skip'` and `control-openhands browser wait 'testid=api-key-entry-screen' --timeout 15000` succeed; after `sleep 12`, `control-openhands browser toasts --history` is `[]` (no error toast on either screen); `control-openhands browser screenshot --feature F26.host-bind-lan --name api-key-screen`. Fill `testid=api-key-entry-name` with `QA_LAN` and `testid=api-key-entry-api-key` with `qa-f26-lan-key`, click `testid=api-key-entry-submit`; `control-openhands browser wait 'testid=root-layout' --timeout 10000` succeeds. Stop it with `kill -TERM $(cat $Q/pid)`.+- **LAN opt-in (`F26.host-bind-lan-optin`).** Expected: the opt-in the warning names (`Pass --host 127.0.0.1 (default) for local mode, or --allow-lan-session-key only if you accept LAN exposure.`) makes the npm launcher inject the key again. Start the LAN stack as above with `--host 0.0.0.0 --allow-lan-session-key --port 18960` (log to `$Q/launcher2.log`), wait for `200`, then `curl -s http://127.0.0.1:18960/ | grep -o '__AGENT_CANVAS_\(SESSION_API_KEY\|AUTH_REQUIRED\)__' | sort -u`. Today it prints only `__AGENT_CANVAS_AUTH_REQUIRED__` and the log repeats both "not loopback" warnings: the launcher ignores the flag (fail; see Gotchas). Stop it with `kill -TERM $(cat $Q/pid)`.+- **Generated session key persists (`F26.session-key-persist`).** With 18960–18963 free, define a helper and start a loopback stack without a key: `Q=$OH_VERIFY_RUN/private/f26-keys; mkdir -p $Q; start(){ HOME=$Q/home OH_CANVAS_SAFE_STATE_DIR=$Q/state OH_CANVAS_SAFE_BACKEND_PORT=18961 OH_CANVAS_SAFE_AUTOMATION_PORT=18962 OH_CANVAS_SAFE_VITE_PORT=18963 OH_SECRET_KEY=qa-f26-secret DO_NOT_TRACK=1 "$@" > $Q/launcher.log 2>&1 & echo $! > $Q/pid; for i in $(seq 1 60); do c=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:18960/); [ "$c" = 200 ] && break; sleep 3; done; echo "code=$c"; }; start env -u LOCAL_BACKEND_API_KEY nohup node bin/agent-canvas.mjs --port 18960` (`code=200`). `curl -s http://127.0.0.1:18960/ | grep -o '__AGENT_CANVAS_SESSION_API_KEY__[^;<]*' | md5sum` prints a hash (never print the key itself); `$Q/home/.openhands/agent-canvas/api-key.txt` exists (64 hex characters) and `curl -s -o /dev/null -w '%{http_code}' -H "X-Session-API-Key: $(cat $Q/home/.openhands/agent-canvas/api-key.txt)" http://127.0.0.1:18960/api/settings` is `200`. `kill -TERM $(cat $Q/pid); sleep 6`, run the same `start ...` line again in the same shell and repeat the `md5sum` line: the hash is identical.+- **Pinned session key (`F26.session-key-pinned`).** Same shell, after `kill -TERM $(cat $Q/pid); sleep 6`: `start env LOCAL_BACKEND_API_KEY=qa-f26-pin-key nohup node bin/agent-canvas.mjs --port 18960`. `curl -s http://127.0.0.1:18960/ | grep -o '__AGENT_CANVAS_SESSION_API_KEY__[^;<]*'` prints `__AGENT_CANVAS_SESSION_API_KEY__="qa-f26-pin-key"`; `/api/settings` is `200` with `-H 'X-Session-API-Key: qa-f26-pin-key'` and `401` with the saved generated key. In the browser, `control-openhands browser goto http://127.0.0.1:18960/ --allow-external` and `control-openhands browser eval "({key: window.__AGENT_CANVAS_SESSION_API_KEY__ === 'qa-f26-pin-key', authRequired: window.__AGENT_CANVAS_AUTH_REQUIRED__ === true})"` → `{key: true, authRequired: false}`.+- **Bind host from the environment (`F26.host-bind-env`).** Same shell, after `kill -TERM $(cat $Q/pid); sleep 6`: `start env LOCAL_BACKEND_API_KEY=qa-f26-pin-key OH_BIND_HOST=0.0.0.0 nohup node bin/agent-canvas.mjs --port 18960`. `grep -a 'not loopback' $Q/launcher.log` shows the same `[auth]` and `[static]` warnings as `--host 0.0.0.0`, and `curl -s http://127.0.0.1:18960/ | grep -o '__AGENT_CANVAS_\(SESSION_API_KEY\|AUTH_REQUIRED\)__' | sort -u` prints only `__AGENT_CANVAS_AUTH_REQUIRED__`. Stop it with `kill -TERM $(cat $Q/pid)`; after about 6 s ports 18960–18963 are free.+- **Runtime services (`F26.runtime-services`).** Run `control-openhands api GET /server_info --pick runtime_services.mode` (`agent-canvas`) and `control-openhands api GET /server_info --pick runtime_services.services.automation.url_from_agent` (`http://localhost:<automation port>`; `control-openhands status` prints the ports). Then `control-openhands conversation start --prompt "Reply with the single word: ok" --wait --timeout 180` (prints `<id>`) and `control-openhands conversation events <id> --grep RUNTIME_SERVICES --from-start`: the `SystemPromptEvent` matches, with an excerpt `<RUNTIME_SERVICES>\nYou are running inside an agent-canvas dev stack started ...`. `control-openhands conversation events <id> --grep "localhost:<automation port>" --from-start` shows `* Automation backend: http://localhost:<port>` plus its `Docs:` and `OpenAPI:` URLs.++- **Library build (`F26.lib-build`).** Never build inside the shared checkout (it regenerates i18n and typegen files the other runs hash); build in a copy: `L=$OH_VERIFY_RUN/private/f26-lib; mkdir -p $L; tar --exclude=./node_modules --exclude=./build --exclude=./.git --exclude=./dist -cf - . | tar -xf - -C $L; ln -s "$PWD/node_modules" $L/node_modules; (cd $L && npm run build:lib); echo "exit=$?"`. It ends with `✓ built in` and `exit=0` (about 30 s). Then `(cd $L && node -e 'const p=require("./package.json"),fs=require("fs");let ok=0,miss=[];for(const[k,v]of Object.entries(p.exports))for(const f of(typeof v==="string"?[v]:Object.values(v)))fs.existsSync(f)?ok++:miss.push(k+" -> "+f);console.log(JSON.stringify({entries:Object.keys(p.exports),ok,missing:miss}))')` prints 9 entries (`.`, `./browser`, `./conversation`, `./files`, `./settings`, `./sidebar`, `./terminal`, `./i18n`, `./package.json`), `ok` 25 and `missing` `[]`. `grep -ohE 'AgentServerUIProviders|AgentServerUIRoot|CloudOrganizationBoundary|configureTelemetry|setTelemetryConsent' $L/dist/lib/index.d.ts | sort -u` lists all five. Remove the copy with `rm -rf $L`.+- **Style scope (`F26.lib-style-scope`).** On your run's home page (`control-openhands browser goto /`) run `control-openhands browser eval "(() => { let total=0, unscoped=[]; for (const sh of document.styleSheets) { let rules; try { rules = sh.cssRules } catch { continue } const walk = (rs) => { for (const r of rs) { if (r.selectorText) { total++; if (!r.selectorText.includes('data-agent-server-ui')) unscoped.push(r.selectorText) } else if (r.cssRules) walk(r.cssRules) } }; walk(rules) } return { scopeRoots: document.querySelectorAll('[data-agent-server-ui]').length, total, unscopedCount: unscoped.length, sample: unscoped.slice(0, 12) } })()"`. `total` is in the thousands and `unscopedCount` is `2`: only `.go<hash>` and `.go<hash> > *`, react-hot-toast's runtime classes. `control-openhands browser eval "getComputedStyle(document.querySelector('[data-agent-server-ui]')).getPropertyValue('--oh-color-base').trim()"` is `#181818`. This proves the bundle is scoped, not that a host page is unaffected (`F26.lib-host-app`).+- **Blocked (`F26.lib-host-app`, `F26.docker-image`, `F26.docker-conversation-runtime`, `F26.helm-chart`).** `docker info` ends with `failed to connect to the docker API at unix:///var/run/docker.sock` here: record both Docker rows `blocked` naming the missing daemon. With a daemon, run the image with `-p 127.0.0.1:8000:8000`, open `http://localhost:8000/canvas` and expect `testid=api-key-entry-screen` unless `-e AGENT_CANVAS_ALLOW_LAN_SESSION_KEY=true` is set. Record `F26.lib-host-app` `blocked` naming the missing host-app example. `command -v helm kubectl` prints nothing here: record `F26.helm-chart` `blocked` naming the missing `helm` binary and cluster; with them, `helm lint helm/agent-canvas` and `helm template qa helm/agent-canvas` render the StatefulSet, Service and Ingress, and `helm install` follows `helm/agent-canvas/README.md`.+- **Desktop splash and window (`F26.desktop-boot-splash`, `F26.desktop-main-window`).** Start a private display and the app in one process group: `Q=$OH_VERIFY_RUN/private/f26-desktop; mkdir -p $Q/shots; setsid nohup sh -c "echo \$\$ > $Q/pgid; Xvfb :78 -screen 0 1440x1000x24 -nolisten tcp & sleep 1; DISPLAY=:78 HOME=$Q/home OH_CANVAS_SAFE_STATE_DIR=$Q/state LOCAL_BACKEND_API_KEY=qa-f26-desktop-key OH_SECRET_KEY=qa-f26-secret DO_NOT_TRACK=1 exec node_modules/.bin/electron --no-sandbox electron" > $Q/desktop.log 2>&1 &`, then capture frames: `for i in $(seq 1 40); do sleep 1; DISPLAY=:78 import -window root $Q/shots/s$(printf %02d $i).png; done`. Read the frames: the first seconds show the splash (logo, `OpenHands Agent Canvas`, `AI coding agent interface`, spinner, `Starting backend services…`, then lines such as `agent-server: {"asctime": ...`, the note `First launch downloads Python + the OpenHands agent server.` and a **Show details** button); a later frame shows the main window with a `File Edit View Window` menu and the first-run **Choose your agent** step under the consent dialog naming `the local backend "Local" at http://localhost:8000` (about 30 s on a warm cache, minutes on the first download). Copy the frames you cite into `$OH_VERIFY_RUN/evidence/F26.desktop-boot-splash/` and `.../F26.desktop-main-window/`. Stop in two steps: `kill -TERM $(cat $Q/pgid)` signals only the Electron launcher (it quits and stops its backend services); after about 10 s ports 8000, 18000, 18001 and 3001 are free again. Then `kill -TERM -- -$(cat $Q/pgid)` ends Xvfb; `ps -o pid,cmd -g $(cat $Q/pgid)` lists nothing.+- **External links (`F26.desktop-external-links`).** Not driven: record `not-run` (harness gap: no verb clicks inside the Electron window or observes the OS browser handoff).++## Gotchas++- `control-openhands launch` covers only the full stack and `--public`. Partial stacks and `--host` need a hand-started launcher with its own `HOME`, `OH_CANVAS_SAFE_STATE_DIR` and all three `OH_CANVAS_SAFE_*_PORT` variables; without them it writes into the real `~/.openhands/agent-canvas` and grabs the default ports 8000/18000/18001/3001 that another agent may be using.+- A hand-started launcher's first start downloads the agent-server into its private `HOME` cache (30–90 s). Prefix assignments are expanded left to right, so `HOME=$Q/home UV_CACHE_DIR=$HOME/.cache/uv` points the cache into `$Q/home` too, not at your real cache. Reuse one `$Q` for repeat launches to keep it warm.+- The browser daemon refuses other origins unless you pass `--allow-external` to `browser goto`. Each port is its own origin, so a partial-stack page starts at first run again (onboarding and a consent dialog), independent of your run's onboarding.+- In a frontend-only UI the **Add a backend** step's Next is enabled with an empty key, while on a LAN or `--public` stack it is disabled until a key is typed: the host the step probes differs (503 vs. auth-required).+- A partial-stack origin keeps its stored backend in the browser profile across launches, so a second pass lands straight in the shell. `control-openhands browser reset` brings back the first run on every origin; then `control-openhands browser goto /` and `control-openhands onboard --skip` restore your own run's baseline.+- The launcher serves the bundled VS Code editor. #17660 made that opt-in (`OH_CANVAS_ENABLE_VSCODE=true`) and #18048 reverted it, so only a checkout between the two needs the variable (`launch --vscode` sets it). A launcher that serves it reserves `/vscode/`: a frontend-only stack answers `503` there and logs `[static] /vscode -> 503 (rejected)`; a stack with an agent-server lists `/vscode → http://127.0.0.1:<agent-server port + 1000>` in its ingress banner and hands the agent-server that editor port (19961 for the hand-started launchers here, 19000 for the desktop app), which the launcher's own port check does not cover. On a checkout between the two without the variable, `/vscode/` is an ordinary SPA URL (`200`). Here the agent-server has no editor binary (`VSCode server binary not found, VSCode will be disabled` in the launcher log, `/api/vscode/status` `{"running":false,"enabled":true}`), so the editor port stays free even then.+- The port-in-use error is printed twice, the second time with a Node stack trace, and suggests `PORT=<other>` rather than `--port` (#17949). The `--public` key error's example says `npm run dev -- --public` instead of the npx command.+- A backend-only instance's `/server_info.runtime_services` still describes the ingress as routing `/* to the frontend`, which it does not run (#17949).+- The Electron app hardcodes ports 8000/18000/18001 (and the static server takes 3001), ignores `PORT`, and refuses to start as root without `--no-sandbox` (`Running as root without --no-sandbox is not supported`). `npm run desktop` first runs `build:app`, which rebuilds `build/` under every other run: start `node_modules/.bin/electron --no-sandbox electron` directly against the existing build.+- Never stop the desktop app with one group-wide signal: when Xvfb dies with Electron, the app exits without stopping its backend, which is left orphaned (own process groups, parent 1) on 8000/18000/18001/3001 and blocks the next start. If that happens, find the orphans by their ports' command lines (`ps -eo pid,pgid,cmd`, look for `--port 18000`, `--port 18001`, `--port 3001`, `ingress.mjs --port 8000`) and stop each group by id.+- The generated session key lives in `$HOME/.openhands/agent-canvas/api-key.txt`, not under `OH_CANVAS_SAFE_STATE_DIR`: a hand-started launcher without a private `HOME` reads and writes the operator's real key file.+- A browser origin keeps the backends it stored on an earlier pass: after the LAN pass on 18960, a later loopback launch on 18960 shows the stale `QA_LAN` backend (red, old key) instead of onboarding, although the page injects a valid key. Assert key-injection bullets through the `window` globals, or `browser reset` first.+- Electron's splash shows each raw service-log line (`agent-server: {"asctime": ...`) as its status text during boot; the named phases only appear between them.+- `build:lib` from a copy whose `node_modules` is a symlink emits bundled dependencies under `dist/<absolute node_modules path>/...`; that path is an artifact of the copy, not of the product.+- **Bug candidate (`F26.host-bind-lan-optin`):** `scripts/bind-host.mjs` tells npm users to pass `--allow-lan-session-key`, but neither `bin/agent-canvas.mjs` nor `scripts/dev-with-automation.mjs` parses or forwards it (only `scripts/static-server.mjs` and the Docker entrypoint do), and unknown flags are silently ignored (#17949).+- Known issue #17946: the npm launcher never creates its `TMUX_TMPDIR`, so hand-started instances share one tmux server and a restart of one resets the others' terminals.diff --git a/.agents/skills/verify-openhands/references/feature-map/F27-workspace-tools.md b/.agents/skills/verify-openhands/references/feature-map/F27-workspace-tools.mdnew file mode 100644index 0000000000..60cb3c1263--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/F27-workspace-tools.md@@ -0,0 +1,105 @@+# F27 — Workspace tools: terminal, browser, planner, tasks and usage++The conversation's right-hand drawer holds the agent's workspace tools: a+read-only Terminal that mirrors the agent's shell commands, a Browser tab that+shows the agent browser tool's last screenshot, a Planner that renders+`.agents_tmp/PLAN.md` (or starts a planning helper), a Task List that mirrors+the agent's `task_tracker`, and a Usage tab with the context meter, a manual+"Compact context" action and token/cost totals. Around them sit the composer's+context-window ring, the chat header's Overview column (peek, pinnable rows,+secondary drawer), and two client tools the agent can call to drive the UI:+`canvas_ui_control` (open a tab or a file) and `launch_child_conversation`.++Source: `src/components/features/terminal/`, `src/hooks/use-terminal.ts`, `src/components/features/browser/`, `src/routes/browser-tab.tsx`, `src/routes/planner-tab.tsx`, `src/components/features/conversation/conversation-tabs/conversation-planner-build-bar.tsx`, `src/hooks/use-handle-plan-click.ts`, `src/hooks/use-handle-build-plan-click.ts`, `src/routes/task-list-tab.tsx`, `src/routes/usage-tab.tsx`, `src/components/features/conversation/usage-panel/`, `src/components/features/chat/components/context-window-meter.tsx`, `src/components/features/conversation/conversation-overview-*.tsx`, `src/services/canvas-ui.ts`, `src/api/canvas-ui-client-tool.ts`, `src/services/child-conversation-launch.ts`, `src/components/features/conversation-panel/` (info modals).++## Sub-features++- `F27.terminal-empty`: with the runtime active and no command run yet, the Terminal tab reads "No terminal output yet. Commands run by the agent will appear here."+- `F27.terminal-waiting`: while the runtime is starting or the conversation is in an error state, the Terminal tab reads "Waiting for runtime to start..."; a paused (stopped) conversation shows the empty message instead, by design.+- `F27.terminal-output`: the agent's commands appear as `$ <command>` followed by their output; typing into the terminal does nothing (stdin is disabled).+- `F27.terminal-history-reload`: after a page reload the earlier commands and output are still shown (issue #17566).+- `F27.terminal-live-append`: a command the agent runs while the page is open is appended live.+- `F27.browser-empty`: before any browsing the URL bar reads "No URL loaded", "Open in New Tab" is a disabled button, and the body reads "No page loaded yet. Ask OpenHands to open a URL. Example: "Open https://example.com"".+- `F27.browser-screenshot`: after the agent's browser tool ran, the tab shows the last screenshot under a bar with its URL and an enabled "Open in New Tab" link.+- `F27.planner-empty`: with no plan the Planner reads "There is currently no plan for this repo" with an enabled "Create a plan" button; the drawer's "Build ⌘↩" button is disabled.+- `F27.planner-create`: "Create a plan" toasts "Planning agent initialized", switches the composer to plan mode ("Let’s work on a plan") and disables itself, also after a reload.+- `F27.planner-plan`: when the workspace has `.agents_tmp/PLAN.md`, the Planner renders it as Markdown with an enabled "Build ⌘↩" bar.+- `F27.planner-build`: "Build ⌘↩" sends "Execute the plan based on the .agents_tmp/PLAN.md file." to the agent.+- `F27.tasklist`: the Task List tab appears only once the agent used `task_tracker`; it lists each task with its status icon and highlights the in-progress one; the drawer's tabs menu opens it too.+- `F27.usage-metrics`: the Usage tab shows the context meter ("X% used (Y% left)", tokens / window), Token Usage (Input, Cache Hit, Cache Write, Output, Total) and Total Cost.+- `F27.usage-empty`: before any metrics arrive the Usage tab reads "No metrics data available".+- `F27.usage-compact`: "Compact context" (agent idle) toasts "Context compaction started" then "Context compacted" (or "…freed N tokens"), and the agent server records a Condensation; the (i) tooltip explains it.+- `F27.usage-provider-balance`: the provider balance card shows only when the agent server reports a balance (OpenRouter); otherwise it is absent without an error message.+- `F27.composer-context-meter`: the composer's context ring opens a popover with the fill label, a Compact context button, tokens and a Usage item; the bar or Usage item opens the Usage tab; Escape (focus returns to the ring) or an outside click closes it.+- `F27.overview-peek`: while the drawer is open, hovering the chat header (i) button shows a peek of the Overview rows (with the drawer closed there is no peek; clicking opens the column).+- `F27.overview-pin`: the Overview "..." menu pins and unpins rows (Workspace, Git parts); an unpinned row stays hidden after a reload.+- `F27.overview-changes-link`: the Overview Changes row closes the Overview and opens the drawer on Commits.+- `F27.overview-menu-open`: the Overview "..." menu's Git > Commits item opens the drawer on Commits with Uncommitted collapsed; Git > Changes opens Commits with Uncommitted expanded; both close the Overview.+- `F27.overview-drawer`: Overview menu > Pull Requests opens the secondary drawer with a close button; without a git repository it reads "Connect a git repository to view pull requests and issues".+- `F27.canvas-ui-open-tab`: the agent's `canvas_ui_control` `open_tab` opens the drawer on the requested tab (files, browser, terminal, planner, tasklist), and the choice persists like a user tab click.+- `F27.canvas-ui-navigate-file`: `canvas_ui_control` `navigate_to_file` (and clicking a file path in chat) opens Files with that file selected.+- `F27.canvas-ui-phone`: at phone width an agent `open_tab` makes the requested tab visible on `/conversations/<id>/panel`.+- `F27.launch-child`: the agent's `launch_child_conversation` (local) toasts "Launched a local child conversation" with an Open link; the child runs, and the launch result (`[child-conversation] {"status":"launched",…}` with the child id) is posted back to the parent agent as a user message.+- `F27.info-modals-phone`: the composer `+` menu's Skills, Hooks and Agent Tools & Metadata modals fit a 390 px viewport (issue #17562); content is covered by F07.+- `F27.plugins-modal`: a conversation started with plugins offers a plugins item that lists `active-plugin-<name>` rows.+- `F27.phone`: at 390 px the panel route shows the Usage, Task List and Planner tabs without overflow, and the tab row stays visible.++## How to get to it (user POV)++- Conversation header panel button (`right-panel-toggle`, aria "Show panel"), then a drawer tab: `conversation-tab-files`, `-commits`, `-tasklist` (only after the agent used `task_tracker`), `-planner`, `-terminal`, `-browser`, `-usage`. Clicking the active tab closes the drawer (F08).+- Drawer tabs menu: the "..." in `tabs-pane-header`, then `conversation-tabs-menu-open-<tab>` (also pin/unpin, F08).+- Direct URL `/conversations/<id>` (drawer closed after load) or `/conversations/<id>/panel` (full-width drawer with Back at 1024 px or narrower, the phone entry, F07.panel-route; wider, it redirects to `/conversations/<id>` with the drawer open).+- Composer context ring (`context-window-meter`) > Usage or bar; conversation "..." > Display Usage and Cost (F07.display-cost).+- Chat header (i) (`conversation-overview-toggle`): hover for the peek, click for the Overview column and its "..." menu.+- Composer `+` (`chat-plus-button`) > Show Available Skills / Hooks / Agent Tools & Metadata (also in the conversation "..." menu, F07).+- The agent itself: `canvas_ui_control` (open a tab or file), `launch_child_conversation`, and file-path links in its messages (`markdown-file-path-link`).++## Driving it with control-openhands++Preconditions:++- Baseline state (launched, doctored, `onboard --skip` done) and `control-openhands llm preset deepseek` (every populated state needs real agent turns).+- Desktop viewport unless a bullet says phone.+- `F27.browser-screenshot` is blocked when the agent server logs `Error preloading chromium` (no browser tools in Agent Tools & Metadata > Available Tools); it needs an agent server with working Chromium.+- `F27.plugins-modal` needs a conversation started with at least one plugin (the menu item is hidden otherwise).+- `F27.terminal-waiting` needs a conversation in the error state: arrange one with a profile whose key is invalid (no model cost; see the bullet).+- `F27.usage-provider-balance` (card shown) needs an OpenRouter key; with DeepSeek only the hidden case is checkable.++- **Empty tools (`F27.terminal-empty`, `F27.browser-empty`, `F27.planner-empty`).** Run `control-openhands conversation start --prompt "Reply with only the word OK. Do not run any tools." --wait --timeout 240` (note the `id` as `<quiet-id>`), then `control-openhands browser click 'testid=right-panel-toggle'`, `control-openhands browser click 'testid=conversation-tab-terminal'` and `control-openhands browser wait-text 'No terminal output yet' --timeout 10000`. Then `control-openhands browser click 'testid=conversation-tab-browser'`, `control-openhands browser text 'testid=browser-chrome-url'` (`No URL loaded`), `control-openhands browser count 'testid=browser-chrome-open-external'` (`0`), `control-openhands browser eval "[...document.querySelectorAll('[data-testid=browser-chrome-bar] button')].map(b=>[b.disabled,b.getAttribute('aria-label')])"` (`[[true,"Open in New Tab"]]`) and `control-openhands browser wait-text 'No page loaded yet' --timeout 5000`. Then `control-openhands browser click 'testid=conversation-tab-planner'`, `control-openhands browser wait-text 'There is currently no plan for this repo' --timeout 10000`, `control-openhands browser enabled 'role=button[name="Create a plan"]'` (`true`) and `control-openhands browser enabled 'testid=planner-tab-build-button'` (`false`). The tab bar has no `conversation-tab-tasklist`. Screenshot with `control-openhands browser screenshot --feature F27.browser-empty --name empty`.+- **Usage totals (`F27.usage-metrics`, `F27.usage-provider-balance`).** In `<quiet-id>` run `control-openhands browser click 'testid=conversation-tab-usage'`, `control-openhands browser text 'testid=usage-panel'` and `control-openhands browser attr 'testid=context-meter-bar' style`. The text reads `Context Window`, `1% used (99% left)`, `<tokens> / 1,000,000`, `Compact context`, `Token Usage`, Input, Cache Hit, Cache Write, Output, Total and `Total Cost $0.00…`; the bar style is `width: <percent>%`. `control-openhands browser count 'testid=provider-balance-card'` is `0` with DeepSeek (the `GET /api/llm/balance` 404 is expected). Screenshot with `control-openhands browser screenshot --feature F27.usage-metrics --name usage`.+- **Compact context (`F27.usage-compact`).** With the agent idle run `control-openhands browser tooltip 'testid=compact-context-info'` (`Summarizes older messages to free context space while keeping recent details.`), `control-openhands browser mouse-click 1300 700` (closes the tooltip), `control-openhands browser click 'testid=compact-context-button' --observe '[data-testid=compact-context-button]' --observe-ms 4000`, then `control-openhands browser toasts --history` (a plain `browser toasts` right after the click often lists only the first toast: the second lands about 2.5 s later) and `control-openhands conversation events <quiet-id> --last 4`. The last two history toasts are `Context compaction started` and `Context compacted` (a short history frees nothing, so no token count); the events include `CondensationRequest` and `Condensation`.+- **Composer context ring (`F27.composer-context-meter`).** Run `control-openhands browser click 'testid=conversation-tab-files'`, `control-openhands browser click 'testid=context-window-meter'` and `control-openhands browser text 'testid=context-window-meter-popover'` (`Context Window`, `1% used (99% left)`, `Compact context`, `11.7k / 1.0M`-style tokens, `Usage`). `control-openhands browser click 'testid=context-window-plan-usage'` then `control-openhands browser count 'testid=usage-panel'` is `1` and the popover count is `0`. Reopen the ring and `control-openhands browser click 'testid=context-window-meter-bar-button'` opens Usage the same way. Reopen it, `control-openhands browser click 'testid=context-window-compact-button'` and, a few seconds later, `control-openhands browser toasts --history` ends with `Context compaction started`, then `Context compacted`; the popover stays open. `control-openhands browser press Escape` closes it (`control-openhands browser count 'testid=context-window-meter-popover'` is `0`) and returns focus to the ring (`control-openhands browser eval "document.activeElement.dataset.testid"` is `context-window-meter`). Reopen it with `control-openhands browser click 'testid=context-window-meter'`; `control-openhands browser mouse-click 600 400` closes it too (`0`).+- **Agent-driven tools (`F27.terminal-output`, `F27.canvas-ui-open-tab`).** Run `control-openhands conversation start --prompt "Do these steps in order, in the workspace only. 1) Use the task_tracker tool to set exactly three tasks: 'qa-one' status done, 'qa-two' status in_progress, 'qa-three' status todo. 2) Run the shell command: echo QA_TERM_MARK_1 3) Create the file .agents_tmp/PLAN.md with the content '# QA Plan' followed by a bullet list of three items: alpha, beta, gamma. 4) Call the canvas_ui_control tool with command open_tab and tab terminal. Then reply DONE." --wait --timeout 300` (note `<tools-id>`). The drawer was closed; the agent's tool call opened it: `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` is `true` and `control-openhands browser text 'testid=tabs-pane-header'` starts with `Terminal`. `control-openhands browser text '.xterm-rows'` shows `$ echo QA_TERM_MARK_1`, `QA_TERM_MARK_1` and the PLAN.md command with its output. `control-openhands browser click '.xterm-screen'`, `control-openhands browser press KeyZ` and `control-openhands browser press Enter` change neither the rows nor the event list (`conversation events <tools-id> --last 1`). `control-openhands conversation events <tools-id> --kinds ActionEvent,ObservationEvent,MessageEvent` shows `open_tab` with `Tool call dispatched to client.`+- **Terminal after reload (`F27.terminal-history-reload`, `F27.terminal-live-append`).** Before clicking any other tab in `<tools-id>` (a user tab click is persisted and would mask the next check), run `control-openhands browser reload`, `control-openhands browser click 'testid=right-panel-toggle'`, `control-openhands browser text 'testid=tabs-pane-header'` (read now for `F27.canvas-ui-open-tab` below; it starts with `Terminal`, so the drawer is already on Terminal: do not click `conversation-tab-terminal`, because clicking the active tab closes the drawer) and `control-openhands browser text '.xterm-rows'`. Expected: the earlier commands are still listed. Known failure (#17566 reproduces, 2026-10-06): the text is empty and the tab reads "No terminal output yet" while the chat still lists the actions. Live append is checked after the Build step below.+- **Agent tab survives reload (`F27.canvas-ui-open-tab`).** The `tabs-pane-header` text read in the reload step above (right after `right-panel-toggle`) starts with `Terminal`, the agent's last choice: `src/services/canvas-ui.ts` saves the tab per conversation like a user click (#18045), and `control-openhands browser eval "JSON.parse(localStorage.getItem('conversation-state-<tools-id>')).selectedTab"` is `terminal` (`browser screenshot --feature F27.canvas-ui-open-tab --name reload-reopens-terminal`). For contrast, `control-openhands browser click 'testid=conversation-tab-usage'`, `control-openhands browser reload`, `control-openhands browser click 'testid=right-panel-toggle'`: a user-clicked tab is restored (`Usage`).+- **Task List (`F27.tasklist`).** In `<tools-id>` run `control-openhands browser click 'testid=conversation-tab-tasklist'`, `control-openhands browser wait '[data-active="true"] >> has-text=qa-two' --timeout 10000` (the rows render a moment after the click; an immediate count reads `0`), `control-openhands browser count '[data-active="true"] >> has-text=qa-two'` (`1`) and `control-openhands browser count '[data-active="false"] >> has-text=qa-three'` (`1`); screenshot with `control-openhands browser screenshot --feature F27.tasklist --name tasks` (done/in-progress/todo icons). Menu entry: `control-openhands browser click 'testid=tabs-pane-header >> testid=ellipsis-button'` then `control-openhands browser click 'testid=conversation-tabs-menu-open-tasklist'`; the header starts with `Task List`.+- **Plan and Build (`F27.planner-plan`, `F27.planner-build`).** In `<tools-id>` run `control-openhands browser click 'testid=conversation-tab-planner'` and `control-openhands browser snapshot 'testid=app-route'`: it ends with `heading "QA Plan" [level=1]` and a list `alpha`, `beta`, `gamma`; `control-openhands browser enabled 'testid=planner-tab-build-button'` is `true`. Run `control-openhands browser click 'testid=planner-tab-build-button'`, then `control-openhands browser count 'testid=user-message >> has-text=Execute the plan based on the .agents_tmp/PLAN.md file.'` (`1`) and `control-openhands conversation wait <tools-id> --timeout 240`; the agent reads PLAN.md and answers. Live append (`F27.terminal-live-append`): `control-openhands browser click 'testid=conversation-tab-terminal'` and `control-openhands browser text '.xterm-rows'` now show the new `$ cat .agents_tmp/PLAN.md` block and its output (but not the pre-reload history).+- **Create a plan (`F27.planner-create`).** In `<quiet-id>` (no plan yet) run `control-openhands browser goto /conversations/<quiet-id>` and `control-openhands browser click 'testid=right-panel-toggle'` (the browser is on `<tools-id>`, and a fresh load has the drawer closed; it reopens on the tab last chosen there, Usage after the context-ring bullet (its Usage item and bar save `usage`): if that is already Planner, skip the next click, which would close the drawer), then `control-openhands browser click 'testid=conversation-tab-planner'`, `control-openhands browser click 'role=button[name="Create a plan"]'`, then `control-openhands browser toasts` (`Planning agent initialized`) and `control-openhands browser enabled 'role=button[name="Create a plan"]'` (`false`). The composer placeholder is `Let’s work on a plan` (`browser screenshot --feature F27.planner-create --name after-create`). After `control-openhands browser reload` and reopening Planner the button stays disabled, and `control-openhands api GET /api/conversations/<quiet-id>` lists one `sub_conversation_ids` entry (the helper; it is not in the sidebar list).+- **Open a file from the agent (`F27.canvas-ui-navigate-file`).** On `/conversations/<tools-id>` (`control-openhands browser goto /conversations/<tools-id>`; Create a plan left `<quiet-id>`, and `--stay` sends into the open page) run `control-openhands conversation start --stay --prompt "Call the canvas_ui_control tool with command navigate_to_file and path .agents_tmp/PLAN.md, then reply OK." --wait --timeout 200`, then `control-openhands browser count 'testid=file-quick-row-item-.agents_tmp/PLAN.md'` (`1`) and `control-openhands browser text 'testid=files-tab-content'` (`Rich`, `Plain`, `QA Plan`, `alpha`…). Chat link entry: `control-openhands browser click 'testid=right-panel-toggle'` (closes the drawer), `control-openhands browser click 'testid=markdown-file-path-link >> nth=0'`, then `control-openhands browser attr 'testid=right-panel-toggle' aria-pressed` is `true` with the same file selected.+- **Launch a child (`F27.launch-child`).** On `/conversations/<tools-id>` (code mode, not a plan-mode conversation) run `control-openhands conversation start --stay --prompt "Call the launch_child_conversation tool with target local, isolation shared and task 'Reply with only the word PONG. Do not run any tools.' Then reply OK."` and poll `control-openhands browser toasts` every few seconds: one toast reads `Launched a local child conversation Open`. Take the child id from `control-openhands conversation events <tools-id> --kinds MessageEvent` (the `[child-conversation] {"status":"launched",…,"conversation_id":"<child-id>"…}` message), then `control-openhands conversation wait <child-id> --timeout 120` (`finished`) and `control-openhands conversation events <child-id> --kinds MessageEvent` (agent `PONG`). `control-openhands browser count 'testid=conversation-card >> has-text=PONG'` is `1`.+- **Overview (`F27.overview-peek`, `F27.overview-pin`, `F27.overview-changes-link`, `F27.overview-drawer`).** On `/conversations/<quiet-id>` (`control-openhands browser goto /conversations/<quiet-id>`; Launch a child left `<tools-id>`) run `control-openhands browser click 'testid=right-panel-toggle'` (the peek exists only while the drawer is open; a fresh page load has it closed), `control-openhands browser hover 'testid=conversation-overview-toggle'` and `control-openhands browser text 'testid=conversation-overview-peek'` (`Overview`, `Changes`, `+0`, `-0`, `Workspace`, `None`). `control-openhands browser click 'testid=conversation-overview-toggle'`; `control-openhands browser attr 'testid=conversation-overview-toggle' aria-pressed` is `true` and `right-panel-toggle` is `false`. Pin: `control-openhands browser click 'testid=conversation-overview-ellipsis'`, `control-openhands browser click 'testid=conversation-overview-menu-pin-workspace'`; `control-openhands browser count 'testid=conversation-overview-workspace'` is `0` and the pin button's `aria-pressed` is `false`; after `control-openhands browser reload` and `browser click 'testid=conversation-overview-toggle'` the count is still `0`. Re-pin the same way (count `1`). Git parts work the same: `conversation-overview-menu-pin-git-changes` hides `testid=conversation-overview-diffs` (count `0`, also after a reload) and a second click restores it. Close the menu with `control-openhands browser press Escape`: `control-openhands browser count 'testid=conversation-overview-context-menu'` is `0`, `control-openhands browser eval "document.activeElement.dataset.testid"` is `conversation-overview-ellipsis` and `testid=conversation-overview-panel` still counts `1` (a second click on the ellipsis closes the menu too). Changes: `control-openhands browser click 'testid=conversation-overview-diffs'`; the overview panel count is `0`, `right-panel-toggle` is pressed and `tabs-pane-header` starts with `Commits`. Drawer: reopen the Overview, `control-openhands browser click 'testid=conversation-overview-ellipsis'`, `control-openhands browser click 'testid=conversation-overview-menu-open-git-pull_requests'`, `control-openhands browser text 'testid=conversation-overview-drawer'` (`Pull Requests` / `Connect a git repository to view pull requests and issues`), then `control-openhands browser click 'testid=conversation-overview-drawer-close'` and `control-openhands browser wait 'testid=conversation-overview-drawer' --state hidden --timeout 5000` (an immediate `visible` still reads `true` during the slide-out animation).+- **Overview menu opens Commits (`F27.overview-menu-open`).** On `/conversations/<tools-id>` (it has an uncommitted `.agents_tmp/PLAN.md`; `control-openhands browser goto /conversations/<tools-id>`, since the Overview bullet is on `<quiet-id>`) run `control-openhands browser reload`, `control-openhands browser click 'testid=conversation-overview-toggle'`, `control-openhands browser click 'testid=conversation-overview-ellipsis'` and `control-openhands browser click 'testid=conversation-overview-menu-open-git-commits'`: `control-openhands browser count 'testid=conversation-overview-panel'` is `0`, `tabs-pane-header` starts with `Commits` and `control-openhands browser attr 'testid=uncommitted-changes-row-toggle' aria-expanded` is `false`. Repeat with `conversation-overview-menu-open-git-changes`: same tab, `aria-expanded` `true` and `control-openhands browser count 'testid=uncommitted-changes-row-content'` `1` (the `.agents_tmp/PLAN.md` row). Screenshot with `control-openhands browser screenshot --feature F27.overview-menu-open --name changes`.+- **No browser tool here (`F27.browser-screenshot`, blocked).** `control-openhands conversation start --prompt "Use your browser tool to navigate to https://example.com and then reply with the page title only." --wait --timeout 240` made the agent fall back to `curl`. Confirm with `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser click 'testid=show-agent-tools-button'`, `control-openhands browser click 'testid=system-message-modal >> role=tab[name="Available Tools"]'` and `control-openhands browser snapshot 'testid=system-message-modal'`: the tools are terminal, file_editor, task_tracker, canvas_ui_control, launch_child_conversation, finish, think, switch_llm, invoke_skill (no browser tools). Close with `control-openhands browser click 'testid=close-system-message-modal'`. With a working browser tool, expect `browser-chrome-url` to hold the URL and `browser-chrome-open-external` count `1`.+- **Info modals at phone width (`F27.info-modals-phone`).** Run `control-openhands browser viewport phone`; for each of `skills`/`skills-modal`, `hooks`/`hooks-modal`, `agent-tools`/`system-message-modal`: `control-openhands browser click 'testid=chat-plus-button'`, `control-openhands browser click 'testid=show-skills-button'`, `control-openhands browser wait 'testid=skills-modal' --timeout 10000`, `control-openhands browser bbox 'testid=skills-modal'`, `control-openhands browser screenshot --feature F27.info-modals-phone --name skills`, `control-openhands browser click 'testid=close-skills-modal'` (substitute the names). Each box is 351 px wide at x 19.5 with `insideViewport` `true` and `pageHorizontalOverflow` `false`.+- **Agent tab at phone width (`F27.canvas-ui-phone`).** Still at phone width on `/conversations/<id>`, run `control-openhands conversation start --stay --prompt "Call the canvas_ui_control tool with command open_tab and tab terminal, then reply OK." --wait --timeout 200`, then `control-openhands browser url` (it ends `/conversations/<id>/panel`), `control-openhands browser count 'testid=tabs-pane-header'` (`1`) and `control-openhands browser attr 'role=tab[name="Terminal"]' aria-selected` (`true`). The panel page has no `right-panel-toggle`. Screenshot with `control-openhands browser screenshot --feature F27.canvas-ui-phone --name panel-terminal`.+- **Phone panel tabs (`F27.phone`).** At phone width run `control-openhands browser goto /conversations/<tools-id>/panel`; tabs that do not fit the 390 px row move into the tabs menu (with Commits active, as the Overview menu bullet leaves it, Usage is not in the row and `conversation-tab-usage` does not exist), so open Usage with `control-openhands browser click 'testid=tabs-pane-header >> testid=ellipsis-button'` and `control-openhands browser click 'testid=conversation-tabs-menu-open-usage'`, then `control-openhands browser bbox 'testid=usage-panel'` (390 wide, `insideViewport` `true`, no overflow) and `control-openhands browser screenshot --feature F27.phone --name usage`. Then `control-openhands browser click 'testid=conversation-tab-planner'`, `control-openhands browser bbox 'testid=conversation-tab-planner'` and `control-openhands browser bbox 'testid=planner-tab-build-button'`: the tab row stays inside the viewport (the Planner tab at y 5.5, `insideViewport` `true`) and the Build bar sits below the 39 px top bar (Build at y 49.5); screenshot with `control-openhands browser screenshot --feature F27.phone --name planner`. Return with `control-openhands browser viewport desktop`; the app replaces `/panel` with `/conversations/<tools-id>`.+- **Terminal waiting (`F27.terminal-waiting`).** Arrange an errored conversation without model cost: `echo sk-qa-invalid > $OH_VERIFY_RUN/private/qa-bad.key`, `control-openhands llm set --profile qa-bad --model deepseek/deepseek-flash --api-key-file $OH_VERIFY_RUN/private/qa-bad.key --no-validate` (activates it), then `control-openhands conversation start --prompt "Reply OK." --wait --timeout 120` (status `error`, the chat shows the authentication error). Run `control-openhands browser click 'testid=right-panel-toggle'`, `control-openhands browser click 'testid=conversation-tab-terminal'` and `control-openhands browser wait-text 'Waiting for runtime to start' --timeout 10000`; screenshot with `control-openhands browser screenshot --feature F27.terminal-waiting --name error`. Restore with `control-openhands llm preset deepseek --api-key-file <key file>` (re-activates `deepseek-flash`) and `control-openhands api DELETE /api/profiles/qa-bad --write`. For contrast, a conversation paused with F07's Stop Runtime (`conversation status` `paused`, composer `Stopped`) shows "No terminal output yet": `PAUSED` is not in `RUNTIME_INACTIVE_STATES`.+- **State not reached (`F27.usage-empty`).** A new conversation's metrics arrive before the drawer can be opened (the Usage tab shows `Loading...`, then numbers); even the errored conversation above shows all-zero totals, not the empty state; and `control-openhands service stop agent-server` replaces the page with "Manage backends". "No metrics data available" was not observed.++## Gotchas++- After a reload the Task List (and tab bar entry) appears only once history has loaded; wait about 2 s before counting `[data-active="true"]` rows.+- `[data-active]` is also used by sidebar conversation cards: always combine it with `has-text=<task title>`.+- `browser click --observe` takes a plain CSS selector (`'[data-testid=compact-context-button]'`); the `testid=` form fails with a `querySelectorAll` SyntaxError.+- "Create a plan" leaves that conversation in plan mode: the next composer message goes to the planner helper, which has no `launch_child_conversation` or `canvas_ui_control`. Use a separate conversation for client-tool prompts.+- The child-launch toast's Open link animates; `browser click` on it times out with "element is not stable". Read the child id from the parent's `[child-conversation]` message instead.+- `GET …/file/download?path=…/.agents_tmp/PLAN.md` 404 and `GET /api/llm/balance` 404 are expected app-origin errors (no plan yet; no balance endpoint). Count them in `browser errors --app-only` but do not report them.+- Escape closes the composer context popover and the Overview "..." menu and returns focus to the trigger (#18044); an outside click, or a second click on the trigger, closes them too.+- The Overview column is 28 px narrower than its content (`scrollWidth` 296, `clientWidth` 268). After some clicks inside it, Playwright's scroll-into-view shifts it and the card looks cut off on the left; `browser reload` restores it before taking screenshots.+- The agent may summarize a client-tool action with its own title (for example "Launch local child conversation to reply PONG") instead of "Launching a child conversation"; assert the toast and events, not the chat title.+- The Overview peek appears only while the drawer is open (`canPeekOnHover` needs `isRightPanelShown`); a `browser goto` or reload starts with the drawer closed.+- At phone width (and in a narrow drawer) the tab row shows only the tabs that fit; the rest are reachable only through the tabs menu (`conversation-tabs-menu-open-<tab>`), and which tabs fit depends on the active tab's label width.+- Plain `agent-canvas` instances on one machine share the tmux socket `/tmp/tmux-<uid>/openhands` (OpenHands/OpenHands#17946), so another instance stopping can reset this one's terminal. `control-openhands launch` gives each run its own `TMUX_TMPDIR`, so in verification runs a reset means this run's agent server restarted.+- Agent Tools & Metadata remembers the last tab (it reopens on Available Tools).+- Known open issues: terminal history after reload (#17566) still fails (reproduced 2026-10-06); info modals at phone width (#17562) pass.+- Agent tab requests (`open_tab`, `navigate_to_file`, chat file links) are saved per conversation like a user tab click (#18045): after the agent opens Terminal or a file and the page reloads, the drawer starts closed and the panel toggle reopens it on that tab; clicking that tab then closes the drawer. At phone width they navigate to `/conversations/<id>/panel`.diff --git a/.agents/skills/verify-openhands/references/feature-map/README.md b/.agents/skills/verify-openhands/references/feature-map/README.mdnew file mode 100644index 0000000000..ce903e8949--- /dev/null+++ b/.agents/skills/verify-openhands/references/feature-map/README.md@@ -0,0 +1,276 @@+# OpenHands Agent Canvas feature map++This directory is the maintained source for verifying the user-facing behavior+of Agent Canvas. Read this index before driving the app, then open the matching+feature file and run its recipe with `control-openhands`. The map is not a claim+that every row passes today; the run's evidence ledger is.++## Baseline preconditions++- `control-openhands` is on `PATH` (see [the skill](../../SKILL.md)).+- `control-openhands launch` started this checkout; `control-openhands doctor`+ is `ok` for the run in `$OH_VERIFY_RUN` (or the `current` symlink).+- `control-openhands onboard --skip` has answered telemetry consent and closed the+ onboarding modal, unless the recipe tests onboarding itself.+- Model-backed recipes: `control-openhands llm preset deepseek` saved+ `deepseek-flash` (active) and `deepseek-pro` from `DEEPSEEK_API_KEY` (or+ `--api-key-file PATH`). States that exist only while no LLM is configured+ (the home banner, onboarding's LLM step) need a fresh `launch --new` and must+ run before the preset. When the key fails validation (an empty balance, a+ rate limit), `llm preset deepseek --no-validate` still saves the profiles:+ recipes that only need a conversation to exist can run on, and every+ recipe that reads a model reply is `blocked`, never a pass.+- The browser is at the desktop viewport (1440×1000) unless a recipe says+ otherwise; `control-openhands browser viewport phone` is 390×844.+- Never drive an instance that this verification run did not start.++## Driving conventions++- Start every recipe from the baseline state unless its preconditions say+ otherwise, and return to it afterwards (delete fixtures, re-activate+ `deepseek-flash`, restore toggles).+- Selectors: prefer `testid=...` scoped with ` >> ` to the owning form, row or+ dialog, then `role=...[name="..."]`, then `label=`/`text=`. Discover handles+ with `control-openhands browser testids` and `browser snapshot`.+- Treat commands as literal. Fixture names start with `QA_` or `qa-` so cleanup+ and assertions never collide with real data.+- UI navigation and direct URL entry are different entry points; record which+ one a check used. After a navigating click, wait for the destination:+ `browser click '<sel>' --expect-url '<regex>'`; the plain click returns the old URL.+- Many settings switches are a hidden `<input>` inside a `<label>`: click+ `'testid=<switch> >> xpath=ancestor::label'` (language-independent; the label+ text also works in English) and read `.checked` with `browser eval`.+- Verbs that are easy to miss: `browser mouse-click X Y` (backdrops and+ overlays), `click --modifiers Control,Meta` (open in new tab, multi-select),+ `click --hover-first` (hover-driven toggles), `click --expect-new-url`,+ `browser tooltip <sel>`, `browser wait <sel> --state hidden|visible|detached`+ (use it after toggles: animations make an immediate `count` or `visible`+ lie), `browser media --clear` (forget earlier sounds before a negative sound+ check). `browser eval` takes one expression; wrap statements in an IIFE.+- Input that is not a click: `browser upload-via <trigger> <file>` answers the+ real file chooser; `browser drop-files <sel> <file>` and `browser paste <sel>+ --file F --text T` deliver drag-and-drop and paste events (target an element+ inside the drop zone: events bubble up); `browser drag` reorders draggable+ rows or moves a grip `--by DX,DY`; `browser choose <combobox> <label>` picks+ an autocomplete option; `browser clipboard` reads what a Copy button wrote.+- Short-lived feedback: `browser toasts --history` lists every toast since the+ page loaded; `click --observe SEL` records transient labels. An error toast+ is neither a page nor an HTTP error, so `browser errors` misses it: read the+ toast history after every mutation, backend add or switch.+- Hover-driven controls open on pointer enter only: `browser hover` on the+ element the pointer is already over does nothing. Hover something else first+ (`browser hover 'testid=command-menu-trigger'`), or use `click --hover-first`.+- Agent-side proof: `conversation events <id> --grep TEXT [--from-start]`+ searches whole events (the system prompt's skills and tools, tool+ arguments); rows show activated skills. After sending a follow-up message,+ `conversation wait <id> --fresh` ignores the previous terminal status.+ `fixture skill` writes a personal or project `SKILL.md`; `api GET ...+ --pick a.b.c` reads one field.+- An already-open page does not refetch settings written by `llm` or `api+ --write`: `browser reload` before asserting UI state after an arrange step.+- Settings and panels scroll inside a container: `browser scroll '<sel>' --by 600`+ scrolls the right one. `--full-page` cannot help there, because the page+ itself is only one viewport tall: take one screenshot per scroll position.+- `conversation start` leaves the browser on the conversation page, which also+ has a `testid=submit-button`. `browser goto` the next page explicitly, or a+ later `wait --state detached` passes vacuously on the wrong page.+- `click --expect-url` passes at once when the URL already matches (one+ conversation to another); use `--expect-new-url` there.+- Select rows by a prompt word or an id prefix, never by a model-written title:+ titles differ between runs. Only the 20 most recently updated conversations+ load, so a recipe that creates more must not rely on older rows after a reload.+- Click composite cards by their title or a detail element: the centre can be+ a region that stops propagation, and the click then does nothing.+- Dialogs can match twice (nested `role=dialog`): scope by test id or add+ `>> nth=0`. `browser testids <scope>` misses portaled parts of a dialog or+ menu; run it unscoped with `--filter`.+- Panels opened by a click mount after a moment: `browser wait` before+ counting. A disabled rich composer is `contenteditable=false`, so `fill`+ fails there; check `browser attr ... contenteditable`.+- Error toasts can arrive after the UI retries (about 1.5 s): read them with+ `browser toasts --history`.+- Pop-ups opened with `window.open` (sign-in, docs links) appear a moment after+ the click: `browser wait-tab '<url regex>'`, then `browser tab <i>`.+- Drag: `browser drag <sel> <target-sel>` moves the pointer in steps; if a list+ still does not reorder, drag its handle with `--by DX,DY --steps 20`.+- An MCP server to test with: `control-openhands fixture mcp-server` writes a+ dependency-free stdio server with one tool, `qa_echo`.+- A conversation in a folder or repo: `control-openhands fixture git-repo --name+ qa-repo [--remote https://github.com/qa-example/qa-repo.git]`, then+ `control-openhands conversation start --workspace qa-repo --prompt ...`. It+ drives Open Workspace and the folder browser, which has no path field+ (`workspace open qa-repo` does only the picking). `--remote` only sets+ `origin`, which is enough for the repo/branch links and Pull/Push chips.+- Sidebar and row navigation can append `?backend=<id>`: end `--expect-url`+ regexes with `(\?|$)`, not `$`.+- Some confirmation buttons render without the `data-testid` their source+ passes (`BrandButton` takes `testId`, not `data-testid`). When+ `browser testids 'role=dialog'` lists nothing, use+ `'role=dialog >> role=button[name="Confirm"]'`.+- `browser errors --clear` and `browser network --clear` print the list, then+ empty it: run them before the action, then read again after it. `errors`+ lists failures only; prove that a request happened (or did not) with+ `network`. Page errors (uncaught exceptions) are failures; console warnings+ such as missing translations are reported, not failures.+- `api GET ... --pick a.b.c` paths start inside the response body (a leading+ `body.` is accepted).+- In a sandbox, requests to external hosts (fonts, model catalogs) can fail;+ judge the errors sweep by its `app:` rows, and `browser errors --app-only+ --no-warnings` hides translation warnings.+- Downloads are saved as `<run>/private/downloads/<ms>-<suggested name>`;+ claims about their content need `browser downloads --last 1 --inspect`.+- `onboard --skip` after `browser reset` skips only the modal: consent is+ stored on the backend, so it is not asked again.+- The Agent Server runs with `HOME=<run>/private/home` (personal skills,+ plugins, `~/.agents`) and keeps catalog caches under `<run>/private/cache`.+ Fixtures that belong there (`fixture skill`) write into the run, never into+ the operator's home.+- Each port is its own origin: `browser goto` needs `--allow-external` for any+ other localhost port, and that origin starts at first run again.+- Two stacks (a second backend, backend switching): launch the second one with+ `export OH_VERIFY_RUN_2=$(OH_VERIFY_RUN= control-openhands launch --new+ --no-browser --print-run)` and address it with `--run "$OH_VERIFY_RUN_2"`+ (before or after the command). Add it in the UI as a backend; activating a+ backend asks for its own telemetry consent, which `onboard --skip` answers.+ While its services are stopped the browser logs CORS errors for that origin;+ they come from the dead upstream, not from the app.+- At phone width the desktop sidebar stays in the DOM, hidden, so sidebar test+ ids match twice: scope them, `'testid=sidebar-mobile-drawer >> ...'`.+- Card toggles that swap their icon on hover (plugins, skills, pickers) can+ swallow a plain click: use `click --hover-first` and assert `aria-checked`+ plus the API state.+- An open autocomplete listbox closes when another command touches the page;+ `browser choose` opens, filters and picks in one step.+- Side effects outside the app are valid second views: `git -C <path> log`+ on a `fixture git-remote` after a push or Git Sync, a downloaded file with+ `downloads --inspect`. Mark such shell commands as read-only checks.+- Negative tests (a 409, a 422, a stopped service) add expected HTTP errors:+ run `browser errors --clear` after them so the family's sweep only shows+ surprises, and name the expected ones in the evidence row.+- Cleanup across families: deleting a fixture through the UI belongs to the+ family that maps deletion; elsewhere `api DELETE ... --write` is fine+ (arrange, not proof).+- When a label depends on the UI language or a toast may already be gone,+ assert the persisted state after `browser reload` instead of `wait-text`.+- Pass `--timeout 5000` to waits for elements that may legitimately not appear;+ the 30 s default adds up quickly.+- Conversations created as fixtures may stay when no recipe in the family covers+ deleting them; they vanish with the run's private state.+- Rows with generated ids: select by prefix plus the fixture name,+ `'[data-testid^="automation-card-"] >> has-text=QA_Pong'`. Portal menus without+ test ids: scope by role and a unique item, `'role=menu >> has-text=Delete'`.+- Restore per-viewer state too (view mode, pinned home route, collapsed panels+ live in localStorage); some controls disable themselves once their data is+ gone, so restore before deleting fixtures.+- `control-openhands api ... --write`, `llm` and `fixture` arrange preconditions.+ They are never the proof step for the feature under test.+- Accessible-name matching is a case-insensitive substring match:+ `role=heading[name="Activity"]` also matches **Activity Log**. Add `[exact]`+ (`role=heading[name="Activity"][exact]`) when a shorter name is a prefix of+ another. Use plain `text=` substrings inside ` >> ` chains; a regex+ `text=/.../` segment there does not match.+- Give every asserted value its selector (`browser text 'role=heading[level=1]'`,+ not "the h1 is X"): pages differ in landmarks, and the automation detail page+ has no `main`, so a habitual `'role=main >> ...'` times out there.+- Time-sensitive steps (a key press inside a 2 s busy window, a click while a+ request is pending) go in the same shell line as the action that opens the+ window: `browser click A && browser press Space`. A separate tool call is+ often too late.+- `browser network --last N` returns its rows under `recent`.+- Backend versions come from launch flags only (`--sdk-version`, `--sdk-ref`,+ `--sdk-path` and the `--automation-*` equivalents); `OH_AGENT_SERVER_*` in+ your shell is not forwarded. An Agent Server below the UI's minimum+ (`config/defaults.json` `compatibility.minimumAgentServer`) never gets past+ the backend-compatibility gate, so it cannot reach capability-missing states+ inside a page.++## Proof and skip reporting++- Capture the user action and the resulting state, not only the final screen.+- Mutations need a read-only second view: `browser reload`, reopening the item,+ or `control-openhands api GET ...`.+- Visual checks: `browser screenshot --feature <ID> --name <label>` at the stated+ viewport, plus `browser bbox` for overflow/geometry claims.+- After each family, `control-openhands browser errors --app-only` must not show+ new page errors; count and report them even when the UI recovered. Record the+ sweep under the sub-feature whose page produced the errors (or the family's+ page-level ID); `evidence add` warns about IDs that are not in the map.+- Exports and downloads: `browser downloads --last 1 --inspect [--contains TEXT]`+ shows a text file's head or a zip's entry names.+- Record every check with `control-openhands evidence add --feature <ID> --result+ pass|fail|blocked|not-run`, one row per sub-feature ID a recipe bullet proves+ (a bullet that covers two IDs gets two rows). A skipped entry point is never+ verified through a different one. Blocked rows name the missing prerequisite+ and the attempted path.+- Resuming after `stop`: `control-openhands restart` brings the stack back with+ its state, ports and ledger, and `browser start` opens a fresh page at+ `about:blank`; `browser goto` the page you were on before asserting.++## Feature entry contract++Each feature file starts with an H1 title, a short paragraph describing the+user-visible behavior and a `Source:` line. It then uses exactly four H2 sections+in this order (`control-openhands map check` enforces it):++1. `Sub-features`: one bullet per stable ID (`` `Fnn.slug` ``) and behavior.+2. `How to get to it (user POV)`: every user entry point.+3. `Driving it with control-openhands`: starts with `Preconditions:`, then labeled+ bullets pairing each user action with exact commands and the observable result.+4. `Gotchas`: traps that waste or invalidate a run, and linked known issues.++How to write and prove new entries: [../mapping.md](../mapping.md).++## Features++| ID | Family | What it covers | Entry points | Needs | Sub-features |+|---|---|---|---|---|---|+| F01 | [First run, onboarding and sign-in](F01-first-run-and-sign-in.md) | telemetry consent, onboarding modal, public-mode backend step and API-key screen, route error page | any URL on a fresh browser profile; `launch --public` | fresh run or `browser reset`; LLM for say-hello | 21 |+| F02 | [App shell, sidebar and command menu](F02-app-shell.md) | rail and phone drawer, collapse, home pinning, getting-started checklist, command menu, toasts | every page; `Control+k` / `Meta+k` | baseline; LLM for checklist progress | 25 |+| F03 | [Home and starting work](F03-home.md) | home composer, workspace picker, plugin picker, recommended automations rail, no-LLM banner | `/`, **New Chat**, command menu | runs before and after `llm preset`; fixture repo | 39 |+| F04 | [Conversation list and folders](F04-conversation-list.md) | sidebar list, View presets, workspace folders, tags, rename/pin/archive/delete, load more | sidebar on every page | several conversations; fixture repos | 40 |+| F05 | [Composer, slash commands and plan mode](F05-composer.md) | send, drafts, attachments, model pill, slash commands, `/goal`, plan mode, dictation | home and conversation composer | LLM | 23 |+| F06 | [Agent activity](F06-agent-activity.md) | messages, tool events, thinking, empty state, confirmation mode, stop/resume, errors, branching | `/conversations/<id>` | LLM | 33 |+| F07 | [Conversation page, header and menu](F07-conversation-page.md) | title rename, status menu, ⋯ menu (skills, hooks, tools, export, download, cost, stop, delete), git bar, overview | sidebar row, URL, `/panel` | LLM; fixture repo; Cloud items blocked | 25 |+| F08 | [Workspace drawer: files and changes](F08-workspace-files-and-changes.md) | Files tab, Commits and uncommitted changes, diff viewer, file links in chat | panel toggle, file links | LLM; fixture repo | 33 |+| F09 | [Settings shell and navigation](F09-settings-shell.md) | settings navigation, phone hub, deep links, update card, backend note | gear, command menu, URLs | baseline; deep links before `llm preset` | 24 |+| F10 | [LLM profiles](F10-llm-profiles.md) | list, add, edit, rename, duplicate, delete, default, advanced fields, validation | `/settings/llm` | fresh run; DeepSeek key | 31 |+| F11 | [Provider connections](F11-provider-connections.md) | add, edit, rotate key, delete connections; profiles from a connection | `/settings/llm` | fresh run; DeepSeek key | 21 |+| F12 | [Model router](F12-model-router.md) | meta-profiles, templates, run on first message, routing effect | `/settings/meta-llm` | LLM profiles | 25 |+| F13 | [Agent profiles](F13-agent-profiles.md) | OpenHands and ACP profiles, editor, name rules, active profile, MCP and secret scoping | `/settings/agents` | fresh run; LLM | 20 |+| F14 | [Secrets](F14-secrets.md) | list, add, edit, rename, delete, agent access | `/settings/secrets` | LLM for agent access | 11 |+| F15 | [Condenser, agent context and verification](F15-agent-behavior-settings.md) | condenser fields, agent context, confirmation mode and critic, their effect on runs | `/settings/condenser`, `/agent-context`, `/verification` | LLM for the effects | 23 |+| F16 | [Application settings](F16-application-settings.md) | language, theme, analytics, sound, checklist, title model, voice input, git identity | `/settings/app` | LLM for title and git checks | 19 |+| F17 | [Customize hub and MCP servers](F17-mcp-servers.md) | catalog, install, test, edit, delete, custom servers, agent use | **Customize**, `/mcp` | `uvx`/`npx`; LLM | 26 |+| F18 | [Skills catalog](F18-skills.md) | facets, search, enable/disable, add skill, Use skill, personal and project skills | `/skills` | `fixture skill`; LLM | 19 |+| F19 | [Plugins and plugin launch](F19-plugins.md) | catalog, install, update, uninstall, enable, launch deep links | `/plugins`, `/launch` | LLM | 25 |+| F20 | [Canvas apps](F20-canvas-apps.md) | install from path or git, enable, update, uninstall, extension pages | `/apps` | none | 23 |+| F21 | [Automations dashboard and actions](F21-automations-dashboard.md) | cards and list, filters, sort, Run now, enable, export, import, delete, pin | `/automations` | LLM; automation service | 34 |+| F22 | [Creating automations](F22-automation-creation.md) | templates, setup dialog, custom automations, import | `/automations/templates`, `/automations/new/<id>` | LLM | 28 |+| F23 | [Automation detail, runs and editing](F23-automation-detail.md) | detail page, runs, logs, edit dialog, triggers, debug | `/automations/<id>` | LLM; runs | 39 |+| F24 | [Automation Git Sync](F24-git-sync.md) | configure, sync cycles, encryption, status | `/automations/git-sync` | `fixture git-remote` | 26 |+| F25 | [Backends, Cloud and sharing](F25-backends-and-cloud.md) | add, edit, remove and switch backends, per-backend consent, Cloud login, shared pages | backend selector | a second stack; Cloud account (blocked) | 27 |+| F26 | [Launcher modes, Docker, desktop and library](F26-runtime-variants.md) | launcher flags, partial stacks, LAN bind, Docker, Electron, embeddable library | a terminal | Docker/Electron where available | 27 |+| F27 | [Workspace tools](F27-workspace-tools.md) | terminal, browser, planner, task list, usage, `canvas_ui_control` | drawer tabs | LLM | 29 |++27 families, 716 sub-features. `control-openhands map ids` lists every ID with its file.++### Neighbouring families++Several pages are shared. Each behavior has one owner; the others reference its ID instead of re-mapping it.++- Conversation page: the composer is F05, what the agent produces is F06, the header and its menus are F07, the drawer is F08 (files, changes) and F27 (tools).+- Starting work: Home is F03; the recommended-automation launcher is shared by F01 (onboarding), F03 (rail) and F22 (templates), and owned by F22.+- LLM settings: profiles are F10, provider connections F11 (same page), routers F12, agent profiles F13.+- Automations: dashboard F21, creation F22, detail and runs F23, Git Sync F24.+- Customize: MCP F17, skills F18, plugins F19, apps F20; the hub and its navigation are in F17.+- Backends: adding and switching backends is F25; launcher flags that create them are F26.++## Not mapped++Everything else a user can reach is mapped. These are left out on purpose:++- `src/components/features/context-menu`: a shared menu primitive, not a feature of its own. Its behavior is checked through the menus that use it (F04, F07, F21, F27).+- OpenHands Cloud behavior (Cloud login and device flow, organizations, sharing, task URLs, sandbox pause): needs a Cloud account. The recipes are written up to that point and recorded as `blocked` (for example `F07.cloud-only` and the Cloud rows of F25).+- Locked-to-Cloud deployments: `scripts/static-server.mjs --lock-to-cloud` exists, but `bin/agent-canvas.mjs` does not forward it, so `control-openhands launch` cannot start that mode.+- Page-local load errors (for example the LLM profiles or apps list failing while the rest of the backend works) need fault injection; stopping a service with `service stop` replaces the whole app with the backend-unavailable screen instead. The pages' empty and error copy is mapped where reachable.+- Real microphone dictation, native file dialogs outside the browser, and Electron window chrome beyond what F26 drives.diff --git a/.agents/skills/verify-openhands/references/maintenance.md b/.agents/skills/verify-openhands/references/maintenance.mdnew file mode 100644index 0000000000..2629b825a1--- /dev/null+++ b/.agents/skills/verify-openhands/references/maintenance.md@@ -0,0 +1,128 @@+# Maintaining the map (periodic or weekly)++A feature map rots the moment the app changes. This pass keeps it honest and+answers three separate questions about the interval since the last pass:+**Is each feature present? Does it work and look right? Was each change+documented and intended?** A merged PR proves none of the last two.++The unit of rigor is the feature: every feature file gets source coverage and+live coverage, without re-proving every sentence. This is a procedure, not a+scheduler: do not create automations, merge, or post externally unless asked.++## Outcomes++Pick one and say which:++- **clean**: every feature got source and live coverage, intent is reconciled,+ nothing worth shipping. No branch, no PR.+- **changed**: one PR of proven map/CLI corrections, separate from product fixes.+- **blocked/partial**: coverage could not finish. Say exactly what and why; do+ not call it clean or advance the accepted baseline.++Edit scope is this skill's directory only (SKILL.md, references/, scripts/).+Never edit product code during a maintenance pass.++## 1. Freeze the comparison++Record the UTC run time, budget (model, spend), accounts available and permitted+side effects. Fetch `main` and freeze its full SHA as TARGET. Check+`git rev-parse --is-shallow-repository`; deepen until BASE is present (an empty+log from a shallow clone is not "no changes"). BASE is the previous completed+pass's recorded TARGET; on a first run, the last first-parent commit before the+agreed cutoff (`git rev-list --first-parent -1 --before="$CUTOFF" "$TARGET"`).++```sh+git merge-base --is-ancestor "$BASE" "$TARGET"+git log --first-parent --format='%H %cI %s' "$BASE..$TARGET"+git diff --name-status "$BASE" "$TARGET"+```++Use separate worktrees for BASE and TARGET and `control-openhands launch --new`+for each, so state and ports never mix. Never rebuild the baseline from today's+source or overwrite last pass's evidence.++## 2. Build the PR-intent ledger++Resolve every commit in BASE..TARGET to its PR through the API+(`repos/OpenHands/OpenHands/commits/<sha>/pulls`; commit-message `(#123)`+regexes miss rebases and direct pushes). Read each PR's description, linked+issue acceptance criteria, relevant review discussion and file list.++| Commit / PR | Changed paths | Feature IDs / entry points | Intended result + quoted evidence | Runtime proof needed |+|---|---|---|---|---|++Record direct commits and unresolvable PRs as unknown intent. Keep intent+(`documented`, `undocumented`, `contradictory`) independent of runtime+(`pass`, `fail`, `blocked`, `not-run`). A working change can still be+undocumented. Never edit a PR description (the `HUMAN:` section is human-only)+to justify a change after the fact.++## 3. Index hygiene and source wave++Run `control-openhands map check` and `map coverage`; fix missing, duplicate and+dead entries (`map check --fix-counts` refreshes the index counts). Then give one read-only reader per feature file (parallel if+delegation is available). Each reads current source for that feature and returns:+summary, source entry points, likely drift with citations (or none), new+surfaces missing from the map, and one live recipe. Readers never edit files or+drive the browser.++Re-check stale harness claims whenever the CLI gained verbs: grep the map for+`blocked`, `not run`, `harness gap`, `no verb` and `cannot be driven`, and+re-drive any that a current verb can now reach (compare with+`control-openhands --help` and `help browser`).++Map **every changed path** in BASE..TARGET to a feature ID or an explicit+non-user-facing reason. For shared components, CSS, API clients, settings+schemas and dependency bumps, expand to their consumers rather than sampling one+convenient screen. A new surface needs a concrete source path before it is+called missing; then add it per [mapping.md](mapping.md).++## 4. Live pass++Required even when source looks clean. One coordinator owns each launched run+and drives it serially; parallel live work needs one `launch --new` per worker.+Exercise every feature at least once and every changed behavior on all its entry+points, at desktop and phone viewports for UI changes. Hold three invariants:++1. Never drive an instance not doctored since its last surprise+ (`control-openhands doctor`; reload or relaunch when the UI is wedged).+2. Evidence captured so far survives every cleanup (check it after `stop`).+3. Nothing a drive started outlives its usefulness: fixtures deleted, schedules+ disabled, runs stopped.++A doctor failure caused by skill drift is drift: fix it and retry once. A+feature that cannot be reached is `blocked` only with the concrete prerequisite+and the route attempted; if the map omits that prerequisite, that is drift too.+Re-drive any CLI fix before shipping it.++For an apparent regression, run the same minimal recipe on BASE and TARGET.+Claim introduced-in-range only when BASE passes and TARGET fails under+comparable conditions (same browser, viewport, fixture state, backend pins).+Otherwise classify as reproduced-on-both, environment/harness gap, intent gap,+or origin-unconfirmed. Use screenshots side by side; a pixel difference is not+automatically a bug and a zero difference does not prove behavior.++## 5. Triage++- **Map drift**: wrong or missing user-POV description. Fix the entry with+ current source and live evidence.+- **Harness gap**: working behavior the CLI cannot drive. Extend the CLI, keep it+ executable and documented in `--help`, re-drive.+- **Product defect**: keep the evidence, search existing issues, then file in the+ owning repository (Canvas here; Agent Server/SDK in+ `OpenHands/software-agent-sdk`; scheduling/dispatch in `OpenHands/automation`),+ following that repository's issue template. Keep it out of the maintenance PR.+- **Undocumented or contradictory change**: cite the PR and the observed+ difference; ask the maintainer instead of rewriting the expectation.+- **Known issues** linked in Gotchas are repro candidates: retest, link fresh+ results, never file duplicates or silently waive the check.++## 6. Report and hand off++Use [the report contract](report.md): verdict first, then family and check+counts, intent gaps, defects with issue links, blocked checks with their+prerequisites. For **changed**, open at most one PR from current `main`, re-read+every changed file first, and follow the repository's PR template. Finish with+`control-openhands stop`, retained evidence paths, and the exact inputs needed to+unblock what was blocked. Name the proposed next baseline; never replace an+accepted baseline automatically.diff --git a/.agents/skills/verify-openhands/references/mapping.md b/.agents/skills/verify-openhands/references/mapping.mdnew file mode 100644index 0000000000..98970cf0a7--- /dev/null+++ b/.agents/skills/verify-openhands/references/mapping.md@@ -0,0 +1,205 @@+# Creating and extending the feature map++The map is written for the next agent, read cold and mid-task by someone who has+never seen the app. Every entry answers, from the user's point of view: what the+feature is, how a user reaches it, how to drive it with `control-openhands`, and+what observable end state proves it works. A recipe that was never executed is a+draft, not an entry.++## 0. Build or check the lever first++Before mapping anything, prove the CLI can carry one feature end to end:+`launch`, `doctor`, drive one mapped recipe, `browser screenshot`, `evidence add`,+`stop`, and confirm the evidence file still exists after `stop`. If any step+fails, fix the CLI or report the environment blocker before writing entries:+a map written against a broken harness teaches wrong steps.++While mapping, every time you reach for an ad-hoc script, a raw Playwright+snippet or a manual curl to drive a user path, stop and add a verb or flag if missing to+`scripts/control-openhands.mjs` instead (documented in its `--help`). The CLI is+what makes the map rerunnable. But if it exists already, use it instead.++## 1. Inventory user-facing surfaces++Work from what a user can touch, and require a concrete source path for each+candidate. Sources, roughly in order of yield:++1. **Routes**: `control-openhands map routes` lists `src/routes.ts`. Every route+ is reachable by URL; most are also reachable from navigation. Both entry+ points count separately.+2. **Navigation and chrome**: on each page run `control-openhands browser testids`+ and `browser snapshot`. Record the sidebar, command menu (`command-menu-trigger`,+ `Control+k`/`Meta+k`), backend selector, settings navigation, onboarding+ checklist, and every button that opens a dialog, drawer, popover or menu.+3. **Per-item menus and dialogs**: row "more" menus, context menus+ (`src/components/features/context-menu`), confirmation modals, edit forms.+ Modals and panels are features even without a route.+4. **The conversation surface**: composer controls (attachments, profile and agent+ pickers, slash/skill commands, dictation, stop/play), message rendering+ (markdown, code, images, tool visualizers), the conversation panel tabs, git+ controls, and anything the agent can drive through client tools+ (`canvas_ui_control`).+5. **Keyboard shortcuts**: grep `keydown`, `useHotkeys`, `metaKey`, `ctrlKey` in+ `src/`. A shortcut is an entry point.+6. **Backends and modes**: local vs Cloud backend, public vs local auth, ACP+ agents, partial stacks (`agent-canvas --help`), Electron, Docker, and the+ embeddable library (`src/index.ts` / `build:lib`).+7. **Docs and specs**: `README.md`, `docs/*.md`, `specs/*.md` describe intended+ behavior; mock-LLM specs in `tests/e2e/mock-llm/` are selector references only.+8. **Strings**: `src/i18n/translation.json` keys reveal user-visible states+ (empty, error, disabled, confirmation) that a happy path never shows.++`control-openhands map coverage` lists routes and `src/components/features/*`+directories no entry references yet. Drive it to zero, or list each exclusion+with its reason in the index's "Not mapped" section.++## 2. Group into families++One file per user-facing job (for example "Secrets", "LLM profiles",+"Conversation composer"), not per component. Aim for files an agent can verify+in one sitting: usually 4 to 15 sub-features, up to about 30 for a dense page;+split beyond that (for example dashboard list vs. per-item actions). Name files+`Fnn-short-slug.md` and give the family the ID `Fnn`. Keep IDs stable forever:+when a label or route moves, update the text, not the ID; when a feature is+removed, mark it `retired` with the authorizing PR instead of deleting the row.++A **sub-feature** is one observable behavior with its own pass/fail, such as+"saving persists after reload" or "empty state explains what to do". IDs look+like `F14.secret-create`: lowercase, hyphenated, unique across the map. Settle+the IDs before taking evidence, and write the `## Sub-features` list into the+file first: screenshots and ledger rows are filed under them (`evidence add`+and `map check` reject unknown IDs), and renaming later means re-shooting.++An entry point shared by several families (a launcher card, a settings link)+is mapped once, by the family that owns the destination; the others reference+that ID instead of re-mapping it.++## 3. Write each entry++Each file starts with an H1 title, one paragraph describing the user-visible+behavior, and one `Source:` line with the main implementation paths (for drift+checks; keep other implementation detail out). For a family spread over many+files, list the route modules and top-level component directories, not every+file. Then exactly four H2 sections, in+this order:++1. `## Sub-features`: one bullet per ID: `` - `F14.create`: add a dummy secret; it persists after reload. ``+2. `## How to get to it (user POV)`: every entry point, in user language: the+ sidebar link, the direct URL, the command-menu entry, the keyboard shortcut,+ the row menu. Note which entry point each recipe exercises.+3. `## Driving it with control-openhands`: starts with `Preconditions:` (run+ state, profile, fixtures, viewport) as bullets, then labeled bullets that pair+ one user action with exact commands and the observable result:++ ```markdown+ - **Create (`F14.create`).** Add a secret from the list page.+ Run `control-openhands browser click 'testid=add-secret-button'`,+ `control-openhands browser fill 'testid=add-secret-form >> testid=name-input' QA_TMP`,+ `control-openhands browser fill 'testid=add-secret-form >> testid=value-input' dummy-value`,+ `control-openhands browser click 'testid=add-secret-form >> testid=submit-button'`,+ then `control-openhands browser reload` and+ `control-openhands browser count 'testid=secret-item >> has-text=QA_TMP'`.+ The count is `1` after reload.+ ```++ Include the read-only second view for every mutation (reload, reopen, or a+ GET through `control-openhands api GET ...`), the empty/error/disabled states+ that matter, and a `browser screenshot --feature <ID> --name <label>` where the+ proof is visual. Include phone-viewport checks (`browser viewport phone`) for+ layouts that change on small screens.+4. `## Gotchas`: traps that waste or invalidate a run: debounces, focus traps,+ items that only appear after the agent runs, features hidden behind a+ prerequisite, and known open issues (link them; they are repro candidates, not+ exemptions).++Treat commands as literal: quote selectors, keep names unique to the run (prefix+fixtures with `QA_`), and restore shared state after mutations (delete the secret,+deactivate the profile) unless the next recipe depends on it, in which case say so.+Values that differ per run (conversation and automation ids) are written as+`<id>` placeholders next to the command that prints them.++The driving bullets must run top to bottom on one stack, because the next agent+will run them that way:++- Put every arrange step in `Preconditions:`, in execution order. A+ precondition with a short life (a conversation that is running, a toast)+ says when to create it: "right before the Stop bullet".+- A bullet never depends on state that a later bullet creates, and never+ deletes a fixture that a later bullet needs.+- Write environment-dependent results as conditionals ("if the registry is+ reachable, `Up to date`; otherwise ...") and check them with `browser+ network`, not from memory.+- A bullet that leaves an unsaved edit ends with `browser reload`, and a+ bullet that changes a setting a later editor inherits (an LLM temperature,+ a theme) restores it or says so: later bullets inherit both.+- After picking an option and saving, read the stored value back; a failed+ option click otherwise goes unnoticed until a later step.+- Assert deterministic text (what the UI sent, a file the agent wrote, a tool+ observation), not the model's wording.+- Secret and credential checks assert the tool's output, not the model's+ reply: models refuse to echo secrets. Compare inside the command+ (`test "$QA_SECRET" = expected && echo match`) and read the observation+ with `conversation events <id> --kinds ObservationEvent`.++## 4. Prove every recipe live++Execute every command you wrote, in order, on a fresh `launch` (or a run you+have doctored since its last surprise). Before you hand the file over, run the+whole file once more from the top, exactly as written; a multi-minute,+model-backed step whose commands did not change since it last passed may be+skipped in that second pass if you say so in the report, and a family that+stops or restarts services may use a fresh stack for it.++Families about the launcher or the outside world (partial stacks, Docker,+desktop, a git remote) need some plain shell commands. Keep them few, give+every hand-started process its own process group and stop it by that group+(never by name pattern), and prefer adding a CLI verb once a command repeats.+Builds that rewrite tracked or generated files (`npm run build:lib`) run in a+copy of the checkout, not in the one other runs serve. For each sub-feature record+`control-openhands evidence add --feature <ID> --result pass|fail|blocked|not-run`+with the entry point, expected and actual result and artifacts.++- A recipe that fails because the instructions are wrong: fix the instructions+ and re-drive (map drift).+- A recipe the CLI cannot express: check `control-openhands --help` and+ `control-openhands help browser` first (backdrops, modifier clicks, stopped+ services, stale keys, first run and sound all have verbs), then extend the+ CLI and re-drive (harness gap).+- A recipe that fails because the app is broken: keep the expected result,+ record `fail` with evidence and report the product bug separately.+- A recipe that needs something the run cannot have (a Cloud account, a+ GitHub token, a Docker daemon, macOS): mark it `blocked`, name the prerequisite+ in `Preconditions:` and keep the recipe as far as it can be written.++`blocked` is the most common wrong verdict. Before you write it, try the+cheaper routes that earlier mappers missed:++- Another family may already create the precondition through the UI (F22's+ Daily news digest makes a script automation with no account). Search the+ other files for it.+- A bundled fixture often exists upstream too: a public, read-only Git source+ such as `https://github.com/OpenHands/OpenHands/tree/main/src/fixtures/...`+ works through the Agent Server's network access.+- When a path is "blocked because every X needs Y", list every X by its real+ attributes first. For example, sort the template cards by setup form and+ integration type: cards whose integrations all need external setup skip the+ install queue entirely.+- Check `<verb> --help` again; a `fixture` or `browser` verb may exist now.++## 5. Check the map++```sh+control-openhands map check --file Fnn-name.md # one entry while others are being written+control-openhands map check # whole map: structure, unique IDs, index links, valid commands+control-openhands map coverage # unmapped routes and feature component dirs+control-openhands map ids # every ID with its file, for the index tables+```++Whoever owns the index ([feature-map/README.md](feature-map/README.md)) adds the+new file to the families table with its entry points, prerequisites and ID+count, and lists "Not mapped" reasons. `control-openhands map check` fails when+a count is stale; `map check --fix-counts` rewrites the counts and the total. When several agents map families in+parallel, each edits only its own file and checks it with `--file`; one+coordinator updates the index afterwards.+Then hand the evidence ledger (`control-openhands evidence report`) to whoever+asked, with fail/blocked rows first.diff --git a/.agents/skills/verify-openhands/references/report.md b/.agents/skills/verify-openhands/references/report.mdnew file mode 100644index 0000000000..73eff0337b--- /dev/null+++ b/.agents/skills/verify-openhands/references/report.md@@ -0,0 +1,59 @@+# Verification report contract++Keep the complete ledger private until reviewed. Use stable relative artifact+paths; do not publish localStorage, authentication headers, live keys, session+URLs, system messages or raw traces. An ARIA/DOM snapshot can contain a password's+value even when its screenshot shows only bullets.++## Run identity++Record run ID and UTC interval, repository, BASE/TARGET full SHAs, baseline report,+checkout cleanliness, build command, Node/browser/OS/font/theme versions, backend+SDK and automation versions, actual ports, authorization/spend scope, and selected+backend/platform capabilities. `control-openhands status` and `doctor` print most+of these. Explain bootstrap or comparison gaps.++## Coverage ledger++Use one row per exercised or required sub-feature and entry point. Do not roll up+one passing example into a pass for its whole family. Record rows as you go with+`control-openhands evidence add` and render them with `control-openhands evidence report`.++| Feature/check + entry point | Revision/backend/viewport | Action or command | Expected → actual | Result | Evidence |+|---|---|---|---|---|---|++Use `pass`, `fail`, `blocked`, or `not-run`. For blocked rows name the missing+prerequisite, attempted action, and next step. Identify checks outside the declared+scope separately; do not count them as passed. Report denominator and counts for+both feature families and individual checks. A layout-only inspection must say so.++## Change / intent ledger (weekly)++| Commit / merged PR | Paths → feature IDs | Documented intent (quote/link) | Baseline → target observation | Intent status | Classification / issue |+|---|---|---|---|---|---|++Intent status: documented / undocumented / contradictory. Runtime classification:+intended-change / introduced-in-range / reproduced-on-both /+observed-origin-unconfirmed / environment-or-harness-gap. Keep these independent.+A screenshot proves appearance, not provenance or a side effect; include reloads,+real files, actual run status, or read-only state as appropriate.++## Findings and verdict++Lead with scope and verdict, then actionable defects and intent gaps. Include exact+steps, observed dimensions/error text, severity/impact, issue links, and baseline+confidence. Link side-by-side images at the same viewport; mark intentional visual+changes with the approving PR. Count browser exceptions even if the UI recovered.++Record maintenance corrections separately from product failures. Note CI status+without relabeling it live proof. Do not modify human-authored PR sections.++## Teardown and next baseline++List fixture cleanup, owned-process/port shutdown, and retained artifact locations.+Verify at least one retained evidence file after shutdown. Name the next proposed+baseline, its coverage limits, and who accepted it; never overwrite the prior+accepted baseline automatically. Raw private logs are not baseline screenshots.++External publication requires authorization and an attribution such as:+“This report was generated by an AI agent (OpenHands) on behalf of the requester.”diff --git a/.agents/skills/verify-openhands/scripts/browser-daemon.mjs b/.agents/skills/verify-openhands/scripts/browser-daemon.mjsnew file mode 100755index 0000000000..c89cbc022a--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/browser-daemon.mjs@@ -0,0 +1,1324 @@+#!/usr/bin/env node+// Long-lived browser owner for control-openhands.+//+// One daemon per verification run keeps a single Chromium profile and page+// alive between CLI invocations, records page errors / console errors /+// failed requests continuously, and executes one command per HTTP request.+// It listens on 127.0.0.1 only and requires the per-run token stored in+// <run>/private/browser.json (mode 0600). Start it with+// `control-openhands browser start`, never by hand.++import { createServer } from "node:http";+import { X509Certificate, createHash, randomBytes } from "node:crypto";+import {+ appendFileSync,+ existsSync,+ mkdirSync,+ readFileSync,+ writeFileSync,+} from "node:fs";+import { createRequire } from "node:module";+import { basename, dirname, extname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";+import { redactStorage } from "./lib/redact-storage.mjs";+import { buildLocator, toCss } from "./lib/selectors.mjs";++const here = dirname(fileURLToPath(import.meta.url));+const repoRoot = resolve(here, "../../../..");+const require = createRequire(join(repoRoot, "package.json"));+const { chromium } = require("playwright");++const runDir = process.env.OH_VERIFY_RUN;+if (!runDir) {+ console.error("browser-daemon: OH_VERIFY_RUN is required");+ process.exit(2);+}+const privateDir = join(runDir, "private");+const evidenceDir = join(runDir, "evidence");+const baseUrl = new URL(process.env.OH_VERIFY_BASE_URL);+const eventsPath = join(privateDir, "browser-events.jsonl");+const VIEWPORTS = {+ desktop: { width: 1440, height: 1000 },+ phone: { width: 390, height: 844 },+ narrow: { width: 320, height: 700 },+ tablet: { width: 820, height: 1180 },+};++// Behind a TLS-intercepting proxy, pin its CA certificates by SPKI hash so the+// page can reach external origins the way an ordinary browser would there.+function spkiPins(files) {+ const pins = [];+ for (const file of files.split(/[,:]/).filter(Boolean)) {+ const pem = readFileSync(file, "utf8");+ for (const block of pem.match(+ /-----BEGIN CERTIFICATE-----[\s\S]+?-----END CERTIFICATE-----/g,+ ) ?? []) {+ const der = new X509Certificate(block).publicKey.export({+ type: "spki",+ format: "der",+ });+ pins.push(createHash("sha256").update(der).digest("base64"));+ }+ }+ return pins;+}++const trustPins = process.env.CONTROL_OPENHANDS_TRUST_CA+ ? spkiPins(process.env.CONTROL_OPENHANDS_TRUST_CA)+ : [];+const extraArgs = [+ "--disable-background-networking",+ "--disable-component-update",+ "--no-first-run",+ ...(trustPins.length+ ? [`--ignore-certificate-errors-spki-list=${trustPins.join(",")}`]+ : []),+ ...(process.env.CONTROL_OPENHANDS_BROWSER_ARGS || "")+ .split(/\s+/)+ .filter(Boolean),+];+const executablePath =+ process.env.CONTROL_OPENHANDS_BROWSER || process.env.QA_BROWSER_EXECUTABLE;++const context = await chromium.launchPersistentContext(+ join(privateDir, "browser-profile"),+ {+ headless: process.env.CONTROL_OPENHANDS_HEADED !== "1",+ executablePath: executablePath || undefined,+ viewport: VIEWPORTS.desktop,+ acceptDownloads: true,+ // Opt-in for sandboxes whose TLS interception presents leaf-only chains+ // that SPKI pins cannot match. Never set it in CI.+ ignoreHTTPSErrors:+ process.env.CONTROL_OPENHANDS_IGNORE_HTTPS_ERRORS === "1",+ args: extraArgs,+ },+);++// Copy buttons await navigator.clipboard; grant it so `browser clipboard`+// can read what they wrote.+await context+ .grantPermissions(["clipboard-read", "clipboard-write"], {+ origin: baseUrl.origin,+ })+ .catch(() => {});++// Toasts vanish within seconds: keep a per-document history of the texts that+// appeared in status/alert regions (`browser toasts --history`).+await context.addInitScript(() => {+ window.__ohToasts = [];+ const last = new WeakMap();+ const scan = () => {+ for (const el of document.querySelectorAll(+ '[role="status"], [role="alert"]',+ )) {+ const text = (el.innerText || "").trim();+ if (!text || last.get(el) === text) continue;+ last.set(el, text);+ window.__ohToasts.push({+ ts: new Date().toISOString(),+ role: el.getAttribute("role"),+ text: text.slice(0, 300),+ });+ }+ };+ // Observe the document node itself: hydration can replace <html>.+ new MutationObserver(scan).observe(document, {+ subtree: true,+ childList: true,+ characterData: true,+ });+});++// Instrumentation, not mocking: record media playback so sound features can+// be observed (`browser media`); playback itself still happens.+await context.addInitScript(() => {+ const original = HTMLMediaElement.prototype.play;+ window.__ohMediaPlays = [];+ HTMLMediaElement.prototype.play = function play(...args) {+ window.__ohMediaPlays.push({+ src: this.currentSrc || this.src || "",+ ts: new Date().toISOString(),+ });+ return original.apply(this, args);+ };+});++let dialogPolicy = "dismiss";+// Events survive a daemon restart (`restart`, `browser reset`): reload the+// ones recorded since the last `errors --clear` mark.+const events = [];+if (existsSync(eventsPath)) {+ const lines = readFileSync(eventsPath, "utf8").trim().split("\n");+ let start = 0;+ lines.forEach((line, i) => {+ if (line.includes('"kind":"mark"')) start = i + 1;+ });+ for (const line of lines.slice(start).slice(-3000)) {+ try {+ events.push(JSON.parse(line));+ } catch {+ // A torn line from a killed daemon; skip it.+ }+ }+}+// Request log by origin, for privacy and telemetry checks: which hosts did+// the page talk to? Query values that look like credentials are redacted;+// bodies are never kept.+const requests = [];+const requestEntries = new WeakMap();++function redactQuery(search) {+ if (!search) return "";+ const params = new URLSearchParams(search);+ for (const key of [...params.keys()]) {+ if (/key|token|secret|auth|pass|session|sig/i.test(key))+ params.set(key, "<redacted>");+ }+ const text = params.toString();+ return text ? `?${text.slice(0, 200)}` : "";+}+let markIndex = 0;+let activePage = context.pages()[0] ?? (await context.newPage());++function originOf(url) {+ try {+ return new URL(url).origin;+ } catch {+ return "";+ }+}++function record(kind, page, detail) {+ const entry = {+ ts: new Date().toISOString(),+ kind,+ page: page?.url?.() ?? "",+ appOrigin: false,+ ...detail,+ };+ const subject = entry.url || entry.page;+ entry.appOrigin = originOf(subject) === baseUrl.origin;+ events.push(entry);+ try {+ appendFileSync(eventsPath, `${JSON.stringify(entry)}\n`, { mode: 0o600 });+ } catch {+ // Event persistence is best effort; the in-memory copy still answers.+ }+}++function watch(page) {+ page.on("pageerror", (error) =>+ record("pageerror", page, {+ message: String(error?.message ?? error).slice(0, 2000),+ }),+ );+ page.on("console", (msg) => {+ if (msg.type() === "error" || msg.type() === "warning") {+ record(`console.${msg.type()}`, page, {+ message: msg.text().slice(0, 2000),+ url: msg.location()?.url || "",+ });+ }+ });+ page.on("request", (request) => {+ let origin = "";+ let path = "";+ let query = "";+ try {+ const url = new URL(request.url());+ origin = url.origin;+ path = url.pathname.slice(0, 120);+ query = redactQuery(url.search);+ } catch {+ return;+ }+ if (!origin.startsWith("http") && !origin.startsWith("ws")) return;+ const entry = {+ ts: new Date().toISOString(),+ origin,+ path,+ query: query || undefined,+ method: request.method(),+ type: request.resourceType(),+ app: origin === baseUrl.origin,+ };+ requestEntries.set(request, entry);+ requests.push(entry);+ if (requests.length > 5000) requests.splice(0, 1000);+ });+ page.on("requestfailed", (request) => {+ const failure = request.failure()?.errorText ?? "failed";+ if (failure === "net::ERR_ABORTED") return;+ record("requestfailed", page, {+ url: request.url().slice(0, 500),+ method: request.method(),+ message: failure,+ });+ });+ page.on("response", (response) => {+ const entry = requestEntries.get(response.request());+ if (entry) entry.status = response.status();+ if (response.status() >= 400) {+ record("http-error", page, {+ url: response.url().slice(0, 500),+ method: response.request().method(),+ status: response.status(),+ });+ }+ });+ page.on("dialog", async (dialog) => {+ record("dialog", page, {+ message: `${dialog.type()}: ${dialog.message()}`.slice(0, 500),+ policy: dialogPolicy,+ });+ if (dialogPolicy === "accept") await dialog.accept();+ else await dialog.dismiss();+ });+ page.on("download", async (download) => {+ const dir = join(privateDir, "downloads");+ mkdirSync(dir, { recursive: true, mode: 0o700 });+ const target = join(+ dir,+ `${Date.now()}-${download.suggestedFilename().replace(/[^\w.-]+/g, "_")}`,+ );+ try {+ await download.saveAs(target);+ record("download", page, { path: target });+ } catch (error) {+ record("download", page, { message: String(error) });+ }+ });+}++for (const page of context.pages()) watch(page);+context.on("page", (page) => {+ watch(page);+ record("page-opened", page, { url: page.url() });+});++function locate(selector) {+ return buildLocator(activePage, selector);+}++function evidencePath(feature, name, ext) {+ const safeFeature = String(feature || "_misc").replace(/[^\w.-]+/g, "_");+ const safeName = String(name || `capture-${Date.now()}`).replace(+ /[^\w.-]+/g,+ "_",+ );+ const dir = join(evidenceDir, safeFeature);+ mkdirSync(dir, { recursive: true });+ // Evidence is never replaced: a repeated name gets -2, -3, ... and the+ // caller reports the path it actually wrote.+ let path = join(dir, `${safeName}${ext}`);+ for (let n = 2; existsSync(path); n += 1)+ path = join(dir, `${safeName}-${n}${ext}`);+ return path;+}++function assertAppUrl(target, allowExternal) {+ const url = new URL(target, baseUrl);+ if (!allowExternal && url.origin !== baseUrl.origin) {+ throw new Error(+ `Refusing to navigate outside this run (${baseUrl.origin}); pass --allow-external for a deliberate external check`,+ );+ }+ return url.toString();+}++async function failureShot() {+ try {+ const path = evidencePath("_failures", `${Date.now()}`, ".png");+ await activePage.screenshot({ path });+ return path;+ } catch {+ return undefined;+ }+}++async function collectTestids(scopeSelector, includeHidden) {+ const scope = scopeSelector+ ? locate(scopeSelector)+ : activePage.locator(":root");+ return scope.first().evaluate((root, wantHidden) => {+ const seen = new Map();+ const nodes = [root, ...root.querySelectorAll("[data-testid]")];+ for (const el of nodes) {+ const id = el.getAttribute && el.getAttribute("data-testid");+ if (!id) continue;+ const rect = el.getBoundingClientRect();+ const style = getComputedStyle(el);+ const visible =+ rect.width > 0 &&+ rect.height > 0 &&+ style.visibility !== "hidden" &&+ style.display !== "none";+ // Carousel slides and drawers parked beside the viewport are rendered+ // but not on screen; content below the fold still counts (scrollable).+ let offscreen = rect.right <= 0 || rect.left >= window.innerWidth;+ // Also off screen when an overflow-clipping ancestor (a slide rail,+ // a collapsed drawer) hides it entirely.+ for (let a = el.parentElement; a && !offscreen; a = a.parentElement) {+ const ov = getComputedStyle(a);+ if (/hidden|clip/.test(ov.overflowX + ov.overflowY)) {+ const r = a.getBoundingClientRect();+ offscreen =+ rect.right <= r.left ||+ rect.left >= r.right ||+ rect.bottom <= r.top ||+ rect.top >= r.bottom;+ }+ }+ if ((!visible || offscreen) && !wantHidden) continue;+ const label =+ el.getAttribute("aria-label") ||+ el.getAttribute("title") ||+ el.getAttribute("placeholder") ||+ (el.innerText || (el.type === "password" ? "" : el.value) || "")+ .trim()+ .split("\n")[0];+ const entry = seen.get(id) || {+ testid: id,+ tag: el.tagName.toLowerCase(),+ role: el.getAttribute("role") || undefined,+ label: (label || "").slice(0, 60),+ count: 0,+ domCount: document.querySelectorAll(`[data-testid="${CSS.escape(id)}"]`)+ .length,+ visible,+ };+ entry.count += 1;+ seen.set(id, entry);+ }+ return [...seen.values()];+ }, includeHidden);+}++const handlers = {+ async ping() {+ return { url: activePage.url(), pages: context.pages().length };+ },+ async goto({ target, allowExternal }) {+ const url = assertAppUrl(target ?? "/", allowExternal);+ const response = await activePage.goto(url, {+ waitUntil: "domcontentloaded",+ });+ await activePage+ .waitForLoadState("networkidle", { timeout: 10_000 })+ .catch(() => {});+ return { url: activePage.url(), status: response?.status() };+ },+ async reload() {+ await activePage.reload({ waitUntil: "domcontentloaded" });+ await activePage+ .waitForLoadState("networkidle", { timeout: 10_000 })+ .catch(() => {});+ return { url: activePage.url() };+ },+ async back() {+ await activePage.goBack({ waitUntil: "domcontentloaded" });+ return { url: activePage.url() };+ },+ async forward() {+ await activePage.goForward({ waitUntil: "domcontentloaded" });+ return { url: activePage.url() };+ },+ async url() {+ return {+ url: activePage.url(),+ title: await activePage.title(),+ viewport: activePage.viewportSize(),+ };+ },+ async click({+ selector,+ timeout,+ force,+ button,+ modifiers,+ position,+ expectUrl,+ expectNewUrl,+ hoverFirst,+ observe,+ observeMs,+ }) {+ const before = activePage.url();+ // Record transient states (labels such as "Saving...", skeletons) of the+ // observed elements while the click's effects play out: an in-page+ // MutationObserver when the selector is plain CSS/testid, else polling.+ let observer;+ let poller;+ const css = observe ? toCss(observe) : null;+ if (css) {+ observer = await activePage+ .evaluateHandle((sel) => {+ document.querySelectorAll(sel);+ const log = [];+ const snap = () => {+ const els = [...document.querySelectorAll(sel)];+ // Text plus disabled/busy markers, so pending states show up.+ const entry = els.length+ ? els.map(+ (e) =>+ (e.innerText || e.value || "").trim().slice(0, 80) ++ (e.disabled || e.getAttribute("aria-disabled") === "true"+ ? " [disabled]"+ : "") ++ (e.getAttribute("aria-busy") === "true" ? " [busy]" : ""),+ )+ : ["<absent>"];+ const key = JSON.stringify(entry);+ if (log[log.length - 1]?.key !== key) {+ log.push({ key, t: Math.round(performance.now()) });+ }+ };+ snap();+ const mo = new MutationObserver(snap);+ mo.observe(document.body, {+ subtree: true,+ childList: true,+ characterData: true,+ attributes: true,+ });+ return { log, mo };+ }, css)+ .catch(() => undefined);+ }+ if (observe && !observer) {+ const log = [];+ const t0 = Date.now();+ poller = { log, running: true };+ poller.done = (async () => {+ while (poller.running) {+ let entry;+ try {+ const loc = locate(observe);+ entry = (await loc.count())+ ? (await loc.allInnerTexts()).map((s) => s.trim().slice(0, 80))+ : ["<absent>"];+ } catch {+ entry = ["<unreadable>"];+ }+ const key = JSON.stringify(entry);+ if (log[log.length - 1]?.key !== key)+ log.push({ key, t: Date.now() - t0 });+ await new Promise((r) => setTimeout(r, 20));+ }+ })();+ }+ if (hoverFirst) {+ // Hover-driven controls re-render on pointerenter and swallow a click+ // that moves and presses at once.+ await locate(selector).hover({ timeout });+ await activePage.waitForTimeout(Number(hoverFirst) || 150);+ }+ await locate(selector).click({+ timeout,+ force,+ button,+ modifiers,+ position,+ });+ if (expectUrl) {+ await activePage.waitForURL(new RegExp(expectUrl), { timeout });+ }+ if (expectNewUrl) {+ const re = new RegExp(expectNewUrl);+ await activePage.waitForURL(+ (u) => u.toString() !== before && re.test(u.toString()),+ { timeout },+ );+ }+ let observed;+ if (observer || poller) {+ await activePage.waitForTimeout(Number(observeMs ?? 3000));+ }+ if (observer) {+ observed = await observer.evaluate(({ log, mo }) => {+ mo.disconnect();+ const start = log[0]?.t ?? 0;+ return log.map((l) => ({ ms: l.t - start, state: JSON.parse(l.key) }));+ });+ } else if (poller) {+ poller.running = false;+ await poller.done;+ observed = poller.log.map((l) => ({+ ms: l.t,+ state: JSON.parse(l.key),+ }));+ }+ return {+ url: activePage.url(),+ observed,+ observedBy: observe ? (observer ? "mutation" : "poll-20ms") : undefined,+ };+ },+ async dblclick({ selector, timeout, modifiers }) {+ await locate(selector).dblclick({ timeout, modifiers });+ return { url: activePage.url() };+ },+ async "mouse-click"({ x, y, button }) {+ await activePage.mouse.click(Number(x), Number(y), { button });+ return { url: activePage.url() };+ },+ async hover({ selector, timeout }) {+ await locate(selector).hover({ timeout });+ return {};+ },+ async tooltip({ selector, timeout }) {+ // Tooltips often ignore the first hover after a navigation: move away,+ // hover, then wait for role=tooltip.+ await activePage.mouse.move(0, 0);+ const target = locate(selector).first();+ await target.hover({ timeout });+ const tip = activePage.getByRole("tooltip").first();+ try {+ await tip.waitFor({ state: "visible", timeout: timeout ?? 5000 });+ return { source: "role=tooltip", text: (await tip.innerText()).trim() };+ } catch (error) {+ // Native title tooltips are not in the DOM; report the attribute.+ const title = await target.evaluate(+ (el) =>+ el.getAttribute("title") ||+ el.querySelector("[title]")?.getAttribute("title") ||+ el.closest("[title]")?.getAttribute("title") ||+ null,+ );+ if (title) return { source: "title attribute", text: title };+ throw error;+ }+ },+ async focus({ selector, timeout }) {+ await locate(selector).focus({ timeout });+ return {};+ },+ async fill({ selector, value, timeout }) {+ await locate(selector).fill(value, { timeout });+ return { length: value.length };+ },+ async type({ selector, value, timeout, delay }) {+ const loc = locate(selector);+ await loc.click({ timeout });+ await loc.pressSequentially(value, { delay: delay ?? 10 });+ return { length: value.length };+ },+ async press({ key, selector, timeout }) {+ if (selector) await locate(selector).press(key, { timeout });+ else await activePage.keyboard.press(key);+ return { url: activePage.url() };+ },+ async check({ selector, timeout }) {+ await locate(selector).check({ timeout });+ return { checked: true };+ },+ async uncheck({ selector, timeout }) {+ await locate(selector).uncheck({ timeout });+ return { checked: false };+ },+ async select({ selector, value, timeout }) {+ const selected = await locate(selector).selectOption(value, { timeout });+ return { selected };+ },+ async upload({ selector, files, timeout }) {+ await locate(selector).setInputFiles(files, { timeout });+ return { files };+ },+ async scroll({ selector, by, x, timeout }) {+ if (selector && x !== undefined) {+ // Horizontal rails: scroll the nearest horizontally scrollable box.+ return locate(selector)+ .first()+ .evaluate((el, dx) => {+ let node = el;+ while (+ node &&+ !(+ node.scrollWidth > node.clientWidth &&+ /auto|scroll/.test(getComputedStyle(node).overflowX)+ )+ ) {+ node = node.parentElement;+ }+ const target = node || document.scrollingElement;+ target.scrollBy(dx, 0);+ return {+ scrolled:+ target === document.scrollingElement ? "page" : "container",+ scrollLeft: Math.round(target.scrollLeft),+ scrollWidth: target.scrollWidth,+ };+ }, Number(x));+ }+ if (selector && by !== undefined) {+ // Scroll the element's nearest scrollable container (settings and+ // panels scroll inside a container, not the window).+ return locate(selector)+ .first()+ .evaluate((el, dy) => {+ let node = el;+ while (+ node &&+ !(+ node.scrollHeight > node.clientHeight &&+ /auto|scroll/.test(getComputedStyle(node).overflowY)+ )+ ) {+ node = node.parentElement;+ }+ const target = node || document.scrollingElement;+ target.scrollBy(0, dy);+ return {+ scrolled:+ target === document.scrollingElement ? "page" : "container",+ scrollTop: Math.round(target.scrollTop),+ scrollHeight: target.scrollHeight,+ };+ }, Number(by));+ }+ if (selector) {+ await locate(selector).scrollIntoViewIfNeeded({ timeout });+ return { scrolled: "into-view" };+ }+ await activePage.mouse.wheel(0, Number(by ?? 600));+ return { scrolled: "wheel at mouse position" };+ },+ async wait({ selector, state, timeout }) {+ await locate(selector)+ .first()+ .waitFor({ state: state ?? "visible", timeout });+ return { state: state ?? "visible" };+ },+ async "wait-url"({ pattern, timeout }) {+ await activePage.waitForURL(new RegExp(pattern), { timeout });+ return { url: activePage.url() };+ },+ async "wait-text"({ text, timeout }) {+ await activePage+ .getByText(text)+ .first()+ .waitFor({ state: "visible", timeout });+ return { text };+ },+ async text({ selector, timeout }) {+ const loc = locate(selector);+ const count = await loc.count();+ if (count > 1) {+ return { count, texts: (await loc.allInnerTexts()).map((t) => t.trim()) };+ }+ return { text: (await loc.innerText({ timeout })).trim() };+ },+ async value({ selector, timeout, reveal }) {+ const loc = locate(selector);+ const value = await loc.inputValue({ timeout });+ const type = await loc+ .first()+ .getAttribute("type")+ .catch(() => null);+ if (type === "password" && !reveal)+ return {+ value: value ? "********" : "",+ length: value.length,+ masked: true,+ };+ return { value };+ },+ async attr({ selector, name, timeout }) {+ return { [name]: await locate(selector).getAttribute(name, { timeout }) };+ },+ async count({ selector }) {+ return { count: await locate(selector).count() };+ },+ async visible({ selector }) {+ return { visible: await locate(selector).first().isVisible() };+ },+ async enabled({ selector, timeout }) {+ return { enabled: await locate(selector).isEnabled({ timeout }) };+ },+ async bbox({ selector, timeout }) {+ const loc = locate(selector);+ const box = await loc.boundingBox({ timeout });+ const viewport = activePage.viewportSize();+ const overflow = await loc.evaluate((el) => ({+ scrollWidth: el.scrollWidth,+ clientWidth: el.clientWidth,+ scrollHeight: el.scrollHeight,+ clientHeight: el.clientHeight,+ }));+ const docOverflowX = await activePage.evaluate(+ () => document.documentElement.scrollWidth > window.innerWidth,+ );+ return {+ box,+ viewport,+ insideViewport: Boolean(+ box &&+ viewport &&+ box.x >= 0 &&+ box.y >= 0 &&+ box.x + box.width <= viewport.width + 0.5 &&+ box.y + box.height <= viewport.height + 0.5,+ ),+ overflow,+ pageHorizontalOverflow: docOverflowX,+ };+ },+ async snapshot({ selector, maxLines, feature, name }) {+ const loc = selector+ ? locate(selector).first()+ : activePage.locator("body");+ // ARIA snapshots include textbox values: mask what password fields hold+ // so keys never land in output or saved evidence.+ const secrets = await activePage.evaluate(() =>+ [...document.querySelectorAll('input[type="password"]')]+ .map((i) => i.value)+ .filter((v) => v && v.length >= 4),+ );+ let tree = await loc.ariaSnapshot();+ for (const s of secrets) tree = tree.split(s).join("********");+ let saved;+ if (feature || name) {+ saved = evidencePath(+ feature,+ String(name ?? "").replace(/(\.aria)?\.txt$/, ""),+ ".aria.txt",+ );+ writeFileSync(saved, `${activePage.url()}\n${tree}\n`);+ }+ const lines = tree.split("\n");+ const limit = Number(maxLines ?? 120);+ return {+ url: activePage.url(),+ lines: lines.length,+ truncated: lines.length > limit,+ snapshot: lines.slice(0, limit).join("\n"),+ saved,+ };+ },+ async testids({ selector, includeHidden }) {+ const items = await collectTestids(selector, Boolean(includeHidden));+ const ambiguous = items.filter((i) => i.domCount > 1).map((i) => i.testid);+ return {+ url: activePage.url(),+ count: items.length,+ testids: items,+ hint: ambiguous.length+ ? `Several DOM nodes share ${ambiguous.slice(0, 5).join(", ")} (domCount > 1): scope with ' >> ' or add '>> visible'.`+ : undefined,+ };+ },+ async screenshot({ feature, name, selector, fullPage }) {+ const path = evidencePath(feature, name, ".png");+ if (selector) await locate(selector).first().screenshot({ path });+ else await activePage.screenshot({ path, fullPage: Boolean(fullPage) });+ return { path, url: activePage.url(), viewport: activePage.viewportSize() };+ },+ async viewport({ size }) {+ const preset = VIEWPORTS[size];+ let next = preset;+ if (!next) {+ const match = /^(\d+)x(\d+)$/.exec(size ?? "");+ if (!match)+ throw new Error("viewport needs desktop|phone|narrow|tablet|WxH");+ next = { width: Number(match[1]), height: Number(match[2]) };+ }+ await activePage.setViewportSize(next);+ return { viewport: next };+ },+ async errors({ clear, all, appOnly, noWarnings }) {+ const slice = all ? events : events.slice(markIndex);+ const relevant = slice.filter(+ (e) =>+ !["page-opened", "download", "dialog", "mark"].includes(e.kind) &&+ !(noWarnings && e.kind === "console.warning"),+ );+ const filtered = appOnly ? relevant.filter((e) => e.appOrigin) : relevant;+ const summary = {};+ for (const e of filtered) {+ const key = `${e.appOrigin ? "app" : "external"}:${e.kind}`;+ summary[key] = (summary[key] ?? 0) + 1;+ }+ const result = {+ since: all ? "daemon start" : "last clear",+ summary,+ pageErrors: filtered.filter((e) => e.kind === "pageerror").length,+ appErrors: filtered.filter(+ (e) => e.appOrigin && e.kind !== "console.warning",+ ).length,+ warnings: filtered.filter((e) => e.kind === "console.warning").length,+ events: filtered.slice(-40),+ };+ if (clear) {+ markIndex = events.length;+ try {+ appendFileSync(+ eventsPath,+ `${JSON.stringify({ ts: new Date().toISOString(), kind: "mark" })}\n`,+ );+ } catch {+ // Best effort, as for record().+ }+ }+ return result;+ },+ async events({ kinds, last }) {+ const wanted = kinds ? kinds.split(",") : null;+ const list = events.filter((e) => !wanted || wanted.includes(e.kind));+ return { events: list.slice(-Number(last ?? 20)) };+ },+ async eval({ expression }) {+ // Inspection only: the CLI documents that state must not be mutated here.+ const value = await activePage.evaluate((source) => {+ // eslint-disable-next-line no-new-func+ const result = new Function(`return (${source});`)();+ return result instanceof Promise ? result : Promise.resolve(result);+ }, expression);+ return { value };+ },+ async "wait-tab"({ pattern, timeout }) {+ // window.open pages appear a moment after the click.+ const re = new RegExp(pattern);+ const deadline = Date.now() + (timeout ?? 10_000);+ while (Date.now() < deadline) {+ const pages = context.pages();+ const index = pages.findIndex((p) => re.test(p.url()));+ if (index >= 0) return { index, url: pages[index].url() };+ await new Promise((r) => setTimeout(r, 100));+ }+ const open = context.pages().map((p, i) => `${i}: ${p.url()}`);+ throw new Error(+ `No tab matching ${pattern} within the timeout. Open tabs: ${open.join(" | ")} (a pop-up that stays about:blank could not load its URL)`,+ );+ },+ async tabs() {+ return {+ active: context.pages().indexOf(activePage),+ pages: await Promise.all(+ context.pages().map(async (p, index) => ({+ index,+ url: p.url(),+ title: await p.title().catch(() => ""),+ })),+ ),+ };+ },+ async tab({ index }) {+ const page = context.pages()[Number(index)];+ if (!page) throw new Error(`No tab ${index}`);+ activePage = page;+ await page.bringToFront();+ return { active: Number(index), url: page.url() };+ },+ async "close-tab"({ index }) {+ const pages = context.pages();+ const page = pages[Number(index)];+ if (!page) throw new Error(`No tab ${index}`);+ if (pages.length === 1) throw new Error("Refusing to close the last tab");+ await page.close();+ if (page === activePage) activePage = context.pages()[0];+ return {+ closed: Number(index),+ active: context.pages().indexOf(activePage),+ };+ },+ async dialogs({ policy }) {+ if (policy) {+ if (!["accept", "dismiss"].includes(policy)) {+ throw new Error("dialog policy must be accept or dismiss");+ }+ dialogPolicy = policy;+ }+ return {+ policy: dialogPolicy,+ dialogs: events.filter((e) => e.kind === "dialog").slice(-10),+ };+ },+ async "pick-folder"({ path: want, timeout }) {+ // The Open Workspace folder browser has no path field; walk it with+ // folder-browser-up / folder-browser-entry-<name> until PATH is current.+ const label = activePage.getByTestId("folder-browser-current-path");+ const current = async () => {+ const text = (await label.innerText()).trim();+ return text.length > 1 ? text.replace(/\/+$/, "") : text;+ };+ await label.waitFor({ timeout });+ const deadline = Date.now() + (timeout ?? 30_000);+ let cur = await current();+ while (!cur && Date.now() < deadline) {+ await activePage.waitForTimeout(100);+ cur = await current();+ }+ const steps = [];+ for (let i = 0; i < 60; i += 1) {+ if (cur === want) return { path: cur, steps };+ const prefix = cur === "/" ? "/" : `${cur}/`;+ if (want.startsWith(prefix)) {+ const seg = want.slice(prefix.length).split("/")[0];+ await activePage+ .getByTestId(`folder-browser-entry-${seg}`)+ .click({ timeout: 15_000 });+ steps.push(seg);+ } else {+ await activePage.getByTestId("folder-browser-up").click({+ timeout: 15_000,+ });+ steps.push("..");+ }+ const before = cur;+ const t0 = Date.now();+ while ((cur = await current()) === before && Date.now() - t0 < 10_000) {+ await activePage.waitForTimeout(100);+ }+ if (cur === before) throw new Error(`Folder browser stayed at ${cur}`);+ }+ throw new Error(`Could not reach ${want}; stopped at ${cur}`);+ },+ async downloads() {+ return {+ downloads: events.filter((e) => e.kind === "download").slice(-10),+ };+ },+ async storage({ keysOnly, session }) {+ // Lists storage keys (values only when explicitly requested) so that+ // persisted UI state can be checked without printing secrets by default.+ const data = await activePage.evaluate((useSession) => {+ const store = useSession ? window.sessionStorage : window.localStorage;+ return Object.fromEntries(+ Object.keys(store).map((k) => [k, store.getItem(k)]),+ );+ }, Boolean(session));+ const area = session ? "sessionStorage" : "localStorage";+ if (keysOnly !== false) return { area, keys: Object.keys(data).sort() };+ return { area, storage: redactStorage(data) };+ },+ async network({ clear, external, last, filter }) {+ const re = filter ? new RegExp(filter) : null;+ const list = requests.filter(+ (r) =>+ (!external || !r.app) &&+ (!re || re.test(`${r.origin}${r.path}${r.query ?? ""}`)),+ );+ const byOrigin = {};+ for (const r of list) byOrigin[r.origin] = (byOrigin[r.origin] ?? 0) + 1;+ const result = {+ total: list.length,+ byOrigin,+ recent: list.slice(-Number(last ?? 15)),+ };+ if (clear) requests.length = 0;+ return result;+ },+ async toasts({ history, clear }) {+ const toasts = await activePage.evaluate(() =>+ [...document.querySelectorAll('[role="status"], [role="alert"]')]+ .filter((el) => {+ const r = el.getBoundingClientRect();+ return r.width > 0 && r.height > 0 && el.innerText.trim();+ })+ .map((el) => ({+ role: el.getAttribute("role"),+ text: el.innerText.trim().slice(0, 300),+ links: [...el.querySelectorAll("a[href]")].map((a) => ({+ text: a.innerText.trim(),+ href: a.getAttribute("href"),+ })),+ })),+ );+ if (!history && !clear) return { toasts };+ const seen = await activePage.evaluate((reset) => {+ const list = window.__ohToasts ?? [];+ if (reset) window.__ohToasts = [];+ return list;+ }, Boolean(clear));+ return { toasts, history: seen };+ },+ async clipboard({ write }) {+ if (write !== undefined) {+ await activePage.evaluate((t) => navigator.clipboard.writeText(t), write);+ return { written: write.length };+ }+ const text = await activePage.evaluate(() =>+ Promise.race([+ navigator.clipboard.readText(),+ new Promise((_, reject) =>+ setTimeout(() => reject(new Error("clipboard read timed out")), 5000),+ ),+ ]),+ );+ return { text };+ },+ async drag({ source, target, by, steps, position }) {+ const from = locate(source).first();+ if (target) {+ // HTML5 drag and drop with stepped pointer moves: React handlers that+ // set state in dragover need intermediate events before the drop.+ const from0 = await from.boundingBox();+ const box = await locate(target).first().boundingBox();+ if (!from0 || !box) throw new Error("source or target has no box");+ const tx = box.x + box.width / 2;+ const ty =+ position === "before"+ ? box.y + 3+ : position === "after"+ ? box.y + box.height - 3+ : box.y + box.height / 2;+ await activePage.mouse.move(+ from0.x + from0.width / 2,+ from0.y + from0.height / 2,+ );+ await activePage.mouse.down();+ await activePage.mouse.move(tx, ty, { steps: Number(steps ?? 20) });+ await activePage.waitForTimeout(150);+ await activePage.mouse.move(tx, ty + 1);+ await activePage.mouse.up();+ return { dragged: source, to: target, position: position ?? "center" };+ }+ // Pointer drag by an offset (resize grips, dividers).+ const box = await from.boundingBox();+ if (!box) throw new Error(`${source} has no box to drag`);+ const [dx, dy] = String(by ?? "0,0")+ .split(",")+ .map(Number);+ const x = box.x + box.width / 2;+ const y = box.y + box.height / 2;+ await activePage.mouse.move(x, y);+ await activePage.mouse.down();+ await activePage.mouse.move(x + dx, y + (dy || 0), {+ steps: Number(steps ?? 12),+ });+ await activePage.mouse.up();+ return { dragged: source, by: { dx, dy: dy || 0 } };+ },+ async "upload-via"({ trigger, files, timeout }) {+ // The real file chooser opened by a menu item or button.+ const [chooser] = await Promise.all([+ activePage.waitForEvent("filechooser", { timeout: timeout ?? 15_000 }),+ locate(trigger).first().click({ timeout }),+ ]);+ await chooser.setFiles(files);+ return { files, multiple: chooser.isMultiple() };+ },+ async "drop-files"({ selector, files, stage }) {+ // Files dragged in from the desktop: dragenter, dragover, drop with a+ // DataTransfer holding the files (--stage enter|over stops early).+ const MIME = {+ ".png": "image/png",+ ".jpg": "image/jpeg",+ ".jpeg": "image/jpeg",+ ".gif": "image/gif",+ ".txt": "text/plain",+ ".md": "text/markdown",+ ".json": "application/json",+ ".pdf": "application/pdf",+ };+ const payload = files.map((f) => ({+ name: basename(f),+ type: MIME[extname(f).toLowerCase()] ?? "application/octet-stream",+ b64: readFileSync(f).toString("base64"),+ }));+ const dataTransfer = await activePage.evaluateHandle((items) => {+ const dt = new DataTransfer();+ for (const it of items) {+ const bin = atob(it.b64);+ const bytes = new Uint8Array(bin.length);+ for (let i = 0; i < bin.length; i += 1) bytes[i] = bin.charCodeAt(i);+ dt.items.add(new File([bytes], it.name, { type: it.type }));+ }+ return dt;+ }, payload);+ const loc = locate(selector).first();+ const order = ["dragenter", "dragover", "drop"];+ const last = { enter: 0, over: 1 }[stage] ?? 2;+ for (const type of order.slice(0, last + 1)) {+ await loc.dispatchEvent(type, { dataTransfer });+ }+ return { files: payload.map((p) => p.name), stage: order[last] };+ },+ async paste({ selector, text, files }) {+ // A paste event carrying text or files, as the browser delivers it.+ const payload = (files ?? []).map((f) => ({+ name: basename(f),+ type: /\.png$/i.test(f)+ ? "image/png"+ : /\.jpe?g$/i.test(f)+ ? "image/jpeg"+ : "application/octet-stream",+ b64: readFileSync(f).toString("base64"),+ }));+ const loc = locate(selector).first();+ await loc.focus();+ const delivered = await loc.evaluate(+ (el, { text: t, items }) => {+ const dt = new DataTransfer();+ if (t !== undefined && t !== null) dt.setData("text/plain", t);+ for (const it of items) {+ const bin = atob(it.b64);+ const bytes = new Uint8Array(bin.length);+ for (let i = 0; i < bin.length; i += 1) bytes[i] = bin.charCodeAt(i);+ dt.items.add(new File([bytes], it.name, { type: it.type }));+ }+ const event = new ClipboardEvent("paste", {+ clipboardData: dt,+ bubbles: true,+ cancelable: true,+ });+ el.dispatchEvent(event);+ return { defaultPrevented: event.defaultPrevented };+ },+ { text, items: payload },+ );+ return {+ pasted: { text: text?.length, files: payload.map((p) => p.name) },+ ...delivered,+ };+ },+ async choose({ selector, option, timeout }) {+ // Autocomplete/combobox: open, filter by the label, click the option.+ const input = locate(selector).first();+ await input.click({ timeout });+ const opt = activePage.getByRole("option", { name: option, exact: true });+ await input.fill(option).catch(() => {});+ try {+ await opt.first().waitFor({ state: "visible", timeout: 3000 });+ } catch {+ await input.fill("").catch(() => {});+ await input.press("ArrowDown").catch(() => {});+ await opt+ .first()+ .waitFor({ state: "visible", timeout: timeout ?? 10_000 });+ }+ await opt.first().click({ timeout });+ return {+ chosen: option,+ value: await input.inputValue().catch(() => undefined),+ };+ },+ async media({ clear }) {+ const plays = await activePage.evaluate((reset) => {+ const list = window.__ohMediaPlays ?? [];+ if (reset) window.__ohMediaPlays = [];+ return list;+ }, Boolean(clear));+ return { plays };+ },+ async uiprobe({ target, timeout }) {+ // Read-only health probe in a throwaway tab: the driving tab keeps its URL.+ const probe = await context.newPage();+ const errors = [];+ probe.on("pageerror", (e) => errors.push(String(e?.message ?? e)));+ try {+ await probe.goto(assertAppUrl(target ?? "/", false), {+ waitUntil: "domcontentloaded",+ timeout,+ });+ await probe+ .waitForLoadState("networkidle", { timeout: 15_000 })+ .catch(() => {});+ await probe.waitForTimeout(1500);+ const ids = await probe.evaluate(() =>+ [...document.querySelectorAll("[data-testid]")].map((e) =>+ e.getAttribute("data-testid"),+ ),+ );+ const markers = [+ "api-key-entry-screen",+ "first-run-onboarding-screen",+ "onboarding-modal",+ "telemetry-consent-form",+ "home-chat-launcher",+ "interactive-chat-box",+ "loading-spinner",+ ].filter((m) => ids.includes(m));+ return {+ url: probe.url(),+ title: await probe.title(),+ testids: ids.length,+ markers,+ pageErrors: errors,+ };+ } finally {+ await probe.close();+ }+ },+ async shutdown() {+ setTimeout(async () => {+ await context.close().catch(() => {});+ process.exit(0);+ }, 50);+ return { stopping: true };+ },+};++const token = randomBytes(24).toString("hex");+const server = createServer(async (req, res) => {+ if (req.method !== "POST" || req.headers["x-control-token"] !== token) {+ res.writeHead(403).end();+ return;+ }+ let body = "";+ for await (const chunk of req) body += chunk;+ let payload;+ try {+ payload = JSON.parse(body || "{}");+ } catch {+ res.writeHead(400).end(JSON.stringify({ ok: false, error: "bad json" }));+ return;+ }+ const handler = handlers[payload.cmd];+ res.setHeader("content-type", "application/json");+ if (!handler) {+ res.end(+ JSON.stringify({ ok: false, error: `unknown command ${payload.cmd}` }),+ );+ return;+ }+ try {+ const result = await handler(payload.args ?? {});+ res.end(JSON.stringify({ ok: true, ...result }));+ } catch (error) {+ const message = String(error?.message ?? error)+ .split("\n")+ .slice(0, 14)+ .join("\n");+ let hint;+ if (/strict mode violation/.test(message)) {+ hint =+ 'Several elements match. Scope it (`testid=dialog >> role=button[name="Save"]`) or add `>> nth=0` after checking `browser testids`.';+ } else if (/Timeout/.test(message)) {+ hint =+ "Not found in time. Inspect the current page with `browser snapshot` or `browser testids`, then retry; check `browser errors` for crashes.";+ }+ res.end(+ JSON.stringify({+ ok: false,+ error: message,+ hint,+ url: activePage.url(),+ failureScreenshot: await failureShot(),+ }),+ );+ }+});++server.listen(0, "127.0.0.1", () => {+ const { port } = server.address();+ writeFileSync(+ join(privateDir, "browser.json"),+ JSON.stringify({+ pid: process.pid,+ port,+ token,+ startedAt: new Date().toISOString(),+ }),+ { mode: 0o600 },+ );+ console.log(`browser-daemon ready on 127.0.0.1:${port}`);+});++for (const signal of ["SIGTERM", "SIGINT"]) {+ process.on(signal, async () => {+ await context.close().catch(() => {});+ process.exit(0);+ });+}diff --git a/.agents/skills/verify-openhands/scripts/control-openhands b/.agents/skills/verify-openhands/scripts/control-openhandsnew file mode 100755index 0000000000..c69af537d5--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/control-openhands@@ -0,0 +1,4 @@+#!/bin/sh+# Thin wrapper so recipes can call `control-openhands ...` once this directory+# is on PATH. All logic lives in control-openhands.mjs.+exec node "$(dirname "$0")/control-openhands.mjs" "$@"diff --git a/.agents/skills/verify-openhands/scripts/control-openhands.mjs b/.agents/skills/verify-openhands/scripts/control-openhands.mjsnew file mode 100755index 0000000000..a8a57a99ab--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/control-openhands.mjs@@ -0,0 +1,3619 @@+#!/usr/bin/env node+// control-openhands: drive a real, isolated Agent Canvas stack the way a user+// does, so every feature-map recipe is a command an agent can rerun.+//+// Run `control-openhands --help` or `control-openhands <command> --help`.++import { spawn, spawnSync, execFileSync } from "node:child_process";+import { randomBytes } from "node:crypto";+import {+ appendFileSync,+ existsSync,+ lstatSync,+ mkdirSync,+ openSync,+ readFileSync,+ readdirSync,+ realpathSync,+ rmSync,+ symlinkSync,+ unlinkSync,+ writeFileSync,+} from "node:fs";+import { createConnection } from "node:net";+import { freemem, tmpdir } from "node:os";+import { basename, dirname, join, relative, resolve } from "node:path";+import { fileURLToPath } from "node:url";+import { deflateSync, gunzipSync } from "node:zlib";+import { buildIdentity } from "./lib/build-id.mjs";+import {+ editorOffset,+ launcherEnvFor,+ portsAfterRestart,+ runPorts,+} from "./lib/launcher-env.mjs";+import { routePattern } from "./lib/route-pattern.mjs";++const here = dirname(fileURLToPath(import.meta.url));+const skillDir = resolve(here, "..");+const repoRoot = resolve(here, "../../../..");+const mapDir = join(skillDir, "references", "feature-map");+const verifyHome = resolve(+ process.env.OH_VERIFY_HOME || join(tmpdir(), "openhands-verify"),+);++// ---------------------------------------------------------------------------+// Output helpers. Every command prints one JSON object on stdout; exit code 0+// means success, 1 an action/assertion failure, 2 bad usage, 3 an environment+// or doctor failure.+// ---------------------------------------------------------------------------+class CliError extends Error {+ constructor(message, { code = 1, hint, extra } = {}) {+ super(message);+ this.code = code;+ this.hint = hint;+ this.extra = extra;+ }+}++function out(value) {+ process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);+}++function usage(message, example) {+ throw new CliError(message, { code: 2, hint: example });+}++function parseArgs(argv) {+ const positional = [];+ const flags = {};+ for (let i = 0; i < argv.length; i += 1) {+ const arg = argv[i];+ if (arg === "--") {+ positional.push(...argv.slice(i + 1));+ break;+ }+ if (arg.startsWith("--")) {+ const eq = arg.indexOf("=");+ if (eq > 0) {+ flags[arg.slice(2, eq)] = arg.slice(eq + 1);+ } else {+ const key = arg.slice(2);+ const next = argv[i + 1];+ if (next === undefined || next.startsWith("--")) flags[key] = true;+ else {+ // --artifact may repeat; every other flag keeps its last value.+ flags[key] =+ key === "artifact" && flags[key] !== undefined+ ? [].concat(flags[key], next)+ : next;+ i += 1;+ }+ }+ } else {+ positional.push(arg);+ }+ }+ return { positional, flags };+}++function intFlag(value, fallback) {+ if (value === undefined || value === true) return fallback;+ const n = Number(value);+ if (!Number.isFinite(n)) usage(`Expected a number, got ${value}`);+ return n;+}++const delay = (ms) => new Promise((r) => setTimeout(r, ms));++// ---------------------------------------------------------------------------+// Run directory handling.+// ---------------------------------------------------------------------------+function liveRuns() {+ if (!existsSync(verifyHome)) return [];+ return readdirSync(verifyHome)+ .filter((name) => name !== "current" && !name.startsWith("."))+ .map((name) => join(verifyHome, name))+ .filter((dir) => {+ try {+ const run = JSON.parse(readFileSync(join(dir, "run.json"), "utf8"));+ return groupAlive(run.launcherPgid);+ } catch {+ return false;+ }+ });+}++function resolveRunDir(flags, { required = true } = {}) {+ const explicit = flags.run || process.env.OH_VERIFY_RUN;+ let dir;+ if (explicit) dir = resolve(explicit);+ else {+ // With several live runs (several agents on one machine), guessing would+ // let one agent drive another's browser. Refuse instead.+ const live = liveRuns();+ if (live.length > 1) {+ throw new CliError(+ `${live.length} runs are alive; refusing to guess which one is yours.`,+ {+ code: 3,+ hint: `export OH_VERIFY_RUN=<your run dir> (or pass --run). Live runs: ${live.join(", ")}`,+ },+ );+ }+ if (live.length === 1) dir = live[0];+ else if (existsSync(join(verifyHome, "current"))) {+ dir = realpathSync(join(verifyHome, "current"));+ }+ }+ if (!dir || !existsSync(join(dir, "run.json"))) {+ if (!required) return undefined;+ throw new CliError("No verification run found.", {+ code: 3,+ hint: "Start one with `control-openhands launch`, or pass --run <dir> / export OH_VERIFY_RUN.",+ });+ }+ return dir;+}++function loadRun(flags, options) {+ const dir = resolveRunDir(flags, options);+ if (!dir) return undefined;+ const run = JSON.parse(readFileSync(join(dir, "run.json"), "utf8"));+ run.dir = dir;+ return run;+}++function saveRun(run) {+ const { dir, ...rest } = run;+ writeFileSync(join(dir, "run.json"), `${JSON.stringify(rest, null, 2)}\n`);+}++function sessionKey(run) {+ return readFileSync(join(run.dir, "private", "session-key"), "utf8").trim();+}++function git(args, cwd = repoRoot) {+ return execFileSync("git", args, { cwd, encoding: "utf8" }).trim();+}++function checkoutRevision() {+ return git(["rev-parse", "HEAD"]);+}++// Identity of the frontend build inputs, untracked new files included:+// commits that only touch other paths (docs, this skill) reuse the existing+// build instead of rebuilding under stacks that are already serving it.+function buildId() {+ return buildIdentity(repoRoot);+}++function processAlive(pid) {+ if (!pid) return false;+ try {+ process.kill(pid, 0);+ return true;+ } catch (error) {+ return error.code === "EPERM";+ }+}++function groupAlive(pgid) {+ if (!pgid) return false;+ try {+ process.kill(-pgid, 0);+ return true;+ } catch (error) {+ return error.code === "EPERM";+ }+}++function commandLine(pid) {+ try {+ if (existsSync(`/proc/${pid}/cmdline`)) {+ return readFileSync(`/proc/${pid}/cmdline`, "utf8")+ .replace(/\0/g, " ")+ .trim();+ }+ return execFileSync("ps", ["-o", "command=", "-p", String(pid)], {+ encoding: "utf8",+ }).trim();+ } catch {+ return "";+ }+}++function portOpen(port, host = "127.0.0.1") {+ return new Promise((resolvePromise) => {+ const socket = createConnection({ port, host });+ const done = (value) => {+ socket.destroy();+ resolvePromise(value);+ };+ socket.setTimeout(800, () => done(false));+ socket.once("connect", () => done(true));+ socket.once("error", () => done(false));+ });+}++function claimPath(base) {+ return join(verifyHome, `.ports-${base}.claim`);+}++function tryClaim(base, runDir) {+ // Concurrent launches must not pick the same block: claim it atomically+ // ('wx'), and take over only claims whose run is gone or never started.+ const path = claimPath(base);+ try {+ writeFileSync(path, runDir, { flag: "wx" });+ return true;+ } catch {+ try {+ const owner = readFileSync(path, "utf8").trim();+ const ownerRun = join(owner, "run.json");+ const alive =+ existsSync(ownerRun) &&+ groupAlive(JSON.parse(readFileSync(ownerRun, "utf8")).launcherPgid);+ const age = Date.now() - lstatSync(path).mtimeMs;+ if (alive || (!existsSync(ownerRun) && age < 10 * 60_000)) return false;+ writeFileSync(path, runDir);+ return true;+ } catch {+ return false;+ }+ }+}++function releaseClaim(run) {+ const path = claimPath(run.ports.ingress);+ try {+ if (readFileSync(path, "utf8").trim() === run.dir) unlinkSync(path);+ } catch {+ // already released+ }+}++async function findPortBlock(start, runDir, editor) {+ // The launcher needs ingress P, agent-server P+1, automation P+2, static+ // frontend P+3, and the editor port only when it serves VS Code (`editor`+ // is its offset from the agent-server port, or null; see editorOffset).+ mkdirSync(verifyHome, { recursive: true });+ for (let base = start; base < start + 900; base += 10) {+ const ports = Object.values(runPorts(base, editor));+ const busy = await Promise.all(ports.map((p) => portOpen(p)));+ if (busy.some(Boolean)) continue;+ if (tryClaim(base, runDir)) return base;+ }+ throw new CliError(`No free port block found from ${start}`, { code: 3 });+}++async function http(+ run,+ method,+ path,+ { body, raw, auth = true, timeout = 15_000, headers = {} } = {},+) {+ const url = new URL(path, run.baseUrl);+ if (url.origin !== new URL(run.baseUrl).origin) {+ throw new CliError(+ `Refusing to send the session key outside ${run.baseUrl}`,+ { code: 2 },+ );+ }+ const response = await fetch(url, {+ method,+ redirect: "manual",+ signal: AbortSignal.timeout(timeout),+ headers: {+ ...(auth ? { "X-Session-API-Key": sessionKey(run) } : {}),+ ...(body !== undefined ? { "Content-Type": "application/json" } : {}),+ ...headers,+ },+ body: raw ?? (body === undefined ? undefined : JSON.stringify(body)),+ });+ const text = await response.text();+ let json;+ try {+ json = text ? JSON.parse(text) : undefined;+ } catch {+ json = undefined;+ }+ return {+ status: response.status,+ ok: response.ok,+ json,+ text,+ contentType: response.headers.get("content-type"),+ };+}++function defaults() {+ return JSON.parse(+ readFileSync(join(repoRoot, "config", "defaults.json"), "utf8"),+ );+}++function availableMemoryBytes() {+ // MemAvailable counts reclaimable cache; os.freemem() alone understates it.+ try {+ const line = readFileSync("/proc/meminfo", "utf8").match(+ /^MemAvailable:\s+(\d+) kB/m,+ );+ if (line) return Number(line[1]) * 1024;+ } catch {+ // not Linux+ }+ return freemem();+}++function nodeMajor() {+ return Number(process.versions.node.split(".")[0]);+}++// ---------------------------------------------------------------------------+// Browser daemon client.+// ---------------------------------------------------------------------------+function daemonInfo(run) {+ const path = join(run.dir, "private", "browser.json");+ if (!existsSync(path)) return undefined;+ const info = JSON.parse(readFileSync(path, "utf8"));+ return processAlive(info.pid) ? info : undefined;+}++async function browserCall(run, cmd, args = {}, { timeout = 120_000 } = {}) {+ const info = daemonInfo(run);+ if (!info) {+ throw new CliError("The browser daemon is not running for this run.", {+ code: 3,+ hint: "Run `control-openhands browser start`.",+ });+ }+ const response = await fetch(`http://127.0.0.1:${info.port}/`, {+ method: "POST",+ headers: {+ "content-type": "application/json",+ "x-control-token": info.token,+ },+ body: JSON.stringify({ cmd, args }),+ signal: AbortSignal.timeout(timeout),+ });+ const result = await response.json();+ if (!result.ok) {+ throw new CliError(result.error, {+ code: 1,+ hint: result.hint,+ extra: { url: result.url, failureScreenshot: result.failureScreenshot },+ });+ }+ delete result.ok;+ return result;+}++async function startBrowser(run) {+ const existing = daemonInfo(run);+ if (existing) return { alreadyRunning: true, pid: existing.pid };+ const logFd = openSync(join(run.dir, "private", "browser.log"), "a", 0o600);+ const child = spawn(process.execPath, [join(here, "browser-daemon.mjs")], {+ cwd: repoRoot,+ detached: true,+ stdio: ["ignore", logFd, logFd],+ env: {+ ...process.env,+ OH_VERIFY_RUN: run.dir,+ OH_VERIFY_BASE_URL: run.baseUrl,+ },+ });+ child.unref();+ const browserJson = join(run.dir, "private", "browser.json");+ for (let i = 0; i < 60; i += 1) {+ await delay(500);+ if (existsSync(browserJson)) {+ const info = JSON.parse(readFileSync(browserJson, "utf8"));+ if (info.pid === child.pid) {+ run.browserPid = child.pid;+ saveRun(run);+ return { started: true, pid: child.pid };+ }+ }+ if (!processAlive(child.pid)) break;+ }+ const log = readFileSync(join(run.dir, "private", "browser.log"), "utf8")+ .split("\n")+ .slice(-15)+ .join("\n");+ throw new CliError("Browser daemon failed to start.", {+ code: 3,+ hint: "Set CONTROL_OPENHANDS_BROWSER to a Chromium executable when Playwright's pinned browser is missing.",+ extra: { log },+ });+}++async function stopBrowser(run) {+ const info = daemonInfo(run);+ if (!info) return { running: false };+ try {+ await browserCall(run, "shutdown", {}, { timeout: 5_000 });+ } catch {+ // fall through to signal+ }+ for (let i = 0; i < 20 && processAlive(info.pid); i += 1) await delay(250);+ if (processAlive(info.pid)) process.kill(info.pid, "SIGTERM");+ rmSync(join(run.dir, "private", "browser.json"), { force: true });+ return { stopped: true, pid: info.pid };+}++function versionAtLeast(version, minimum) {+ const parts = (v) =>+ String(v)+ .replace(/^v/, "")+ .split(/[.+-]/)+ .slice(0, 3)+ .map((n) => Number.parseInt(n, 10) || 0);+ const [a, b] = [parts(version), parts(minimum)];+ for (let i = 0; i < 3; i += 1) if (a[i] !== b[i]) return a[i] > b[i];+ return true;+}++// ---------------------------------------------------------------------------+// Commands: lifecycle.+// ---------------------------------------------------------------------------+const PASS_ENV = [+ "PATH",+ "LANG",+ "LC_ALL",+ "TERM",+ "TZ",+ "TMPDIR",+ "USER",+ "LOGNAME",+ "SHELL",+ "HTTP_PROXY",+ "HTTPS_PROXY",+ "NO_PROXY",+ "http_proxy",+ "https_proxy",+ "no_proxy",+ "SSL_CERT_FILE",+ "SSL_CERT_DIR",+ "REQUESTS_CA_BUNDLE",+ "CURL_CA_BUNDLE",+ "NODE_EXTRA_CA_CERTS",+ "PIP_CERT",+ "UV_NATIVE_TLS",+ "UV_INDEX_URL",+ "UV_EXTRA_INDEX_URL",+ "UV_PYTHON",+ "PLAYWRIGHT_BROWSERS_PATH",+ "TMUX_TMPDIR",+];++function checkNewRunId(runId) {+ if (+ typeof runId !== "string" ||+ !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(runId)+ ) {+ throw new CliError(+ "--run-id must be letters, digits, '.', '_' or '-', starting with a letter or digit.",+ { code: 2 },+ );+ }+ const dir = join(verifyHome, runId);+ if (existsSync(dir)) {+ throw new CliError(`Run ${runId} already exists (${dir}).`, {+ code: 2,+ hint: "Pick a new --run-id, or reuse that run in place with `OH_VERIFY_RUN=<dir> control-openhands restart`.",+ });+ }+}++async function cmdLaunch({ flags }) {+ // A named run must be new: reusing its directory would overwrite the keys+ // and run.json of a run that may still be live. `restart` reuses a run.+ const requestedRunId = flags["run-id"];+ if (requestedRunId !== undefined) checkNewRunId(requestedRunId);+ if (nodeMajor() < 24) {+ throw new CliError(+ `Node >=24 is required by the launcher; this is ${process.version}.`,+ {+ code: 3,+ hint: "Put a Node 24 binary first on PATH (see package.json engines) and rerun.",+ },+ );+ }+ // One run (Agent Server, automation, frontend, Chromium) needs about+ // 1.5 GB. Several agents launching at once can exhaust a shared machine and+ // take every run down with it, so refuse instead of overcommitting.+ const availableMb = Math.round(availableMemoryBytes() / 1024 / 1024);+ const minimumMb = intFlag(flags["min-free-mb"], 2000);+ if (availableMb < minimumMb) {+ throw new CliError(+ `Only ${availableMb} MB of memory available; a run needs about 1500 MB.`,+ {+ code: 3,+ hint: "Stop runs you no longer need (`control-openhands runs`, `stop --run <dir>`), wait for other agents, or lower --min-free-mb deliberately.",+ },+ );+ }+ const uvx = spawnSync("uvx", ["--version"], { encoding: "utf8" });+ if (uvx.status !== 0) {+ throw new CliError(+ "uvx is not on PATH; the launcher runs Agent Server and automation through it.",+ {+ code: 3,+ hint: "Install uv (https://docs.astral.sh/uv/) and rerun.",+ },+ );+ }++ const existing = flags.new ? undefined : loadRun(flags, { required: false });+ if (existing && !flags.new && groupAlive(existing.launcherPgid)) {+ out({+ ok: true,+ alreadyRunning: true,+ run: existing.dir,+ baseUrl: existing.baseUrl,+ hint: "Pass --new for a second, independent run.",+ });+ return;+ }++ // 1. Build the exact checkout (or reuse a build stamped with this revision).+ const revision = checkoutRevision();+ const currentBuildId = buildId();+ const buildDir = join(repoRoot, "build");+ const marker = join(buildDir, "verify-revision.txt");+ const buildMode = flags.build ?? "auto";+ const stamped = existsSync(marker) ? readFileSync(marker, "utf8").trim() : "";+ let built = false;+ if (+ buildMode === "always" ||+ (buildMode === "auto" && stamped !== currentBuildId)+ ) {+ if (!existsSync(join(repoRoot, "node_modules"))) {+ throw new CliError("node_modules is missing.", {+ code: 3,+ hint: "npm ci --ignore-scripts --no-audit --no-fund",+ });+ }+ process.stderr.write(+ `building ${revision} (build inputs ${currentBuildId}; npm run build:app)...\n`,+ );+ const result = spawnSync("npm", ["run", "build:app"], {+ cwd: repoRoot,+ stdio: ["ignore", 2, 2],+ env: { ...process.env, VITE_DO_NOT_TRACK: "1" },+ });+ if (result.status !== 0)+ throw new CliError("npm run build:app failed", { code: 3 });+ writeFileSync(marker, `${currentBuildId}\n`);+ built = true;+ } else if (+ buildMode === "never" &&+ !existsSync(join(buildDir, "index.html"))+ ) {+ throw new CliError("No build/ found and --build never was given.", {+ code: 3,+ });+ }++ // 2. Allocate a run directory and its keys.+ const runId =+ flags["run-id"] ||+ `${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}-${randomBytes(3).toString("hex")}`;+ const dir = join(verifyHome, runId);+ const priv = join(dir, "private");+ mkdirSync(verifyHome, { recursive: true });+ try {+ mkdirSync(dir); // exclusive: fails if another launch took the id meanwhile+ } catch (error) {+ if (error.code === "EEXIST") checkNewRunId(runId);+ throw error;+ }+ for (const d of [+ priv,+ join(priv, "home"),+ join(priv, "state"),+ join(dir, "evidence"),+ join(dir, "workspace"),+ ]) {+ mkdirSync(d, { recursive: true, mode: d.startsWith(priv) ? 0o700 : 0o755 });+ }+ // MCP stdio servers start with a minimal environment (HOME, PATH), so a+ // CA bundle given to this process does not reach their uvx/npx. Seed the+ // private HOME's tool config with it.+ const caBundle = process.env.SSL_CERT_FILE || process.env.NODE_EXTRA_CA_CERTS;+ if (caBundle && existsSync(caBundle)) {+ mkdirSync(join(priv, "home", ".config", "uv"), { recursive: true });+ writeFileSync(+ join(priv, "home", ".config", "uv", "uv.toml"),+ "native-tls = true\n",+ );+ writeFileSync(join(priv, "home", ".npmrc"), `cafile=${caBundle}\n`);+ }+ writeFileSync(join(priv, "session-key"), randomBytes(32).toString("hex"), {+ mode: 0o600,+ });+ writeFileSync(join(priv, "encryption-key"), randomBytes(32).toString("hex"), {+ mode: 0o600,+ });++ // 3. The launcher's environment: only PASS_ENV, run-private paths and keys,+ // and the flags below reach it.+ const env = {};+ for (const name of PASS_ENV)+ if (process.env[name] !== undefined) env[name] = process.env[name];+ const realHome = process.env.HOME || "";+ Object.assign(env, {+ HOME: join(priv, "home"),+ // Reuse the operator's uv caches so each run does not re-download Python.+ UV_CACHE_DIR: process.env.UV_CACHE_DIR || join(realHome, ".cache", "uv"),+ UV_PYTHON_INSTALL_DIR:+ process.env.UV_PYTHON_INSTALL_DIR ||+ join(realHome, ".local", "share", "uv", "python"),+ OH_CANVAS_SAFE_STATE_DIR: join(priv, "state"),+ LOCAL_BACKEND_API_KEY: readFileSync(join(priv, "session-key"), "utf8"),+ OH_SECRET_KEY: readFileSync(join(priv, "encryption-key"), "utf8"),+ DO_NOT_TRACK: "1",+ VITE_DO_NOT_TRACK: "1",+ OPENHANDS_SUPPRESS_BANNER: "1",+ });+ if (flags["sdk-path"])+ env.OH_AGENT_SERVER_LOCAL_PATH = resolve(flags["sdk-path"]);+ if (flags["sdk-ref"]) env.OH_AGENT_SERVER_GIT_REF = flags["sdk-ref"];+ if (flags["automation-path"])+ env.OH_AUTOMATION_LOCAL_PATH = resolve(flags["automation-path"]);+ if (flags["automation-ref"])+ env.OH_AUTOMATION_GIT_REF = flags["automation-ref"];+ if (flags["sdk-version"]) env.OH_AGENT_SERVER_VERSION = flags["sdk-version"];+ if (flags["automation-version"])+ env.OH_AUTOMATION_VERSION = flags["automation-version"];+ if (flags.vscode) env.OH_CANVAS_ENABLE_VSCODE = "true";+ // Only PASS_ENV and the flags above reach the launcher, so a version pin+ // exported in the caller's shell would be dropped without a word.+ const ignoredEnv = Object.keys(process.env).filter(+ (k) =>+ (/^OH_(AGENT_SERVER|AUTOMATION)_/.test(k) ||+ k === "OH_CANVAS_ENABLE_VSCODE") &&+ !(k in env),+ );+ const warnings = [];+ if (ignoredEnv.length)+ warnings.push(+ `Ignored ${ignoredEnv.join(", ")} from your shell: runs are isolated. Use --sdk-version/--sdk-ref/--sdk-path, --automation-version/--automation-ref/--automation-path or --vscode.`,+ );++ // 4. Ports. The editor port is reserved only when this checkout's launcher+ // serves VS Code with this environment: opt-in since OpenHands/OpenHands#17660,+ // bundled before it and again since OpenHands/OpenHands#18048.+ const editor = editorOffset(repoRoot, env);+ if (editor.source === "fallback")+ warnings.push(+ `Could not ask scripts/dev-with-automation.mjs whether it serves VS Code (${editor.reason}); reserving the editor port as before.`,+ );+ const base = flags.port+ ? intFlag(flags.port)+ : await findPortBlock(+ intFlag(flags["port-from"], 18800),+ dir,+ editor.offset,+ );+ const ports = runPorts(base, editor.offset);+ if (flags.port) {+ const busy = [];+ for (const [name, port] of Object.entries(ports))+ if (await portOpen(port)) busy.push(`${port} (${name})`);+ if (busy.length)+ throw new CliError(`Ports busy: ${busy.join(", ")}`, {+ code: 3,+ hint: "Omit --port to pick a free block.",+ });+ }+ Object.assign(env, {+ OH_CANVAS_SAFE_BACKEND_PORT: String(ports.agentServer),+ OH_CANVAS_SAFE_AUTOMATION_PORT: String(ports.automation),+ OH_CANVAS_SAFE_VITE_PORT: String(ports.frontend),+ // A private tmux server per run (OpenHands/OpenHands#17946: the launcher's+ // <stateDir>/tmux is never created, so runs would share one server). It+ // lives under /tmp because a socket below the long run path would exceed+ // the 108-byte Unix socket limit.+ TMUX_TMPDIR: tmuxDirFor(dir),+ });+ const envWarning = warnings.length ? warnings.join(" ") : undefined;++ // 5. Start the repository's own production launcher, isolated.+ const launcherArgs = [+ join(repoRoot, "bin", "agent-canvas.mjs"),+ "--port",+ String(ports.ingress),+ ];+ if (flags.public) launcherArgs.push("--public");+ const savedEnv = { ...env };+ delete savedEnv.LOCAL_BACKEND_API_KEY;+ delete savedEnv.OH_SECRET_KEY;+ writeFileSync(join(priv, "launcher-env.json"), JSON.stringify(savedEnv), {+ mode: 0o600,+ });++ const run = {+ runId,+ dir,+ repo: repoRoot,+ revision,+ buildId: currentBuildId,+ builtThisRun: built,+ mode: flags.public ? "public" : "local",+ baseUrl: `http://127.0.0.1:${ports.ingress}`,+ ports,+ launcherArgs,+ startedAt: new Date().toISOString(),+ pins: defaults().versions,+ overrides: Object.fromEntries(+ Object.entries(env).filter(([k]) =>+ /^OH_(AGENT_SERVER_|AUTOMATION_|CANVAS_ENABLE_VSCODE$)/.test(k),+ ),+ ),+ };+ spawnLauncher(run);+ saveRun(run);+ try {+ if (+ existsSync(join(verifyHome, "current")) ||+ lstatSync(join(verifyHome, "current"), { throwIfNoEntry: false })+ ) {+ unlinkSync(join(verifyHome, "current"));+ }+ } catch {+ // no previous pointer+ }+ symlinkSync(dir, join(verifyHome, "current"));++ // 6. Wait for readiness: authenticated settings, automation health and SPA.+ await waitForStack(run, intFlag(flags.timeout, 600));+ const info = await http(run, "GET", "/server_info");+ run.versions = {+ agentServer: info.json?.version,+ sdk: info.json?.sdk_version ?? undefined,+ };+ run.readyAt = new Date().toISOString();+ saveRun(run);++ let browser;+ if (!flags["no-browser"]) browser = await startBrowser(run);++ if (flags["print-run"]) {+ // For: export OH_VERIFY_RUN=$(control-openhands launch --new --print-run)+ if (envWarning) process.stderr.write(`warning: ${envWarning}\n`);+ process.stdout.write(`${dir}\n`);+ return;+ }+ out({+ ok: true,+ run: dir,+ ...(envWarning ? { warning: envWarning } : {}),+ baseUrl: run.baseUrl,+ mode: run.mode,+ revision,+ builtThisRun: built,+ ports,+ versions: run.versions,+ browser,+ next: [+ `export OH_VERIFY_RUN=${dir}`,+ "control-openhands doctor",+ run.mode === "public"+ ? "control-openhands login"+ : "control-openhands onboard --skip",+ ],+ });+}++async function waitForStack(run, timeoutSec) {+ const priv = join(run.dir, "private");+ const deadline = Date.now() + timeoutSec * 1000;+ let last = "";+ for (;;) {+ if (!groupAlive(run.launcherPgid)) {+ const tail = readFileSync(join(priv, "stack.log"), "utf8")+ .split("\n")+ .slice(-25)+ .join("\n");+ throw new CliError("The launcher exited before the stack became ready.", {+ code: 3,+ extra: { run: run.dir, logTail: tail.replace(/\x1b\[[0-9;]*m/g, "") },+ });+ }+ try {+ const [settings, automation, html] = await Promise.all([+ http(run, "GET", "/api/settings", { timeout: 4000 }),+ http(run, "GET", "/api/automation/health", { timeout: 4000 }),+ http(run, "GET", "/", { auth: false, timeout: 4000 }),+ ]);+ last = `settings=${settings.status} automation=${automation.status} ui=${html.status}`;+ if (+ settings.status === 200 &&+ automation.status === 200 &&+ html.status === 200+ )+ return;+ } catch (error) {+ last = String(error.message);+ }+ if (Date.now() > deadline) {+ throw new CliError(`Stack not ready after ${timeoutSec}s (${last}).`, {+ code: 3,+ hint: "Inspect <run>/private/stack.log; first launches download Python packages and can take minutes.",+ extra: { run: run.dir },+ });+ }+ await delay(1500);+ }+}++function spawnLauncher(run) {+ // The saved environment holds no secrets; keys are re-read from private/.+ const priv = join(run.dir, "private");+ const saved = JSON.parse(+ readFileSync(join(priv, "launcher-env.json"), "utf8"),+ );+ const env = launcherEnvFor(saved, process.env, PASS_ENV);+ env.LOCAL_BACKEND_API_KEY = readFileSync(join(priv, "session-key"), "utf8");+ env.OH_SECRET_KEY = readFileSync(join(priv, "encryption-key"), "utf8");+ if (saved.TMUX_TMPDIR) env.TMUX_TMPDIR = tmuxDirFor(run.dir);+ const logFd = openSync(join(priv, "stack.log"), "a", 0o600);+ const child = spawn(process.execPath, run.launcherArgs, {+ cwd: repoRoot,+ env,+ detached: true,+ stdio: ["ignore", logFd, logFd],+ });+ child.unref();+ run.launcherPid = child.pid;+ run.launcherPgid = child.pid;+ return child;+}++async function stopLauncher(run) {+ const pgid = run.launcherPgid;+ let forced = false;+ const serviceGroups = new Set(+ descendants(run.launcherPid)+ .map((p) => p.pgid)+ .filter((g) => g !== pgid),+ );+ if (groupAlive(pgid)) {+ const cmd = commandLine(pgid);+ if (cmd && !cmd.includes("agent-canvas.mjs")) {+ throw new CliError(+ `PID ${pgid} is no longer this run's launcher (${cmd.slice(0, 80)}); refusing to signal it.`,+ { code: 3 },+ );+ }+ process.kill(-pgid, "SIGTERM");+ for (let i = 0; i < 60 && groupAlive(pgid); i += 1) await delay(500);+ if (groupAlive(pgid)) {+ process.kill(-pgid, "SIGKILL");+ forced = true;+ await delay(1000);+ }+ }+ // The launcher shuts its services down itself; anything it left behind+ // (for example after a forced kill) is signalled by its own group.+ for (const group of serviceGroups) {+ if (!groupAlive(group)) continue;+ process.kill(-group, "SIGTERM");+ for (let i = 0; i < 20 && groupAlive(group); i += 1) await delay(500);+ if (groupAlive(group)) {+ process.kill(-group, "SIGKILL");+ forced = true;+ }+ }+ // Give sockets a moment to close before callers check or reuse the ports.+ for (const port of Object.values(run.ports)) {+ for (let i = 0; i < 20 && (await portOpen(port)); i += 1) await delay(500);+ }+ return { stopped: !groupAlive(pgid), forced };+}++async function cmdRestart({ flags }) {+ const run = loadRun(flags);+ if (+ !run.launcherArgs ||+ !existsSync(join(run.dir, "private", "launcher-env.json"))+ ) {+ throw new CliError("This run predates restart support; launch a new one.", {+ code: 3,+ });+ }+ // The checkout may have changed since launch (for example, VS Code bundled+ // again), so ask its launcher again which ports this run now uses. Asked+ // before stopping: an editor port the run did not use before cannot move+ // with the block, so a busy one refuses the restart while the run is still+ // up, as launch --port would.+ const saved = JSON.parse(+ readFileSync(join(run.dir, "private", "launcher-env.json"), "utf8"),+ );+ const next = portsAfterRestart(+ run.ports,+ editorOffset(repoRoot, launcherEnvFor(saved, process.env, PASS_ENV)),+ );+ if (next.added !== undefined && (await portOpen(next.added)))+ throw new CliError(+ `Port ${next.added} (vscode) is busy, and the checkout's launcher now serves VS Code there; restart refused, and the run is unchanged.`,+ {+ code: 3,+ hint: "The run is still up. Free that port and restart again, or launch --new for a free block.",+ },+ );+ const stopped = await stopLauncher(run);+ run.ports = next.ports;+ if (flags["rotate-key"]) {+ writeFileSync(+ join(run.dir, "private", "session-key"),+ randomBytes(32).toString("hex"),+ { mode: 0o600 },+ );+ }+ spawnLauncher(run);+ run.restartedAt = new Date().toISOString();+ saveRun(run);+ await waitForStack(run, intFlag(flags.timeout, 600));+ out({+ ok: true,+ run: run.dir,+ baseUrl: run.baseUrl,+ stopped,+ ports: run.ports,+ rotatedKey: Boolean(flags["rotate-key"]),+ ...(next.warning ? { warning: next.warning } : {}),+ note: flags["rotate-key"]+ ? "The browser still holds the old key: reload to reach the stale-key state (public mode shows the API-key prompt)."+ : "Same state, keys and port block; reload the browser to reconnect.",+ });+}++const SERVICES = {+ automation:+ /openhands-automation|automation[./](app|main|server)|uvicorn\S* .*automation/,+ "agent-server":+ /openhands-agent-server|openhands[./]agent_server|bin\/agent-server /,+ frontend: /static-server\.mjs/,+};++// The launcher starts each service in its own process group, so services are+// found by walking the process tree under the launcher, not by its group.+function descendants(rootPid) {+ const listing = spawnSync("ps", ["-eo", "pid=,ppid=,pgid=,args="], {+ encoding: "utf8",+ }).stdout;+ const rows = listing+ .split("\n")+ .map((line) => line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/))+ .filter(Boolean)+ .map((m) => ({ pid: +m[1], ppid: +m[2], pgid: +m[3], args: m[4] }));+ const found = [];+ const frontier = [rootPid];+ while (frontier.length) {+ const parent = frontier.pop();+ for (const row of rows) {+ if (row.ppid === parent) {+ found.push(row);+ frontier.push(row.pid);+ }+ }+ }+ return found;+}++async function cmdService({ positional, flags }) {+ const run = loadRun(flags);+ const [sub, name] = positional;+ const procs = descendants(run.launcherPid);+ if (sub === "status") {+ const services = {};+ for (const [service, pattern] of Object.entries(SERVICES)) {+ services[service] = procs+ .filter((p) => pattern.test(p.args))+ .map((p) => p.pid);+ }+ out({ ok: true, launcherAlive: groupAlive(run.launcherPgid), services });+ return;+ }+ if (sub === "stop") {+ const pattern = SERVICES[name];+ if (!pattern) {+ usage(+ `Unknown service ${name}. Known: ${Object.keys(SERVICES).join(", ")}`,+ "control-openhands service stop automation",+ );+ }+ // Only processes inside this run's own process group are candidates.+ const targets = procs.filter(+ (p) => pattern.test(p.args) && p.pid !== run.launcherPid,+ );+ if (!targets.length) {+ throw new CliError(+ `No ${name} process found in this run's process group.`,+ { hint: "control-openhands service status" },+ );+ }+ // Signal each service's own process group (uv and its Python child).+ for (const pgid of new Set(targets.map((t) => t.pgid))) {+ try {+ process.kill(-pgid, "SIGTERM");+ } catch {+ // already gone+ }+ }+ await delay(2000);+ out({+ ok: true,+ stopped: targets.map((t) => t.pid),+ launcherAlive: groupAlive(run.launcherPgid),+ next: "Drive the unavailable state, then `control-openhands restart` to bring the whole stack back.",+ });+ return;+ }+ usage(+ "Usage: control-openhands service status | service stop automation|agent-server|frontend",+ "control-openhands service stop automation",+ );+}++async function cmdStatus({ flags }) {+ const run = loadRun(flags);+ out({+ ok: true,+ run: run.dir,+ baseUrl: run.baseUrl,+ mode: run.mode,+ revision: run.revision,+ launcherAlive: groupAlive(run.launcherPgid),+ browserAlive: Boolean(daemonInfo(run)),+ ports: run.ports,+ versions: run.versions,+ startedAt: run.startedAt,+ });+}++async function cmdDoctor({ flags }) {+ const run = loadRun(flags);+ const checks = [];+ const add = (name, ok, detail, severity = "fail") =>+ checks.push({ name, ok, severity: ok ? "ok" : severity, detail });++ const alive = groupAlive(run.launcherPgid);+ const cmd = commandLine(run.launcherPid);+ add(+ "launcher process group alive",+ alive,+ alive ? cmd.slice(0, 120) : "launcher group is gone",+ );+ if (alive)+ add(+ "launcher is this run's agent-canvas",+ cmd.includes("agent-canvas.mjs"),+ cmd.slice(0, 120),+ );+ for (const [name, port] of Object.entries(run.ports)) {+ if (name === "vscode") continue;+ const open = await portOpen(port);+ add(`port ${name}:${port} listening`, open, open ? "open" : "closed");+ }+ if (alive) {+ try {+ const marker = await http(run, "GET", "/verify-revision.txt", {+ auth: false,+ });+ const served = marker.text.trim();+ add(+ "served build matches this checkout's build inputs",+ marker.status === 200 && served === run.buildId,+ `served=${served} run=${run.buildId} revision=${run.revision.slice(0, 12)}`,+ );+ const current = buildId();+ const unchanged = current === run.buildId;+ add(+ unchanged+ ? "checkout build inputs unchanged since launch"+ : "checkout build inputs changed since launch; relaunch with --build auto to serve them",+ unchanged,+ `launch=${run.buildId} now=${current}`,+ "warn",+ );+ const unauth = await http(run, "GET", "/api/settings", { auth: false });+ add(+ "unauthenticated API rejected",+ [401, 403].includes(unauth.status),+ `status=${unauth.status}`,+ );+ const settings = await http(run, "GET", "/api/settings");+ add(+ "authenticated settings readable",+ settings.status === 200 && Boolean(settings.json),+ `status=${settings.status}`,+ );+ const llm = settings.json?.agent_settings?.llm;+ const llmReady = Boolean(llm?.model && llm?.api_key);+ add(+ "LLM configured",+ llmReady,+ llmReady+ ? `model=${llm.model}`+ : `model=${llm?.model ?? "none"} without an API key: \`control-openhands llm preset deepseek\``,+ "info",+ );+ const info = await http(run, "GET", "/server_info");+ const pin = defaults().versions.agentServer;+ add(+ "agent-server reachable",+ info.status === 200,+ `version=${info.json?.version}`,+ );+ const version = info.json?.version;+ const overridden = Object.keys(run.overrides ?? {}).filter((k) =>+ k.startsWith("OH_AGENT_SERVER_"),+ );+ add(+ "agent-server matches pin",+ version === pin || overridden.length > 0,+ overridden.length+ ? `server=${version}, chosen by ${overridden.join(", ")} (default pin ${pin})`+ : `server=${version} pin=${pin}`,+ "warn",+ );+ const minimum = defaults().compatibility?.minimumAgentServer;+ if (minimum && version)+ add(+ "agent-server meets the UI minimum",+ versionAtLeast(version, minimum),+ versionAtLeast(version, minimum)+ ? `server=${version} minimum=${minimum}`+ : `server=${version} is below ${minimum}: every page shows the backend-compatibility gate instead of the app`,+ "warn",+ );+ const automation = await http(run, "GET", "/api/automation/health");+ add(+ "automation healthy",+ automation.status === 200,+ `status=${automation.status}`,+ );+ } catch (error) {+ add("HTTP checks", false, String(error.message));+ }+ }+ if (!flags["skip-ui"]) {+ if (daemonInfo(run)) {+ try {+ const probe = await browserCall(run, "uiprobe", {+ target: "/",+ timeout: 30_000,+ });+ const wedged =+ probe.markers.length === 1 && probe.markers[0] === "loading-spinner";+ add(+ "UI loads without page errors",+ probe.pageErrors.length === 0 && !wedged,+ `markers=${probe.markers.join(",") || "none"} pageErrors=${probe.pageErrors.length} testidsInDom=${probe.testids} (hidden included)`,+ );+ } catch (error) {+ add("UI probe", false, String(error.message));+ }+ } else {+ add(+ "browser daemon running",+ false,+ "start it with `control-openhands browser start`",+ "warn",+ );+ }+ }+ const failed = checks.filter((c) => c.severity === "fail");+ out({+ ok: failed.length === 0,+ run: run.dir,+ baseUrl: run.baseUrl,+ failed: failed.map((c) => `${c.name}: ${c.detail}`),+ warnings: checks+ .filter((c) => ["warn", "info"].includes(c.severity))+ .map((c) => `${c.name}: ${c.detail}`),+ passed: checks.filter((c) => c.ok).map((c) => `${c.name}: ${c.detail}`),+ });+ if (failed.length) process.exitCode = 3;+}++function tmuxDirFor(runDir) {+ const dir = join("/tmp", `ohv-tmux-${basename(runDir).slice(-6)}`);+ mkdirSync(dir, { recursive: true, mode: 0o700 });+ return dir;+}++async function cmdStop({ flags }) {+ const run = loadRun(flags);+ const result = { run: run.dir };+ result.browser = await stopBrowser(run);+ const pgid = run.launcherPgid;+ const launcher = await stopLauncher(run);+ if (launcher.forced) result.forced = true;+ const ports = {};+ for (const [name, port] of Object.entries(run.ports))+ ports[name] = (await portOpen(port)) ? "still open" : "closed";+ result.launcherStopped = !groupAlive(pgid);+ if (result.launcherStopped) {+ releaseClaim(run);+ rmSync(join("/tmp", `ohv-tmux-${basename(run.dir).slice(-6)}`), {+ recursive: true,+ force: true,+ });+ }+ result.ports = ports;+ run.stoppedAt = new Date().toISOString();+ saveRun(run);+ const evidence = listFiles(join(run.dir, "evidence"));+ result.evidenceFiles = evidence.length;+ if (flags["purge-private"]) {+ if (!result.launcherStopped)+ throw new CliError(+ "Refusing to purge private state while processes are alive.",+ { code: 3 },+ );+ const privateDir = join(run.dir, "private");+ const real = realpathSync(privateDir);+ if (+ lstatSync(privateDir).isSymbolicLink() ||+ dirname(real) !== realpathSync(run.dir)+ ) {+ throw new CliError(+ "private/ is not a plain directory inside the run; not deleting.",+ { code: 3 },+ );+ }+ rmSync(real, { recursive: true, force: true });+ result.privatePurged = true;+ result.evidenceFilesAfterPurge = listFiles(+ join(run.dir, "evidence"),+ ).length;+ }+ result.ok =+ result.launcherStopped && Object.values(ports).every((v) => v === "closed");+ out(result);+ if (!result.ok) process.exitCode = 3;+}++function listFiles(dir) {+ if (!existsSync(dir)) return [];+ const files = [];+ for (const entry of readdirSync(dir, { withFileTypes: true })) {+ const path = join(dir, entry.name);+ if (entry.isDirectory()) files.push(...listFiles(path));+ else files.push(path);+ }+ return files;+}++async function cmdEnv({ flags }) {+ const run = loadRun(flags);+ process.stdout.write(+ `export OH_VERIFY_RUN=${run.dir}\nexport OH_VERIFY_BASE_URL=${run.baseUrl}\n`,+ );+}++async function cmdRuns() {+ const runs = [];+ if (existsSync(verifyHome)) {+ for (const name of readdirSync(verifyHome)) {+ const file = join(verifyHome, name, "run.json");+ if (name === "current" || !existsSync(file)) continue;+ const run = JSON.parse(readFileSync(file, "utf8"));+ runs.push({+ run: join(verifyHome, name),+ baseUrl: run.baseUrl,+ alive: groupAlive(run.launcherPgid),+ revision: run.revision,+ startedAt: run.startedAt,+ });+ }+ }+ out({ ok: true, home: verifyHome, runs });+}++// ---------------------------------------------------------------------------+// Commands: API and LLM arrangement.+// ---------------------------------------------------------------------------+async function cmdApi({ positional, flags }) {+ const run = loadRun(flags);+ const [method = "", path] = positional;+ const verb = method.toUpperCase();+ if (!path || !path.startsWith("/"))+ usage(+ "Usage: control-openhands api <METHOD> </path>",+ "control-openhands api GET /api/settings",+ );+ if (!["GET", "HEAD"].includes(verb) && !flags.write) {+ usage(+ `${verb} changes state. Pass --write to arrange a precondition; it is never UI proof.`,+ `control-openhands api ${verb} ${path} --write --data '{...}'`,+ );+ }+ let body;+ if (flags.data !== undefined) {+ const raw = String(flags.data).startsWith("@")+ ? readFileSync(String(flags.data).slice(1), "utf8")+ : String(flags.data);+ body = JSON.parse(raw);+ }+ // Non-JSON uploads (an automation tarball): --data-file F --content-type T.+ let rawBody;+ const headers = {};+ if (flags["data-file"] && flags["data-file"] !== true) {+ rawBody = readFileSync(resolve(String(flags["data-file"])));+ headers["Content-Type"] =+ flags["content-type"] && flags["content-type"] !== true+ ? String(flags["content-type"])+ : "application/octet-stream";+ }+ const response = await http(run, verb, path, {+ body,+ raw: rawBody,+ headers,+ });+ const max = intFlag(flags["max-bytes"], 6000);+ if (flags.pick && flags.pick !== true && response.json !== undefined) {+ // Paths start inside the response body; a leading "body." is accepted.+ const value = String(flags.pick)+ .replace(/^body\./, "")+ .split(".")+ .reduce((o, k) => (o == null ? undefined : o[k]), response.json);+ out({ ok: response.ok, status: response.status, pick: flags.pick, value });+ if (!response.ok) process.exitCode = 1;+ return;+ }+ out({+ ok: response.ok,+ status: response.status,+ warning:+ !["GET", "HEAD", "DELETE"].includes(verb) &&+ body === undefined &&+ rawBody === undefined+ ? `${verb} sent no body: pass --data '{...}' (JSON) or --data-file F --content-type T.`+ : undefined,+ contentType: response.contentType,+ body:+ response.json ??+ (response.text.length > max+ ? `${response.text.slice(0, max)}…`+ : response.text),+ });+ if (!response.ok) process.exitCode = 1;+}++function readApiKey(flags) {+ if (flags["api-key-file"])+ return readFileSync(resolve(String(flags["api-key-file"])), "utf8").trim();+ const envName =+ flags["api-key-env"] && flags["api-key-env"] !== true+ ? flags["api-key-env"]+ : undefined;+ if (envName) {+ const value = process.env[envName];+ if (!value)+ throw new CliError(`Environment variable ${envName} is empty.`, {+ code: 3,+ });+ return value.trim();+ }+ if (flags["api-key"]) {+ throw new CliError(+ "Do not pass keys on the command line (they land in shell history and logs).",+ { code: 2, hint: "Use --api-key-env NAME or --api-key-file PATH." },+ );+ }+ return undefined;+}++async function validateLlm(run, name, llm) {+ const result = await http(+ run,+ "POST",+ `/api/profiles/${encodeURIComponent(name)}/validate`,+ { body: { llm }, timeout: 120_000 },+ );+ if (!result.ok)+ throw new CliError(+ `Validation request failed: ${result.status} ${result.text.slice(0, 300)}`,+ );+ if (!result.json?.valid) {+ throw new CliError(`LLM settings for ${name} are invalid.`, {+ extra: { validation: result.json?.error },+ });+ }+ return result.json;+}++async function saveProfile(run, name, llm) {+ const saved = await http(+ run,+ "POST",+ `/api/profiles/${encodeURIComponent(name)}`,+ { body: { llm, include_secrets: true } },+ );+ if (!saved.ok)+ throw new CliError(+ `Saving LLM profile ${name} failed: ${saved.status} ${saved.text.slice(0, 300)}`,+ );+ return saved;+}++async function activateProfile(run, name) {+ const activated = await http(+ run,+ "POST",+ `/api/profiles/${encodeURIComponent(name)}/activate`,+ { body: {} },+ );+ if (!activated.ok)+ throw new CliError(+ `Activating LLM profile ${name} failed: ${activated.status} ${activated.text.slice(0, 300)}`,+ );+}++const PRESETS = {+ deepseek: {+ envVar: "DEEPSEEK_API_KEY",+ profiles: [+ {+ name: "deepseek-flash",+ model: "deepseek/deepseek-flash",+ activate: true,+ },+ { name: "deepseek-pro", model: "deepseek/deepseek-v4-pro" },+ ],+ },+};++async function cmdLlm({ positional, flags }) {+ const run = loadRun(flags);+ const [sub] = positional;+ if (sub === "show") {+ const settings = await http(run, "GET", "/api/settings");+ const profiles = await http(run, "GET", "/api/profiles");+ const llm = settings.json?.agent_settings?.llm ?? {};+ out({+ ok: true,+ active: {+ model: llm.model,+ base_url: llm.base_url,+ api_key_set: Boolean(llm.api_key),+ },+ profiles: profiles.json,+ });+ return;+ }+ if (sub === "set") {+ const name =+ flags.profile && flags.profile !== true ? flags.profile : undefined;+ const model = flags.model;+ if (!name || !model || model === true)+ usage(+ "llm set needs --profile and --model",+ "control-openhands llm set --profile deepseek-flash --model deepseek/deepseek-flash --api-key-env DEEPSEEK_API_KEY",+ );+ const apiKey = readApiKey(flags);+ if (!apiKey)+ usage("llm set needs --api-key-env NAME or --api-key-file PATH");+ const llm = { model, api_key: apiKey };+ if (flags["base-url"]) llm.base_url = flags["base-url"];+ if (!flags["no-validate"]) await validateLlm(run, name, llm);+ await saveProfile(run, name, llm);+ if (!flags["no-activate"]) await activateProfile(run, name);+ const settings = await http(run, "GET", "/api/settings");+ out({+ ok: true,+ profile: name,+ model,+ activated: !flags["no-activate"],+ activeModel: settings.json?.agent_settings?.llm?.model,+ });+ return;+ }+ if (sub === "preset") {+ const presetName = positional[1];+ const preset = PRESETS[presetName];+ if (!preset)+ usage(+ `Unknown preset ${presetName}. Known: ${Object.keys(PRESETS).join(", ")}`,+ "control-openhands llm preset deepseek",+ );+ const apiKey = readApiKey({+ ...flags,+ "api-key-env": flags["api-key-env"] ?? preset.envVar,+ });+ const created = [];+ for (const profile of preset.profiles) {+ const llm = { model: profile.model, api_key: apiKey };+ if (!flags["no-validate"]) await validateLlm(run, profile.name, llm);+ await saveProfile(run, profile.name, llm);+ created.push(profile.name);+ }+ const active = preset.profiles.find((p) => p.activate);+ if (active) await activateProfile(run, active.name);+ const settings = await http(run, "GET", "/api/settings");+ out({+ ok: true,+ preset: presetName,+ profiles: created,+ active: active?.name,+ activeModel: settings.json?.agent_settings?.llm?.model,+ });+ return;+ }+ if (sub === "check") {+ // One 1-token completion through the agent-server's own pre-flight+ // endpoint, without saving anything.+ const model = flags.model;+ const apiKey = readApiKey(flags);+ if (!model || model === true || !apiKey)+ usage(+ "llm check needs --model and --api-key-env/--api-key-file",+ "control-openhands llm check --model deepseek/deepseek-flash --api-key-env DEEPSEEK_API_KEY",+ );+ const llm = { model, api_key: apiKey };+ if (flags["base-url"]) llm.base_url = flags["base-url"];+ out({ ok: true, model, ...(await validateLlm(run, "check", llm)) });+ return;+ }+ usage(+ "Usage: control-openhands llm show|set|preset|check",+ "control-openhands llm preset deepseek",+ );+}++// ---------------------------------------------------------------------------+// Commands: essential user pathways (driven through the real UI).+// ---------------------------------------------------------------------------+async function visible(run, selector) {+ const { count } = await browserCall(run, "count", { selector });+ if (!count) return false;+ return (await browserCall(run, "visible", { selector })).visible;+}++async function cmdLogin({ flags }) {+ const run = loadRun(flags);+ if (run.mode !== "public") {+ out({+ ok: true,+ skipped: true,+ reason: "local mode injects the session key; no login screen",+ });+ return;+ }+ // Public mode asks for the key in one of two places: the first-run+ // onboarding's "Add a backend" step, or the API-key screen shown once+ // onboarding is done or skipped. The key is typed, never printed.+ await browserCall(run, "goto", { target: "/" });+ for (let i = 0; i < 20; i += 1) {+ if (await visible(run, "testid=onboarding-backend-api-key")) {+ await browserCall(run, "fill", {+ selector: "testid=onboarding-backend-api-key",+ value: sessionKey(run),+ });+ await browserCall(run, "click", {+ selector: "testid=onboarding-backend-next",+ });+ await browserCall(run, "wait", {+ selector: "testid=onboarding-step-choose-agent",+ timeout: 30_000,+ });+ out({+ ok: true,+ loggedIn: true,+ via: "onboarding backend step",+ next: "control-openhands onboard (continues at Choose your agent)",+ });+ return;+ }+ if (await visible(run, "testid=api-key-entry-screen")) {+ // Connect stays disabled until Host Name is filled.+ const name = await browserCall(run, "value", {+ selector: "testid=api-key-entry-name",+ }).catch(() => ({ value: "x" }));+ if (!name.value) {+ await browserCall(run, "fill", {+ selector: "testid=api-key-entry-name",+ value: "Local",+ });+ }+ await browserCall(run, "fill", {+ selector: "testid=api-key-entry-api-key",+ value: sessionKey(run),+ });+ await browserCall(run, "click", {+ selector: "testid=api-key-entry-submit",+ });+ await browserCall(run, "wait", {+ selector: "testid=api-key-entry-screen",+ state: "hidden",+ timeout: 30_000,+ });+ out({ ok: true, loggedIn: true, via: "api-key-entry-screen" });+ return;+ }+ if (await visible(run, "testid=root-layout")) {+ out({ ok: true, loggedIn: true, via: "already authenticated" });+ return;+ }+ await delay(500);+ }+ throw new CliError(+ "Neither the onboarding backend step nor the API-key screen appeared.",+ {+ hint: "Inspect with `control-openhands browser testids` and `browser snapshot`.",+ },+ );+}++async function cmdOnboard({ flags }) {+ const run = loadRun(flags);+ const steps = [];+ await browserCall(run, "goto", { target: "/" });+ await delay(1500);+ if (await visible(run, "testid=telemetry-consent-form")) {+ const analytics = flags.analytics === "on";+ const box = "testid=telemetry-consent-form >> role=checkbox";+ const checked = (+ await browserCall(run, "eval", {+ expression:+ "document.querySelector('[data-testid=telemetry-consent-form] input[type=checkbox]')?.checked ?? null",+ })+ ).value;+ if (checked !== null && checked !== analytics)+ await browserCall(run, "click", { selector: box });+ await browserCall(run, "click", {+ selector: "testid=confirm-telemetry-preferences",+ });+ steps.push(`telemetry consent: analytics ${analytics ? "on" : "off"}`);+ await delay(500);+ }+ if (await visible(run, "testid=onboarding-modal")) {+ if (flags.skip || flags.skip === "") {+ await browserCall(run, "click", { selector: "testid=onboarding-skip" });+ steps.push("onboarding: skipped (not an onboarding-success proof)");+ } else {+ const agent =+ flags.agent && flags.agent !== true ? flags.agent : "openhands";+ await browserCall(run, "click", {+ selector: `testid=onboarding-agent-option-${agent}`,+ });+ await browserCall(run, "click", {+ selector: "testid=onboarding-agent-next",+ });+ steps.push(`onboarding: chose ${agent}`);+ await browserCall(run, "wait", {+ selector: "testid=onboarding-step-setup-llm",+ });+ await browserCall(run, "click", {+ selector: "testid=onboarding-llm-next",+ });+ steps.push("onboarding: LLM step continued with the current settings");+ await browserCall(run, "wait", {+ selector: "testid=onboarding-step-say-hello",+ });+ await browserCall(run, "click", {+ selector: "testid=onboarding-hello-close",+ });+ steps.push("onboarding: closed at say-hello");+ }+ await browserCall(run, "wait", {+ selector: "testid=onboarding-modal",+ state: "hidden",+ timeout: 15_000,+ });+ }+ if (!steps.length)+ steps.push("nothing to do: no consent form or onboarding modal shown");+ out({ ok: true, steps, url: (await browserCall(run, "url")).url });+}++const TERMINAL = [+ "idle",+ "finished",+ "error",+ "stuck",+ "paused",+ "waiting_for_confirmation",+];++async function conversationInfo(run, id) {+ const res = await http(+ run,+ "GET",+ `/api/conversations/${encodeURIComponent(id)}`,+ );+ if (!res.ok) throw new CliError(`Conversation ${id}: HTTP ${res.status}`);+ return res.json;+}++function summarize(info) {+ return {+ id: info.id,+ title: info.title,+ status: info.execution_status,+ model: info.current_model_id ?? info.agent?.llm?.model,+ workspace: info.workspace?.working_dir,+ cost:+ info.metrics?.accumulated_cost ??+ info.stats?.usage_to_metrics?.agent?.accumulated_cost,+ updatedAt: info.updated_at,+ };+}++async function waitConversation(run, id, { until, timeoutSec, fresh }) {+ const wanted = until === "any" || !until ? TERMINAL : until.split(",");+ const deadline = Date.now() + timeoutSec * 1000;+ let info = await conversationInfo(run, id);+ // --fresh: a message was just sent; ignore the previous run's terminal+ // status until the conversation has run again.+ let sawRunning = !fresh && info.execution_status === "running";+ const startedAt = Date.now();+ while (Date.now() < deadline) {+ info = await conversationInfo(run, id);+ if (info.execution_status === "running") sawRunning = true;+ const terminal = wanted.includes(info.execution_status);+ // A fresh conversation reports idle before its first step: wait for it+ // to actually run unless the caller only asked for "idle".+ const settled = fresh+ ? sawRunning || Date.now() - startedAt > 20_000+ : sawRunning || until === "idle" || info.execution_status !== "idle";+ if (terminal && settled) {+ // Titles are generated shortly after the first run finishes; report+ // the status that matched, not a later one.+ const matched = summarize(info);+ for (+ let i = 0;+ i < 5 && !matched.title && Date.now() < deadline;+ i += 1+ ) {+ await delay(2000);+ matched.title = (await conversationInfo(run, id)).title ?? null;+ }+ return { ...matched, waitedFor: wanted };+ }+ await delay(2000);+ }+ throw new CliError(+ `Conversation ${id} still ${info.execution_status} after ${timeoutSec}s`,+ { extra: summarize(info) },+ );+}++function eventText(event) {+ const pick = (v) =>+ typeof v === "string"+ ? v+ : Array.isArray(v)+ ? v.map((p) => p.text ?? "").join(" ")+ : "";+ return (+ pick(event.llm_message?.content) ||+ pick(event.message) ||+ event.action?.command ||+ event.action?.message ||+ event.action?.path ||+ pick(event.observation?.content) ||+ event.observation?.text ||+ [event.code, event.detail].filter(Boolean).join(": ") ||+ ""+ ).replace(/\s+/g, " ");+}++// The Open Workspace folder browser has no path field: walk it to PATH.+async function openWorkspace(run, name, { stay } = {}) {+ // A bare name resolves inside <run>/workspace, where fixtures live.+ const inRun = join(run.dir, "workspace", name);+ const path = !existsSync(name) && existsSync(inRun) ? inRun : name;+ if (!existsSync(path))+ throw new CliError(`No such folder: ${path}`, {+ code: 2,+ hint: "Create it first, for example: control-openhands fixture git-repo --name qa-repo",+ });+ const want = realpathSync(resolve(path));+ if (!stay) await browserCall(run, "goto", { target: "/" });+ await browserCall(run, "click", {+ selector: "testid=open-workspace-button",+ timeout: 30_000,+ });+ await browserCall(run, "click", { selector: "testid=workspace-dropdown" });+ await browserCall(run, "click", { selector: "testid=add-workspaces-button" });+ const walked = await browserCall(run, "pick-folder", {+ path: want,+ timeout: 30_000,+ });+ await browserCall(run, "click", { selector: "testid=folder-browser-use" });+ await browserCall(run, "click", {+ selector: "testid=workspace-launch-button",+ timeout: 30_000,+ });+ return { workspace: want, steps: walked.steps };+}++async function cmdWorkspace({ positional, flags }) {+ const run = loadRun(flags);+ const [sub, path] = positional;+ if (sub !== "open" || !path)+ usage(+ "Usage: control-openhands workspace open PATH [--stay]",+ "control-openhands workspace open qa-repo # a name resolves in <run>/workspace",+ );+ out({ ok: true, ...(await openWorkspace(run, path, { stay: flags.stay })) });+}++async function cmdConversation({ positional, flags }) {+ const run = loadRun(flags);+ const [sub, id] = positional;+ const timeoutSec = intFlag(flags.timeout, 300);+ if (sub === "start") {+ const prompt = flags.prompt;+ if (!prompt || prompt === true)+ usage(+ "conversation start needs --prompt",+ 'control-openhands conversation start --prompt "Create hello.py that prints hi, run it" --wait',+ );+ let picked;+ if (flags.workspace && flags.workspace !== true)+ picked = await openWorkspace(run, String(flags.workspace), {+ stay: flags.stay,+ });+ else if (!flags["stay"]) await browserCall(run, "goto", { target: "/" });+ // Home and conversation pages share the composer: a contenteditable+ // testid=chat-input with testid=submit-button beside it.+ await browserCall(run, "wait", {+ selector: "testid=chat-input",+ timeout: 30_000,+ });+ await browserCall(run, "fill", {+ selector: "testid=chat-input",+ value: prompt,+ });+ await browserCall(run, "click", { selector: "testid=submit-button" });+ const { url } = await browserCall(run, "wait-url", {+ pattern: "/conversations/[^/?#]+",+ timeout: 60_000,+ });+ const conversationId = /\/conversations\/([^/?#]+)/.exec(url)[1];+ const result = {+ ok: true,+ id: conversationId,+ url,+ workspace: picked?.workspace,+ };+ if (flags.wait)+ Object.assign(+ result,+ await waitConversation(run, conversationId, {+ until: flags.until,+ timeoutSec,+ }),+ );+ out(result);+ return;+ }+ if (sub === "wait") {+ if (!id)+ usage(+ "conversation wait <id>",+ "control-openhands conversation wait <id> --until finished,idle --timeout 300",+ );+ out({+ ok: true,+ ...(await waitConversation(run, id, {+ until: flags.until,+ timeoutSec,+ fresh: Boolean(flags.fresh),+ })),+ });+ return;+ }+ if (sub === "status") {+ if (!id) usage("conversation status <id>");+ out({ ok: true, ...summarize(await conversationInfo(run, id)) });+ return;+ }+ if (sub === "list") {+ const res = await http(run, "GET", "/api/conversations/search?limit=50");+ const items = res.json?.items ?? res.json ?? [];+ out({+ ok: res.ok,+ count: items.length,+ conversations: items.map(summarize),+ });+ return;+ }+ if (sub === "events") {+ if (!id) usage("conversation events <id> [--last N]");+ const last = intFlag(flags.last, 25);+ const res = await http(+ run,+ "GET",+ `/api/conversations/${encodeURIComponent(id)}/events/search?limit=100&sort_order=${flags["from-start"] ? "TIMESTAMP" : "TIMESTAMP_DESC"}`,+ );+ if (!res.ok)+ throw new CliError(+ `events: HTTP ${res.status} ${res.text.slice(0, 200)}`,+ );+ const fetched = res.json?.items ?? [];+ const items = flags["from-start"]+ ? fetched.slice(0, last)+ : fetched.slice(0, last).reverse();+ const grep =+ flags.grep && flags.grep !== true+ ? String(flags.grep).toLowerCase()+ : null;+ const kinds =+ flags.kinds && flags.kinds !== true+ ? String(flags.kinds).split(",")+ : null;+ const shown = items+ .filter((e) => !kinds || kinds.includes(e.kind))+ .map((e) => {+ const text = eventText(e);+ const max = flags.full ? 4000 : 160;+ const row = {+ kind: e.kind,+ source: e.source,+ tool: e.tool_name ?? e.action?.kind,+ text: text.slice(0, max),+ truncated: text.length > max || undefined,+ skills: e.activated_skills?.length ? e.activated_skills : undefined,+ tools: Array.isArray(e.tools)+ ? e.tools.map((tool) => tool.title || tool.name || tool.kind)+ : undefined,+ ts: e.timestamp,+ };+ if (grep) {+ // Search the whole event (system prompt, tool args, extended+ // content), not only the summarized text.+ const raw = JSON.stringify(e);+ const lower = raw.toLowerCase();+ const excerpts = [];+ let at = lower.indexOf(grep);+ let matches = 0;+ while (at >= 0) {+ matches += 1;+ if (excerpts.length < 3)+ excerpts.push(+ raw.slice(Math.max(0, at - 60), at + grep.length + 60),+ );+ at = lower.indexOf(grep, at + grep.length);+ }+ row.matches = matches;+ row.excerpts = excerpts.length ? excerpts : undefined;+ }+ return row;+ })+ .filter((row) => !grep || row.matches > 0);+ out({+ ok: true,+ total: fetched.length,+ count: shown.length,+ events: shown,+ });+ return;+ }+ if (sub === "pause") {+ // Arrange step (not UI proof): pause through the API, as the status+ // menu's Stop Runtime does, to reach paused-only states.+ if (!id) usage("conversation pause <id>");+ const before = await conversationInfo(run, id);+ // Local Stop Runtime interrupts (cancels the in-flight LLM call).+ const res = await http(+ run,+ "POST",+ `/api/conversations/${encodeURIComponent(id)}/interrupt`,+ );+ if (!res.ok)+ throw new CliError(+ `interrupt: HTTP ${res.status} ${res.text.slice(0, 200)}`,+ );+ if (before.execution_status !== "running") {+ out({+ ok: true,+ ...summarize(await conversationInfo(run, id)),+ note: `It was ${before.execution_status}: pause only changes a running conversation.`,+ });+ return;+ }+ out({+ ok: true,+ ...(await waitConversation(run, id, {+ until: "paused,idle,finished,error",+ timeoutSec: 90,+ })),+ });+ return;+ }+ if (sub === "send") {+ // A follow-up message through the conversation page's composer.+ const prompt = flags.prompt;+ if (!id || !prompt || prompt === true)+ usage(+ "conversation send <id> --prompt TEXT [--wait]",+ 'control-openhands conversation send <id> --prompt "Now add a test" --wait',+ );+ await browserCall(run, "goto", {+ target: `/conversations/${encodeURIComponent(id)}`,+ });+ await browserCall(run, "wait", {+ selector: "testid=chat-input",+ timeout: 30_000,+ });+ await browserCall(run, "fill", {+ selector: "testid=chat-input",+ value: String(prompt),+ });+ await browserCall(run, "click", { selector: "testid=submit-button" });+ const result = { ok: true, id, sent: String(prompt).length };+ if (flags.wait)+ Object.assign(+ result,+ await waitConversation(run, id, {+ until: flags.until,+ timeoutSec,+ fresh: true,+ }),+ );+ out(result);+ return;+ }+ usage(+ "Usage: control-openhands conversation start|send|wait|status|list|events|pause",+ 'control-openhands conversation start --prompt "..." --wait',+ );+}++// ---------------------------------------------------------------------------+// Commands: fixtures (disposable, inside the run directory).+// ---------------------------------------------------------------------------+function crc32(buf) {+ let c;+ const table = [];+ for (let n = 0; n < 256; n += 1) {+ c = n;+ for (let k = 0; k < 8; k += 1) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;+ table[n] = c >>> 0;+ }+ let crc = 0xffffffff;+ for (const byte of buf) crc = table[(crc ^ byte) & 0xff] ^ (crc >>> 8);+ return (crc ^ 0xffffffff) >>> 0;+}++function pngBytes(width, height, [r, g, b]) {+ const chunk = (type, data) => {+ const len = Buffer.alloc(4);+ len.writeUInt32BE(data.length);+ const body = Buffer.concat([Buffer.from(type), data]);+ const crc = Buffer.alloc(4);+ crc.writeUInt32BE(crc32(body));+ return Buffer.concat([len, body, crc]);+ };+ const header = Buffer.alloc(13);+ header.writeUInt32BE(width, 0);+ header.writeUInt32BE(height, 4);+ header[8] = 8;+ header[9] = 2;+ const rows = [];+ for (let y = 0; y < height; y += 1) {+ const row = Buffer.alloc(1 + width * 3);+ for (let x = 0; x < width; x += 1) {+ const stripe = Math.floor(x / (width / 4)) % 2 === 0;+ row[1 + x * 3] = stripe ? r : 255 - r;+ row[2 + x * 3] = stripe ? g : 255 - g;+ row[3 + x * 3] = stripe ? b : 255 - b;+ }+ rows.push(row);+ }+ return Buffer.concat([+ Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]),+ chunk("IHDR", header),+ chunk("IDAT", deflateSync(Buffer.concat(rows))),+ chunk("IEND", Buffer.alloc(0)),+ ]);+}++const MCP_FIXTURE_SOURCE = `#!/usr/bin/env node+// QA fixture: minimal MCP server over stdio (JSON-RPC 2.0, one tool).+import { appendFileSync } from "node:fs";+import { createInterface } from "node:readline";+const log = new URL("./requests.log", import.meta.url);+const send = (msg) => process.stdout.write(JSON.stringify(msg) + "\\n");+createInterface({ input: process.stdin }).on("line", (line) => {+ let req;+ try { req = JSON.parse(line); } catch { return; }+ const { id, method, params } = req;+ try { appendFileSync(log, new Date().toISOString() + " " + method + "\\n"); } catch {}+ if (id === undefined) return; // notifications+ if (method === "resources/list") return send({ jsonrpc: "2.0", id, result: { resources: [] } });+ if (method === "resources/templates/list") return send({ jsonrpc: "2.0", id, result: { resourceTemplates: [] } });+ if (method === "prompts/list") return send({ jsonrpc: "2.0", id, result: { prompts: [] } });+ if (method === "initialize")+ return send({ jsonrpc: "2.0", id, result: {+ protocolVersion: params?.protocolVersion ?? "2025-06-18",+ capabilities: { tools: {} },+ serverInfo: { name: "qa-mcp", version: "1.0.0" } } });+ if (method === "tools/list")+ return send({ jsonrpc: "2.0", id, result: { tools: [{+ name: "qa_echo",+ description: "Echo the given text back, prefixed with QA_ECHO:",+ inputSchema: { type: "object", properties: { text: { type: "string" } }, required: ["text"] } }] } });+ if (method === "tools/call")+ return send({ jsonrpc: "2.0", id, result: { content: [{ type: "text",+ text: "QA_ECHO: " + String(params?.arguments?.text ?? "") }] } });+ if (method === "ping") return send({ jsonrpc: "2.0", id, result: {} });+ send({ jsonrpc: "2.0", id, error: { code: -32601, message: "Method not found: " + method } });+});+`;++async function cmdFixture({ positional, flags }) {+ const run = loadRun(flags);+ const [kind] = positional;+ const workspace = join(run.dir, "workspace");+ const name =+ flags.name && flags.name !== true+ ? String(flags.name).replace(/[^\w.-]+/g, "_")+ : undefined;+ if (kind === "git-repo") {+ const dir = join(workspace, name ?? "qa-repo");+ if (existsSync(join(dir, ".git"))) {+ out({ ok: true, path: dir, existed: true });+ return;+ }+ mkdirSync(join(dir, "src"), { recursive: true });+ writeFileSync(+ join(dir, "README.md"),+ "# QA fixture repository\n\nDisposable repository created by control-openhands.\n",+ );+ writeFileSync(+ join(dir, "src", "calc.py"),+ "def add(a, b):\n return a + b\n",+ );+ writeFileSync(+ join(dir, "src", "test_calc.py"),+ "from calc import add\n\n\ndef test_add():\n assert add(2, 3) == 5\n",+ );+ const gitEnv = {+ ...process.env,+ GIT_AUTHOR_NAME: "QA Fixture",+ GIT_AUTHOR_EMAIL: "[email protected]",+ GIT_COMMITTER_NAME: "QA Fixture",+ GIT_COMMITTER_EMAIL: "[email protected]",+ };+ for (const args of [+ ["init", "-q", "-b", "main"],+ ["add", "."],+ ["commit", "-q", "-m", "Initial fixture commit"],+ ]) {+ execFileSync("git", args, { cwd: dir, env: gitEnv });+ }+ const remote =+ flags.remote && flags.remote !== true ? String(flags.remote) : undefined;+ // A remote URL lets the UI show repo/branch links and Pull/Push chips;+ // nothing is fetched or pushed.+ if (remote)+ execFileSync("git", ["remote", "add", "origin", remote], { cwd: dir });+ out({+ ok: true,+ path: dir,+ files: ["README.md", "src/calc.py", "src/test_calc.py"],+ branch: "main",+ remote,+ });+ return;+ }+ if (kind === "image") {+ const dir = join(run.dir, "evidence", "_fixtures");+ mkdirSync(dir, { recursive: true });+ const path = join(dir, `${name ?? "qa-image"}.png`);+ writeFileSync(+ path,+ pngBytes(+ intFlag(flags.width, 160),+ intFlag(flags.height, 96),+ [32, 120, 220],+ ),+ );+ out({ ok: true, path, bytes: readFileSync(path).length });+ return;+ }+ if (kind === "file") {+ const dir = join(run.dir, "evidence", "_fixtures");+ mkdirSync(dir, { recursive: true });+ const path = join(dir, name ?? "qa-note.txt");+ writeFileSync(+ path,+ flags.content && flags.content !== true+ ? String(flags.content)+ : "QA fixture file created by control-openhands.\n",+ );+ out({ ok: true, path });+ return;+ }+ if (kind === "tarball") {+ // A one-file script bundle for the automation "Upload tarball" action:+ // main.py prints pong, packed as <name>.tar.gz next to its source folder.+ const dir = join(run.dir, "evidence", "_fixtures");+ const base = name ?? "qa-tarball";+ const src = join(dir, base);+ mkdirSync(src, { recursive: true });+ writeFileSync(join(src, "main.py"), 'print("pong")\n');+ const path = join(dir, `${base}.tar.gz`);+ execFileSync("tar", ["-czf", path, "-C", src, "main.py"]);+ out({ ok: true, path, entrypoint: "python3 main.py", files: ["main.py"] });+ return;+ }+ if (kind === "mcp-server") {+ // A dependency-free stdio MCP server with one tool, qa_echo, for the+ // custom-server and agent-use recipes (no network, no npm install).+ const dir = join(workspace, name ?? "qa-mcp");+ mkdirSync(dir, { recursive: true });+ const path = join(dir, "server.mjs");+ writeFileSync(path, MCP_FIXTURE_SOURCE);+ out({+ ok: true,+ path,+ command: process.execPath,+ args: [path],+ tool: "qa_echo",+ hint: `Add a custom STDIO server with command ${process.execPath} and argument ${path}; ask the agent to call qa_echo.`,+ });+ return;+ }+ if (kind === "git-remote") {+ // A bare repository to push to (Git Sync, Push): a local "remote".+ const dir = join(workspace, `${name ?? "qa-remote"}.git`);+ if (!existsSync(dir))+ execFileSync("git", ["init", "-q", "--bare", "-b", "main", dir]);+ out({+ ok: true,+ path: dir,+ url: `file://${dir}`,+ hint: "Inspect what arrived with: git -C <path> log --oneline --all",+ });+ return;+ }+ if (kind === "skill") {+ // A personal skill under the run's private HOME, or a project skill in a+ // fixture repo (--repo NAME).+ const skillName = name ?? "qa-hello";+ const root =+ flags.repo && flags.repo !== true+ ? join(workspace, String(flags.repo))+ : join(run.dir, "private", "home");+ if (flags.repo && !existsSync(root))+ usage(+ `No fixture repo ${root}`,+ "control-openhands fixture git-repo --name qa-repo",+ );+ const dir = join(root, ".agents", "skills", skillName);+ mkdirSync(dir, { recursive: true });+ const trigger =+ flags.trigger && flags.trigger !== true+ ? String(flags.trigger)+ : undefined;+ const body =+ flags.body && flags.body !== true+ ? String(flags.body)+ : "When this skill is active, end your reply with the word QA_SKILL_OK.";+ const path = join(dir, "SKILL.md");+ writeFileSync(+ path,+ `---\nname: ${skillName}\ndescription: QA fixture skill created by control-openhands.\n${trigger ? `triggers:\n- ${trigger}\n` : ""}---\n\n${body}\n`,+ );+ out({+ ok: true,+ path,+ scope: flags.repo ? "project" : "user",+ hint: "Reload the page: the skills list is cached.",+ });+ return;+ }+ if (kind === "folder") {+ const dir = join(workspace, name ?? "qa-folder");+ mkdirSync(dir, { recursive: true });+ writeFileSync(join(dir, "notes.md"), "# QA folder fixture\n");+ out({ ok: true, path: dir });+ return;+ }+ usage(+ "Usage: control-openhands fixture git-repo|git-remote|folder|image|file|tarball|skill|mcp-server [--name N] [--remote URL]",+ "control-openhands fixture git-repo --name qa-repo",+ );+}++// ---------------------------------------------------------------------------+// Commands: browser.+// ---------------------------------------------------------------------------+// Central-directory listing of a .zip download (names only).+function zipEntries(buf, limit = 30) {+ const eocd = buf.lastIndexOf(Buffer.from([0x50, 0x4b, 0x05, 0x06]));+ if (eocd < 0 || eocd + 22 > buf.length) return undefined;+ const count = buf.readUInt16LE(eocd + 10);+ let off = buf.readUInt32LE(eocd + 16);+ const names = [];+ for (let i = 0; i < count && off + 46 <= buf.length; i += 1) {+ if (buf.readUInt32LE(off) !== 0x02014b50) break;+ const nameLen = buf.readUInt16LE(off + 28);+ const extraLen = buf.readUInt16LE(off + 30);+ const commentLen = buf.readUInt16LE(off + 32);+ names.push(buf.toString("utf8", off + 46, off + 46 + nameLen));+ off += 46 + nameLen + extraLen + commentLen;+ }+ return { count, names: names.slice(0, limit) };+}++// Member names of a .tar or .tar.gz download (ustar headers).+function tarEntries(buf, limit = 30) {+ let data = buf;+ if (buf.length > 2 && buf[0] === 0x1f && buf[1] === 0x8b) {+ try {+ data = gunzipSync(buf);+ } catch {+ return undefined;+ }+ }+ if (data.length < 512 || data.toString("latin1", 257, 262) !== "ustar")+ return undefined;+ const names = [];+ let count = 0;+ for (let off = 0; off + 512 <= data.length; ) {+ const name = data.toString("utf8", off, off + 100).replace(/\0.*$/s, "");+ if (!name) break;+ const prefix = data+ .toString("utf8", off + 345, off + 500)+ .replace(/\0.*$/s, "");+ const size = parseInt(+ data+ .toString("latin1", off + 124, off + 136)+ .replace(/\0.*$/s, "")+ .trim() || "0",+ 8,+ );+ count += 1;+ if (names.length < limit) names.push(prefix ? `${prefix}/${name}` : name);+ off += 512 + Math.ceil(size / 512) * 512;+ }+ return { gzip: data !== buf, count, names };+}++function inspectDownload(path, needle) {+ const buf = readFileSync(path);+ const info = { bytes: buf.length };+ const isZip = buf.length >= 4 && buf.readUInt32LE(0) === 0x04034b50;+ const tar = isZip ? undefined : tarEntries(buf);+ if (isZip) info.zip = zipEntries(buf);+ else if (tar) info.tar = tar;+ else if (!buf.subarray(0, 4096).includes(0))+ info.head = buf.toString("utf8", 0, 600);+ if (needle !== undefined)+ info.contains = isZip+ ? (zipEntries(buf, Infinity)?.names ?? []).some((n) => n.includes(needle))+ : tar+ ? (tarEntries(buf, Infinity)?.names ?? []).some((n) =>+ n.includes(needle),+ )+ : buf.toString("utf8").includes(needle);+ return info;+}++async function cmdBrowser({ positional, flags }) {+ const run = loadRun(flags);+ const [verb, ...rest] = positional;+ const timeout =+ flags.timeout !== undefined ? intFlag(flags.timeout) : undefined;+ const sel = rest[0];+ const need = (n, example) => {+ if (rest.length < n)+ usage(`browser ${verb} needs ${n} argument(s)`, example);+ };+ let result;+ switch (verb) {+ case "start":+ result = await startBrowser(run);+ break;+ case "stop":+ result = await stopBrowser(run);+ break;+ case "goto":+ case "open":+ result = await browserCall(run, "goto", {+ target: rest[0] ?? "/",+ allowExternal: Boolean(flags["allow-external"]),+ });+ break;+ case "reload":+ case "back":+ case "forward":+ case "url":+ case "tabs":+ result = await browserCall(run, verb);+ break;+ case "downloads": {+ result = await browserCall(run, verb);+ const last = intFlag(flags.last, 0);+ if (last) result.downloads = result.downloads.slice(-last);+ if (flags.inspect || flags.contains) {+ const needle =+ flags.contains && flags.contains !== true+ ? String(flags.contains)+ : undefined;+ for (const d of result.downloads)+ if (d.path && existsSync(d.path))+ d.inspect = inspectDownload(d.path, needle);+ }+ break;+ }+ case "click":+ case "dblclick": {+ need(1, `control-openhands browser ${verb} 'testid=submit-button'`);+ const position =+ flags.position && flags.position !== true+ ? (([x, y]) => ({ x: Number(x), y: Number(y) }))(+ String(flags.position).split(","),+ )+ : undefined;+ result = await browserCall(run, verb, {+ selector: sel,+ timeout,+ force: Boolean(flags.force),+ button: flags.button,+ modifiers:+ flags.modifiers && flags.modifiers !== true+ ? String(flags.modifiers).split(",")+ : undefined,+ position,+ expectUrl: flags["expect-url"],+ expectNewUrl: flags["expect-new-url"],+ hoverFirst: flags["hover-first"],+ observe: flags.observe,+ observeMs: flags["observe-ms"],+ });+ break;+ }+ case "mouse-click":+ need(2, "control-openhands browser mouse-click 20 400");+ result = await browserCall(run, "mouse-click", {+ x: rest[0],+ y: rest[1],+ button: flags.button,+ });+ break;+ case "tooltip":+ need(+ 1,+ "control-openhands browser tooltip 'testid=chat-dictation-button'",+ );+ result = await browserCall(run, "tooltip", { selector: sel, timeout });+ break;+ case "media":+ result = await browserCall(run, "media", { clear: Boolean(flags.clear) });+ break;+ case "toasts":+ result = await browserCall(run, "toasts", {+ history: Boolean(flags.history),+ clear: Boolean(flags.clear),+ });+ break;+ case "clipboard":+ result = await browserCall(run, "clipboard", {+ write:+ flags.write !== undefined && flags.write !== true+ ? String(flags.write)+ : undefined,+ });+ break;+ case "drag":+ need(+ 1,+ "control-openhands browser drag 'testid=card-a' 'testid=card-b' [--position before|after] | drag 'testid=divider' --by -200,0",+ );+ if (!rest[1] && !flags.by)+ usage("browser drag needs a target selector or --by DX,DY");+ result = await browserCall(run, "drag", {+ source: sel,+ target: rest[1],+ by: flags.by,+ steps: flags.steps,+ position: flags.position,+ });+ break;+ case "upload-via":+ need(+ 2,+ "control-openhands browser upload-via 'role=menuitem[name=\"Add Files and Images\"]' ./qa.png",+ );+ result = await browserCall(run, "upload-via", {+ trigger: sel,+ files: rest.slice(1).map((f) => resolve(f)),+ timeout,+ });+ break;+ case "drop-files":+ need(+ 2,+ "control-openhands browser drop-files 'testid=chat-input' ./qa.png",+ );+ result = await browserCall(run, "drop-files", {+ selector: sel,+ files: rest.slice(1).map((f) => resolve(f)),+ stage: flags.stage,+ });+ break;+ case "paste": {+ need(+ 1,+ "control-openhands browser paste 'testid=chat-input' --file ./qa.png",+ );+ const files = [].concat(flags.file ?? []).filter((f) => f !== true);+ result = await browserCall(run, "paste", {+ selector: sel,+ text:+ flags.text !== undefined && flags.text !== true+ ? String(flags.text)+ : undefined,+ files: files.map((f) => resolve(String(f))),+ });+ break;+ }+ case "choose":+ need(+ 2,+ "control-openhands browser choose 'label=Model' 'deepseek/deepseek-flash'",+ );+ result = await browserCall(run, "choose", {+ selector: sel,+ option: rest[1],+ timeout,+ });+ break;+ case "reset": {+ // A fresh browser profile: first-run state, empty localStorage, no+ // cached backend entries. The stack keeps running.+ const stopped = await stopBrowser(run);+ rmSync(join(run.dir, "private", "browser-profile"), {+ recursive: true,+ force: true,+ });+ result = { stopped, profileCleared: true, ...(await startBrowser(run)) };+ break;+ }+ case "network":+ result = await browserCall(run, "network", {+ clear: Boolean(flags.clear),+ external: Boolean(flags.external),+ last: flags.last,+ filter:+ flags.filter && flags.filter !== true ? flags.filter : undefined,+ });+ break;+ case "hover":+ case "focus":+ case "check":+ case "uncheck":+ case "count":+ case "visible":+ case "enabled":+ case "value":+ case "text":+ case "bbox":+ need(1, `control-openhands browser ${verb} 'testid=submit-button'`);+ result = await browserCall(run, verb, {+ selector: sel,+ timeout,+ force: Boolean(flags.force),+ button: flags.button,+ reveal: Boolean(flags.reveal),+ });+ break;+ case "fill":+ case "type": {+ need(+ 1,+ `control-openhands browser ${verb} 'testid=name-input' 'QA value'`,+ );+ let value = rest[1];+ if (flags["value-file"])+ value = readFileSync(resolve(flags["value-file"]), "utf8");+ if (flags["value-env"]) value = process.env[flags["value-env"]] ?? "";+ if (value === undefined)+ usage(`browser ${verb} needs a value (or --value-file / --value-env)`);+ result = await browserCall(run, verb, { selector: sel, value, timeout });+ break;+ }+ case "press":+ need(1, "control-openhands browser press Escape [--selector 'testid=x']");+ result = await browserCall(run, "press", {+ key: rest[0],+ selector: flags.selector,+ timeout,+ });+ break;+ case "select":+ need(2, "control-openhands browser select 'testid=x' value");+ result = await browserCall(run, "select", {+ selector: sel,+ value: rest[1],+ timeout,+ });+ break;+ case "upload":+ need(2, "control-openhands browser upload 'input[type=file]' ./file.png");+ result = await browserCall(run, "upload", {+ selector: sel,+ files: rest.slice(1).map((f) => resolve(f)),+ timeout,+ });+ break;+ case "scroll":+ result = await browserCall(run, "scroll", {+ selector: sel,+ by: flags.by,+ x: flags.x,+ timeout,+ });+ break;+ case "wait":+ need(+ 1,+ "control-openhands browser wait 'testid=x' [--state hidden] [--timeout 30000]",+ );+ result = await browserCall(run, "wait", {+ selector: sel,+ state: flags.state,+ timeout,+ });+ break;+ case "wait-url":+ need(1, "control-openhands browser wait-url '/settings/llm$'");+ result = await browserCall(run, "wait-url", {+ pattern: rest[0],+ timeout,+ });+ break;+ case "wait-text":+ need(1, "control-openhands browser wait-text 'Saved'");+ result = await browserCall(run, "wait-text", { text: rest[0], timeout });+ break;+ case "attr":+ need(2, "control-openhands browser attr 'testid=x' aria-expanded");+ result = await browserCall(run, "attr", {+ selector: sel,+ name: rest[1],+ timeout,+ });+ break;+ case "snapshot":+ result = await browserCall(run, "snapshot", {+ selector: sel,+ maxLines: flags["max-lines"],+ feature: flags.feature,+ name: flags.name,+ });+ break;+ case "testids":+ result = await browserCall(run, "testids", {+ selector: sel,+ includeHidden: Boolean(flags.hidden),+ });+ if (flags.filter)+ result.testids = result.testids.filter((t) =>+ t.testid.includes(flags.filter),+ );+ result.count = result.testids.length;+ break;+ case "screenshot":+ if (!flags.feature || !flags.name)+ usage(+ "browser screenshot needs --feature <ID> and --name <label>",+ "control-openhands browser screenshot --feature F14.create --name after-reload",+ );+ result = await browserCall(run, "screenshot", {+ feature: flags.feature,+ name: flags.name,+ selector: sel,+ fullPage: Boolean(flags["full-page"]),+ });+ break;+ case "viewport":+ need(+ 1,+ "control-openhands browser viewport phone # desktop|phone|narrow|tablet|WxH",+ );+ result = await browserCall(run, "viewport", { size: rest[0] });+ break;+ case "errors":+ result = await browserCall(run, "errors", {+ clear: Boolean(flags.clear),+ all: Boolean(flags.all),+ appOnly: Boolean(flags["app-only"]),+ noWarnings: Boolean(flags["no-warnings"]),+ });+ break;+ case "wait-tab":+ need(+ 1,+ "control-openhands browser wait-tab 'auth\\.openai\\.com' [--timeout 10000]",+ );+ result = await browserCall(run, "wait-tab", {+ pattern: rest[0],+ timeout,+ });+ break;+ case "events":+ result = await browserCall(run, "events", {+ kinds: flags.kinds,+ last: flags.last,+ });+ break;+ case "eval":+ need(1, 'control-openhands browser eval "document.title"');+ result = await browserCall(run, "eval", { expression: rest[0] });+ break;+ case "tab":+ need(1, "control-openhands browser tab 1");+ result = await browserCall(run, "tab", { index: rest[0] });+ break;+ case "close-tab":+ need(1, "control-openhands browser close-tab 1");+ result = await browserCall(run, "close-tab", { index: rest[0] });+ break;+ case "dialogs":+ result = await browserCall(run, "dialogs", { policy: flags.policy });+ break;+ case "storage":+ result = await browserCall(run, "storage", {+ keysOnly: !flags.values,+ session: Boolean(flags.session),+ });+ break;+ default:+ usage(+ `Unknown browser verb ${verb ?? ""}`,+ "control-openhands browser --help",+ );+ }+ out({ ok: true, ...result });+}++// ---------------------------------------------------------------------------+// Commands: evidence ledger.+// ---------------------------------------------------------------------------+const RESULTS = ["pass", "fail", "blocked", "not-run"];++async function cmdEvidence({ positional, flags }) {+ const run = loadRun(flags);+ const ledger = join(run.dir, "evidence", "ledger.jsonl");+ const [sub] = positional;+ if (sub === "add") {+ if (!flags.feature || !RESULTS.includes(flags.result)) {+ usage(+ "evidence add needs --feature ID and --result pass|fail|blocked|not-run",+ "control-openhands evidence add --feature F14.create --result pass --entry 'Settings > Secrets > Add' --expected 'row after reload' --actual 'row present' --artifact evidence/F14.create/after-reload.png",+ );+ }+ const artifacts = []+ .concat(flags.artifact ?? [])+ .filter((a) => a !== true)+ .flatMap((a) => String(a).split(","))+ .filter(Boolean);+ const missing = artifacts.filter((a) => !existsSync(resolve(run.dir, a)));+ if (missing.length) {+ throw new CliError(`Artifact not found: ${missing.join(", ")}`, {+ code: 2,+ hint: "Paths are relative to the run directory (for example evidence/F14.list/list.png) or absolute.",+ });+ }+ const page = daemonInfo(run)+ ? await browserCall(run, "url").catch(() => ({}))+ : {};+ const row = {+ ts: new Date().toISOString(),+ feature: flags.feature,+ entry: flags.entry === true ? undefined : flags.entry,+ result: flags.result,+ expected: flags.expected === true ? undefined : flags.expected,+ actual: flags.actual === true ? undefined : flags.actual,+ artifacts,+ note: flags.note === true ? undefined : flags.note,+ revision: run.revision,+ backend: `${run.mode} agent-server ${run.versions?.agentServer ?? "?"}`,+ url: page.url,+ viewport: page.viewport+ ? `${page.viewport.width}x${page.viewport.height}`+ : undefined,+ };+ appendFileSync(ledger, `${JSON.stringify(row)}\n`);+ const known = new Set(mapIdList().map((i) => i.id));+ const warning =+ known.has(row.feature) || /^BUG-/.test(row.feature)+ ? undefined+ : `${row.feature} is not a sub-feature ID in the map. Use an ID from the family's "## Sub-features" list (add it there first), or BUG-<id> for bug repros.`;+ out({ ok: true, recorded: row, warning });+ return;+ }+ if (sub === "retract") {+ if (!flags.feature)+ usage("evidence retract needs --feature ID [--entry E] [--note why]");+ const row = {+ ts: new Date().toISOString(),+ feature: flags.feature,+ entry: flags.entry === true ? undefined : flags.entry,+ retracted: true,+ note: flags.note === true ? undefined : flags.note,+ };+ appendFileSync(ledger, `${JSON.stringify(row)}\n`);+ out({ ok: true, retracted: row });+ return;+ }+ const rows = existsSync(ledger)+ ? readFileSync(ledger, "utf8")+ .trim()+ .split("\n")+ .filter(Boolean)+ .map((l) => JSON.parse(l))+ : [];+ if (sub === "list") {+ const filtered = flags.feature+ ? rows.filter((r) => r.feature.startsWith(flags.feature))+ : rows;+ out({ ok: true, count: filtered.length, rows: filtered });+ return;+ }+ if (sub === "report") {+ const latest = new Map();+ for (const row of rows) {+ const key = `${row.feature}|${row.entry ?? ""}`;+ if (row.retracted) {+ // A retraction without --entry drops every row of that feature.+ for (const k of [...latest.keys()]) {+ if (k === key || (!row.entry && k.startsWith(`${row.feature}|`)))+ latest.delete(k);+ }+ } else latest.set(key, row);+ }+ const counts = Object.fromEntries(RESULTS.map((r) => [r, 0]));+ for (const row of latest.values()) counts[row.result] += 1;+ const lines = [+ `# Verification ledger — run ${run.runId}`,+ "",+ `Revision \`${run.revision}\`, ${run.mode} mode, Agent Server ${run.versions?.agentServer ?? "?"}, base ${run.baseUrl}.`,+ "",+ `Checks: ${latest.size} — ${RESULTS.map((r) => `${r} ${counts[r]}`).join(", ")}.`,+ "",+ "| Feature/check | Entry point | Expected → actual | Result | Evidence |",+ "|---|---|---|---|---|",+ ];+ const cell = (v) =>+ String(v ?? "")+ .replace(/\|/g, "\\|")+ .replace(/\n/g, " ");+ for (const row of [...latest.values()].sort((a, b) =>+ a.feature.localeCompare(b.feature),+ )) {+ lines.push(+ `| ${cell(row.feature)} | ${cell(row.entry)} | ${cell(row.expected)} → ${cell(row.actual)} | ${row.result} | ${row.artifacts.map((a) => `\`${cell(relative(run.dir, resolve(run.dir, a)))}\``).join(" ")} |`,+ );+ }+ process.stdout.write(`${lines.join("\n")}\n`);+ return;+ }+ usage(+ "Usage: control-openhands evidence add|list|report",+ "control-openhands evidence report > report.md",+ );+}++// ---------------------------------------------------------------------------+// Commands: feature-map tooling (index hygiene and coverage).+// ---------------------------------------------------------------------------+const REQUIRED_H2 = [+ "Sub-features",+ "How to get to it (user POV)",+ "Driving it with control-openhands",+ "Gotchas",+];+const KNOWN_COMMANDS = new Set([+ "restart",+ "service",+ "launch",+ "status",+ "doctor",+ "stop",+ "env",+ "runs",+ "api",+ "llm",+ "login",+ "onboard",+ "conversation",+ "fixture",+ "workspace",+ "browser",+ "evidence",+ "map",+ "help",+]);+const BROWSER_VERBS = new Set([+ "start",+ "stop",+ "goto",+ "open",+ "reload",+ "back",+ "forward",+ "url",+ "tabs",+ "tab",+ "close-tab",+ "downloads",+ "click",+ "dblclick",+ "hover",+ "focus",+ "check",+ "uncheck",+ "count",+ "visible",+ "enabled",+ "value",+ "text",+ "bbox",+ "fill",+ "type",+ "press",+ "select",+ "upload",+ "scroll",+ "wait",+ "wait-url",+ "wait-text",+ "attr",+ "snapshot",+ "testids",+ "screenshot",+ "viewport",+ "errors",+ "events",+ "eval",+ "dialogs",+ "storage",+ "mouse-click",+ "tooltip",+ "media",+ "network",+ "toasts",+ "reset",+ "clipboard",+ "drag",+ "upload-via",+ "drop-files",+ "paste",+ "choose",+ "wait-tab",+]);++function featureFiles() {+ if (!existsSync(mapDir)) return [];+ return readdirSync(mapDir)+ .filter((f) => f.endsWith(".md") && f !== "README.md")+ .sort();+}++function mapCheck({ only } = {}) {+ const problems = [];+ const ids = new Map();+ const index = existsSync(join(mapDir, "README.md"))+ ? readFileSync(join(mapDir, "README.md"), "utf8")+ : "";+ if (!index) problems.push("references/feature-map/README.md is missing");+ const files = featureFiles();+ for (const file of files) {+ const text = readFileSync(join(mapDir, file), "utf8");+ // --file checks one entry while the index is being written by someone else.+ if (!only && !index.includes(`(${file})`) && !index.includes(`(./${file})`))+ problems.push(`${file}: not linked from README.md`);+ if (!/^# .+/m.test(text.split("\n")[0]))+ problems.push(`${file}: must start with an H1 title`);+ const h2 = [...text.matchAll(/^## (.+)$/gm)].map((m) => m[1].trim());+ if (JSON.stringify(h2) !== JSON.stringify(REQUIRED_H2))+ problems.push(+ `${file}: H2 sections must be exactly ${REQUIRED_H2.join(" / ")} (found ${h2.join(" / ")})`,+ );+ const sub =+ text.split(/^## /m).find((s) => s.startsWith("Sub-features")) ?? "";+ const declared = [...sub.matchAll(/`(F\d{2}\.[a-z0-9-]+)`/g)].map(+ (m) => m[1],+ );+ if (!declared.length)+ problems.push(`${file}: no sub-feature IDs like \`F01.example\``);+ for (const id of declared) {+ if (ids.has(id))+ problems.push(`${file}: duplicate ID ${id} (also in ${ids.get(id)})`);+ ids.set(id, file);+ }+ const drive =+ text.split(/^## /m).find((s) => s.startsWith("Driving it")) ?? "";+ if (!/^Preconditions:/m.test(drive))+ problems.push(+ `${file}: Driving section must start with "Preconditions:"`,+ );+ for (const m of text.matchAll(+ /control-openhands ([a-z-]+)(?: ([a-z-]+))?/g,+ )) {+ if (!KNOWN_COMMANDS.has(m[1]))+ problems.push(`${file}: unknown command \`control-openhands ${m[1]}\``);+ if (m[1] === "browser" && m[2] && !BROWSER_VERBS.has(m[2]))+ problems.push(`${file}: unknown browser verb \`${m[2]}\``);+ }+ for (const m of text.matchAll(/\]\((\.\.\/[^)#]+)/g)) {+ const target = resolve(mapDir, m[1]);+ if (!existsSync(target)) problems.push(`${file}: dead link ${m[1]}`);+ }+ }+ // References (`Fnn.slug` in prose, --feature Fnn.slug in recipes) must name+ // a declared ID once that family's file exists.+ const families = new Set(+ files.map((f) => /^(F\d{2})-/.exec(f)?.[1]).filter(Boolean),+ );+ for (const file of files) {+ if (only && file !== only) continue;+ const text = readFileSync(join(mapDir, file), "utf8");+ const refs = new Set();+ for (const m of text.matchAll(/`(F\d{2}\.[a-z0-9-]+)`/g)) refs.add(m[1]);+ for (const m of text.matchAll(/--feature (F\d{2}\.[a-z0-9-]+)/g))+ refs.add(m[1]);+ for (const ref of refs) {+ if (!ids.has(ref) && families.has(ref.slice(0, 3)))+ problems.push(`${file}: reference to unknown ID ${ref}`);+ }+ }+ for (const m of index.matchAll(/\]\(\.?\/?([A-Za-z0-9-]+\.md)\)/g)) {+ if (!existsSync(join(mapDir, m[1])))+ problems.push(`README.md: links missing file ${m[1]}`);+ }+ // The index's counts go stale whenever a family gains an ID; a whole-map+ // check compares them with the files.+ if (!only) {+ const counts = new Map();+ for (const file of ids.values())+ counts.set(file, (counts.get(file) ?? 0) + 1);+ for (const row of index.matchAll(+ /^\|\s*F\d{2}\s*\|\s*\[[^\]]*\]\(\.?\/?([A-Za-z0-9-]+\.md)\).*\|\s*(\d+)\s*\|\s*$/gm,+ )) {+ const actual = counts.get(row[1]) ?? 0;+ if (Number(row[2]) !== actual)+ problems.push(+ `README.md: ${row[1]} lists ${row[2]} sub-features, the file declares ${actual}`,+ );+ }+ const total = /(\d+) families, (\d+) sub-features/.exec(index);+ if (+ total &&+ (Number(total[1]) !== files.length || Number(total[2]) !== ids.size)+ )+ problems.push(+ `README.md: says "${total[0]}", the map has ${files.length} families and ${ids.size} sub-features`,+ );+ }+ return {+ files: files.length,+ ids: ids.size,+ checked: only ?? "all",+ problems,+ };+}++// Rewrites the README index's per-family sub-feature counts and its total+// from the files; everything else in the index is left as written.+function fixIndexCounts() {+ const path = join(mapDir, "README.md");+ if (!existsSync(path)) return;+ const counts = new Map();+ for (const { file } of mapIdList())+ counts.set(file, (counts.get(file) ?? 0) + 1);+ let total = 0;+ for (const n of counts.values()) total += n;+ const text = readFileSync(path, "utf8")+ .replace(+ /^(\|\s*F\d{2}\s*\|\s*\[[^\]]*\]\(\.?\/?([A-Za-z0-9-]+\.md)\).*\|\s*)(\d+)(\s*\|\s*)$/gm,+ (row, head, file, n, tail) =>+ counts.has(file) ? `${head}${counts.get(file)}${tail}` : row,+ )+ .replace(+ /(\d+) families, (\d+) sub-features/,+ `${featureFiles().length} families, ${total} sub-features`,+ );+ writeFileSync(path, text);+}++function routePaths() {+ const source = readFileSync(join(repoRoot, "src", "routes.ts"), "utf8");+ const routes = [];+ // route("settings", "routes/settings.tsx", [ ...children ]) nests by brackets.+ const parents = [];+ let lastRoutePath;+ const tokens = source.matchAll(+ /(route|index)\(\s*(?:"([^"]*)"\s*,\s*)?"(routes\/[^"]+)"|\[|\]/g,+ );+ for (const t of tokens) {+ if (t[0] === "[") {+ parents.push(lastRoutePath);+ lastRoutePath = undefined;+ continue;+ }+ if (t[0] === "]") {+ parents.pop();+ continue;+ }+ const prefix = parents.filter(Boolean).join("/");+ const path =+ t[1] === "index"+ ? `/${prefix}`+ : `/${[prefix, t[2]].filter(Boolean).join("/")}`;+ routes.push({ path: path.replace(/\/+/g, "/"), file: `src/${t[3]}` });+ lastRoutePath = t[1] === "route" ? t[2] : undefined;+ }+ return routes;+}++function mapCoverage() {+ const corpus = featureFiles()+ .map((f) => readFileSync(join(mapDir, f), "utf8"))+ .join("\n");+ // The index's "## Not mapped" section lists deliberate exclusions with a+ // reason; they are reported as excluded, not as gaps.+ const index = existsSync(join(mapDir, "README.md"))+ ? readFileSync(join(mapDir, "README.md"), "utf8")+ : "";+ const notMapped = (index.split(/^## Not mapped/m)[1] ?? "").split(/^## /m)[0];+ const routes = routePaths().map((r) => {+ const pattern = routePattern(r.path);+ const byPath = pattern.test(corpus);+ return {+ ...r,+ byPath,+ mapped: byPath || corpus.includes(r.file),+ excluded: pattern.test(notMapped),+ };+ });+ const featureDirs = existsSync(+ join(repoRoot, "src", "components", "features"),+ )+ ? readdirSync(join(repoRoot, "src", "components", "features"), {+ withFileTypes: true,+ })+ .filter((d) => d.isDirectory())+ .map((d) => d.name)+ : [];+ const components = featureDirs.map((name) => ({+ dir: `src/components/features/${name}`,+ mapped: corpus.includes(`components/features/${name}`),+ excluded: notMapped.includes(`components/features/${name}`),+ }));+ return {+ routes: {+ total: routes.length,+ unmapped: routes.filter((r) => !r.mapped && !r.excluded),+ excluded: routes.filter((r) => !r.mapped && r.excluded),+ // Counted as mapped only because their route module is cited: worth+ // documenting the user-facing path too.+ fileOnly: routes.filter((r) => r.mapped && !r.byPath).map((r) => r.path),+ },+ featureComponentDirs: {+ total: components.length,+ unmapped: components+ .filter((c) => !c.mapped && !c.excluded)+ .map((c) => c.dir),+ excluded: components+ .filter((c) => !c.mapped && c.excluded)+ .map((c) => c.dir),+ },+ };+}++function mapIdList() {+ const ids = [];+ for (const file of featureFiles()) {+ const text = readFileSync(join(mapDir, file), "utf8");+ const section =+ text.split(/^## /m).find((s) => s.startsWith("Sub-features")) ?? "";+ for (const m of section.matchAll(/^- `(F\d{2}\.[a-z0-9-]+)`:?\s*(.*)$/gm))+ ids.push({ id: m[1], file, summary: m[2].slice(0, 100) });+ }+ return ids;+}++async function cmdMap({ positional, flags }) {+ const [sub] = positional;+ if (sub === "check") {+ const only =+ flags.file && flags.file !== true+ ? basename(String(flags.file))+ : undefined;+ if (flags["fix-counts"] && !only) fixIndexCounts();+ const result = mapCheck({ only });+ if (only) {+ result.problems = result.problems.filter(+ (p) => p.startsWith(`${only}:`) || p.includes(`(also in ${only})`),+ );+ }+ out({ ok: result.problems.length === 0, ...result });+ if (result.problems.length) process.exitCode = 1;+ return;+ }+ if (sub === "coverage") {+ const result = mapCoverage();+ const ok =+ result.routes.unmapped.length === 0 &&+ result.featureComponentDirs.unmapped.length === 0;+ out({ ok, ...result });+ if (!ok) process.exitCode = 1;+ return;+ }+ if (sub === "ids") {+ const ids = mapIdList();+ out({ ok: true, count: ids.length, ids });+ return;+ }+ if (sub === "routes") {+ out({ ok: true, routes: routePaths() });+ return;+ }+ usage(+ "Usage: control-openhands map check|coverage|ids|routes",+ "control-openhands map coverage",+ );+}++// ---------------------------------------------------------------------------+// Help and dispatch.+// ---------------------------------------------------------------------------+const HELP = {+ login: `control-openhands login++Public-mode runs only: types the run's session key into whichever prompt the UI+shows (the onboarding "Add a backend" step, or api-key-entry-screen, filling+Host Name when empty). Never prints the key. Local-mode runs need no login.+`,+ restart: `control-openhands restart [--rotate-key] [--timeout SEC]++Stops this run's launcher process group and starts it again with the same+state directory, port block and keys, then waits for readiness. It asks the+checkout's launcher again whether it serves VS Code and adds or drops the+editor port to match, with a warning; when a newly needed editor port is busy+it refuses before stopping anything. --rotate-key writes a new session key+first, so the browser's stored key becomes stale (public mode then shows the+API-key prompt again). Reload the browser afterwards.+`,+ service: `control-openhands service status+control-openhands service stop automation|agent-server|frontend++Stops one service inside this run's own process group so unavailable/backend-down+states can be driven through the UI. Bring everything back with restart.+`,+ status: `control-openhands status — ports, revision, launcher and browser liveness of the current run.+`,+ runs: `control-openhands runs — every run under $OH_VERIFY_HOME with liveness.+`,+ env: `control-openhands env — export lines (OH_VERIFY_RUN, OH_VERIFY_BASE_URL) for this run.+`,+ _: `control-openhands — drive a real, isolated Agent Canvas stack like a user.++Usage: control-openhands <command> [args] [--run <dir>]++Lifecycle+ launch Build this checkout if needed, start an isolated stack + browser+ doctor Read-only health check; run first and after any surprise+ status Show the current run's ports, revision and liveness+ restart Restart this run's stack in place (same state); --rotate-key for stale-key states+ service status | stop automation|agent-server|frontend (drive backend-down states)+ stop Stop this run's browser and launcher process group (keeps evidence)+ runs List runs under $OH_VERIFY_HOME+ env Print export lines for this run++Arrange (preconditions, never UI proof)+ api Call this run's API with its session key (writes need --write)+ llm show | set | preset deepseek | check — configure LLM profiles from an env key+ fixture git-repo | folder | image | file — disposable fixtures in the run++Essential pathways (driven through the real UI)+ login Public mode: enter the session key on the API-key screen+ onboard Telemetry consent + onboarding modal (--skip, or walk it with --agent)+ workspace open PATH — pick a folder through Open Workspace (folder browser)+ conversation start --prompt "..." [--wait] [--workspace PATH] | send | wait | status | list | events | pause++Drive and observe+ browser goto/click/fill/press/wait/text/snapshot/testids/screenshot/viewport/errors/...++Evidence and map+ evidence add | list | report — the run's pass/fail/blocked/not-run ledger+ map check | coverage | ids | routes — keep the feature map honest++Run state lives in $OH_VERIFY_HOME (default: $TMPDIR/openhands-verify); the+current run is the 'current' symlink there, or --run / $OH_VERIFY_RUN.+Output is JSON. Exit: 0 ok, 1 action failed, 2 usage, 3 environment/doctor.++Examples:+ control-openhands launch+ control-openhands doctor+ control-openhands llm preset deepseek # reads DEEPSEEK_API_KEY+ control-openhands onboard --skip+ control-openhands conversation start --prompt "Create hello.py printing hi and run it" --wait+ control-openhands browser goto /settings/secrets+ control-openhands browser click 'testid=add-secret-button'+ control-openhands browser screenshot --feature F14.create --name form+ control-openhands stop+`,+ launch: `control-openhands launch [--public] [--new] [--print-run] [--port N | --port-from N] [--build auto|always|never] [--min-free-mb 2000]+ [--no-browser] [--timeout SEC] [--sdk-path DIR | --sdk-ref REF | --sdk-version V]+ [--automation-path DIR | --automation-ref REF | --automation-version V] [--run-id ID] [--vscode]++Builds the checkout when build/verify-revision.txt does not match HEAD, then+starts bin/agent-canvas.mjs with a private HOME, state dir, session key and+encryption key, on a free port block (ingress P, agent-server P+1, automation+P+2, static frontend P+3). The editor port (P+1001) is reserved, and listed in+ports, only when the checkout's launcher serves VS Code. Where that is opt-in+(#17660), --vscode (OH_CANVAS_ENABLE_VSCODE=true) turns it on; where the editor+is bundled (before #17660, or since #18048), it is always reserved and --vscode+changes nothing. Waits for authenticated settings, automation health and the+SPA, then starts the browser daemon.+Idempotent: an alive current run is reused unless --new is given.+--print-run prints only the run directory, for+ export OH_VERIFY_RUN=$(control-openhands launch --new --print-run)+Every other command uses --run, else $OH_VERIFY_RUN, else the only live run;+with several live runs it refuses to guess (several agents on one machine).+Backend versions and VS Code come only from the flags: OH_AGENT_SERVER_*,+OH_AUTOMATION_* and OH_CANVAS_ENABLE_VSCODE in your shell are not forwarded+(launch warns). An Agent Server below+config/defaults.json compatibility.minimumAgentServer never gets+past the UI's backend-compatibility gate.++Environment: OH_VERIFY_HOME, CONTROL_OPENHANDS_BROWSER (Chromium path),+CONTROL_OPENHANDS_BROWSER_ARGS (extra Chromium flags), CONTROL_OPENHANDS_HEADED=1,+CONTROL_OPENHANDS_TRUST_CA=<pem>[,<pem>] (pin a TLS-intercepting proxy's CAs),+CONTROL_OPENHANDS_IGNORE_HTTPS_ERRORS=1 (sandboxes with leaf-only interception; never in CI).++Examples:+ control-openhands launch+ control-openhands launch --public --new+ control-openhands launch --sdk-path ../software-agent-sdk --build always+`,+ doctor: `control-openhands doctor [--skip-ui]++Read-only. Checks launcher group and ports, served build revision, unauthenticated+rejection, authenticated settings, agent-server version vs config/defaults.json+(pin, and the UI's minimum Agent Server version), automation health, LLM configuration (info) and a throwaway-tab UI probe.+Exit 3 when any check fails.+`,+ stop: `control-openhands stop [--purge-private]++Stops the browser daemon and SIGTERMs the launcher's process group (SIGKILL+after 30 s), verifies every run port closed and counts evidence files.+--purge-private then deletes private/ (keys, state, logs) and recounts evidence.+`,+ api: `control-openhands api <METHOD> </path> [--data JSON|@file | --data-file F --content-type T] [--write] [--pick a.b.c] [--max-bytes N]++Sends the run's session key only to the run's own origin. Non-GET needs --write:+use it to arrange preconditions, never as proof that a UI path works.++Examples:+ control-openhands api GET /api/settings+ control-openhands api GET /api/conversations/search?limit=5+ control-openhands api DELETE /api/settings/secrets/QA_TMP --write+`,+ llm: `control-openhands llm show+control-openhands llm preset deepseek [--api-key-env DEEPSEEK_API_KEY | --api-key-file PATH]+control-openhands llm set --profile NAME --model MODEL (--api-key-env VAR | --api-key-file PATH) [--base-url URL] [--no-activate]+control-openhands llm check --model MODEL (--api-key-env VAR | --api-key-file PATH) [--base-url URL]++set/preset validate with a 1-token completion first (skip with --no-validate).+Keys are read from an environment variable or file, never from argv.+'preset deepseek' saves deepseek-flash (deepseek/deepseek-flash, activated) and+deepseek-pro (deepseek/deepseek-v4-pro). Prefer flash; it is cheaper.++Examples:+ DEEPSEEK_API_KEY=... control-openhands llm preset deepseek+ control-openhands llm set --profile alt --model deepseek/deepseek-v4-pro --api-key-env DEEPSEEK_API_KEY --no-activate+`,+ onboard: `control-openhands onboard [--skip] [--agent openhands|claude-code|codex|gemini-cli] [--analytics on|off]++Answers the telemetry consent form (analytics off by default) and then either+skips the onboarding modal (--skip) or walks it: choose agent → keep current LLM+settings → close at say-hello. Skipping is not proof that onboarding works.+`,+ conversation: `control-openhands conversation start --prompt TEXT [--wait] [--until STATES] [--timeout SEC] [--stay] [--workspace PATH]+control-openhands conversation wait ID [--until finished,idle] [--timeout SEC] [--fresh]+ (--fresh after sending a message: ignore the previous run's terminal status)+control-openhands conversation send ID --prompt TEXT [--wait] follow-up message through the composer+control-openhands conversation pause ID arrange an interrupted conversation (API, as local Stop Runtime; not UI proof)+control-openhands conversation status ID+control-openhands conversation list+control-openhands conversation events ID [--last N] [--kinds MessageEvent,ActionEvent] [--full]+ [--grep TEXT] [--from-start]+ (texts are cut at 160 chars with truncated:true; --full keeps up to 4000;+ --grep searches whole events, e.g. the SystemPromptEvent with --from-start;+ rows show activated skills and, for the system prompt, the tool names)++'start' types into the home composer (testid=chat-input), presses+testid=submit-button and returns the new /conversations/<id>. --stay uses the+current page's composer instead of navigating home first. --workspace PATH+first picks that folder through Open Workspace (see 'workspace open'), so the+conversation runs in it. 'wait' polls the+conversation's execution_status until one of --until (default: any terminal).++Examples:+ control-openhands conversation start --prompt "Create hello.py that prints hi and run it" --wait --timeout 300+ control-openhands conversation events <id> --last 10+`,+ fixture: `control-openhands fixture git-repo [--name qa-repo] [--remote https://github.com/qa-example/qa-repo.git]+ # git repo in <run>/workspace (README, src/calc.py, test); --remote only sets origin+control-openhands fixture git-remote [--name qa-remote] # bare repo <run>/workspace/qa-remote.git to push to+control-openhands fixture mcp-server [--name qa-mcp] # stdio MCP server (tool qa_echo); prints command and args+control-openhands fixture folder [--name qa-folder]+control-openhands fixture image [--name qa-image] [--width 160 --height 96] # PNG under evidence/_fixtures+control-openhands fixture file [--name qa-note.txt] [--content TEXT]+control-openhands fixture tarball [--name qa-tarball] # evidence/_fixtures/qa-tarball.tar.gz (main.py prints pong)+control-openhands fixture skill [--name qa-hello] [--repo qa-repo] [--trigger qa-ping] [--body TEXT]+ # SKILL.md in the run's private ~/.agents/skills, or in a fixture repo's .agents/skills+`,+ workspace: `control-openhands workspace open PATH|NAME [--stay]++NAME (no slash) resolves inside <run>/workspace, where 'fixture' creates repos.++Drives Home > Open Workspace > workspace dropdown > + Add Workspace, walks the+folder browser (folder-browser-up / folder-browser-entry-<name>) to PATH,+clicks Use and Launch. The composer then carries the workspace chip; follow+with 'conversation start --stay', or use 'conversation start --workspace PATH'.++Example:+ control-openhands fixture git-repo --name qa-repo+ control-openhands conversation start --workspace qa-repo --prompt "List the files" --wait+`,+ browser: `control-openhands browser <verb> [selector] [args]++Selectors: segments joined by ' >> ', each one of+ testid=ID role=button[name="Save"][exact] text=Partial text="Exact"+ label=Name placeholder=Text title=Text alt=Text nth=0 has-text=Text+ visible or any Playwright/CSS selector+Example: 'testid=add-secret-form >> testid=submit-button'++Verbs+ start | stop daemon lifecycle (launch starts it)+ goto <path> [--allow-external] navigate (run origin only by default)+ reload | back | forward | url+ click|dblclick <sel> [--force] [--timeout MS] [--button left|middle|right]+ [--modifiers Control,Meta,Shift,Alt] [--position X,Y] (offset inside the element)+ [--expect-url REGEX] (wait for client-side navigation; click returns the old URL otherwise)+ [--expect-new-url REGEX] (wait for a URL that differs from the pre-click one)+ [--hover-first [MS]] (hover, settle, then click: hover-driven toggles)+ [--observe SEL [--observe-ms 3000]] (record transient states such as "Saving..."; SEL uses the same syntax)+ hover|focus|check|uncheck <sel> (hidden <input> switches: click their label instead)+ mouse-click X Y [--button B] click at viewport coordinates (backdrops, overlays)+ tooltip <sel> hover and return the role=tooltip text (or the title attribute)+ fill|type <sel> [<value> | --value-file F | --value-env VAR] (prefer the file/env forms for keys)+ press <Key> [--selector S] e.g. Escape, Enter, Control+k, Meta+k+ select <sel> <value> | upload <sel> <file...> | scroll [<sel>] [--by PX] [--x PX]+ upload-via <trigger-sel> <file...> click a button/menu item and answer the real file chooser+ drop-files <sel> <file...> [--stage enter|over] files dragged in from the desktop+ paste <sel> [--text T] [--file F]... a paste event carrying text and/or files+ drag <sel> <target-sel> [--position before|after] | drag <sel> --by DX,DY [--steps N]+ choose <combobox-sel> <option label> open an autocomplete, filter, click the option+ clipboard [--write TEXT] read (or arrange) the clipboard; Copy buttons write it+ wait <sel> [--state visible|hidden|attached|detached] | wait-url <regex> | wait-text <text>+ text|value|count|visible|enabled|bbox <sel> | attr <sel> <name>+ (password values are masked in value, snapshot and testids; value --reveal shows one)+ snapshot [<sel>] [--max-lines N] [--feature ID --name N] ARIA tree (saved as evidence)+ testids [<sel>] [--hidden] [--filter part] discover on-screen data-testid handles (--hidden adds hidden/off-screen)+ screenshot [<sel>] --feature ID --name N [--full-page] PNG under evidence/<ID>/+ viewport desktop|phone|narrow|tablet|WxH 1440x1000, 390x844, 320x700, 820x1180+ errors [--clear] [--all] [--app-only] [--no-warnings] page/console/HTTP errors since last clear+ (--clear prints the list, then empties it: run it before the action)+ events [--kinds pageerror,dialog,download] [--last N]+ eval <js expression> read-only inspection; never mutate app state with it+ tabs | tab <i> | close-tab <i> | dialogs [--policy accept|dismiss]+ wait-tab <url-regex> [--timeout MS] wait for a pop-up (window.open) whose URL matches; prints its index+ downloads [--last N] [--inspect] [--contains TEXT] saved files; --inspect adds a text head or zip entry names+ storage [--session] [--values] localStorage (or sessionStorage) keys; values only on request+ (keys, tokens and secrets inside values are redacted)+ media [--clear] media playback recorded since load (sound features)+ network [--external] [--filter REGEX] [--clear] [--last N] requests with status and redacted query (rows under "recent")+ (privacy/telemetry checks; --clear as for errors)+ toasts [--history [--clear]] toasts on screen now (with links); --history adds every+ status/alert text seen since this page loaded+ reset fresh browser profile (first-run state); the stack keeps running+ scroll <sel> --by PX scroll the element's scrollable container (settings, panels)+ scroll <sel> | scroll --by PX bring into view | wheel at the mouse position++Long waits: pass --timeout 5000 for elements that may never appear; defaults are 30 s.+Placeholders in map recipes use <angle-brackets> (for example <id> from conversation start).++Failures return {ok:false,error,hint,failureScreenshot} and exit 1.+`,+ evidence: `control-openhands evidence add --feature ID --result pass|fail|blocked|not-run+ [--entry "UI path"] [--expected TEXT] [--actual TEXT] [--artifact path[,path]] [--note TEXT]+control-openhands evidence retract --feature ID [--entry "UI path"] [--note why] drop a wrong row from the report+control-openhands evidence list [--feature F05]+control-openhands evidence report > report.md+`,+ map: `control-openhands map check [--file Fnn-name.md] lint the map (or one entry, skipping index links): four H2s, unique IDs, links, known commands, index counts+control-openhands map check --fix-counts rewrite the index's sub-feature counts and total from the files, then lint+control-openhands map coverage routes in src/routes.ts and src/components/features/* dirs not yet mapped+control-openhands map ids every sub-feature ID with its file+control-openhands map routes the route registry as path → route module+`,+};++const COMMANDS = {+ launch: cmdLaunch,+ status: cmdStatus,+ doctor: cmdDoctor,+ stop: cmdStop,+ env: cmdEnv,+ runs: cmdRuns,+ api: cmdApi,+ llm: cmdLlm,+ login: cmdLogin,+ restart: cmdRestart,+ service: cmdService,+ onboard: cmdOnboard,+ conversation: cmdConversation,+ fixture: cmdFixture,+ workspace: cmdWorkspace,+ browser: cmdBrowser,+ evidence: cmdEvidence,+ map: cmdMap,+};++async function main() {+ // Global flags such as --run DIR may come before the command.+ let argv = process.argv.slice(2);+ const leading = [];+ while (argv[0]?.startsWith("--") && !["--help", "-h"].includes(argv[0])) {+ const takesValue =+ !argv[0].includes("=") &&+ argv[1] !== undefined &&+ !argv[1].startsWith("--");+ leading.push(...argv.slice(0, takesValue ? 2 : 1));+ argv = argv.slice(takesValue ? 2 : 1);+ }+ const [command, ...afterCommand] = argv;+ const rest = [...afterCommand, ...leading];+ if (+ !command ||+ command === "--help" ||+ command === "-h" ||+ command === "help"+ ) {+ process.stdout.write(HELP[rest[0]] ?? HELP._);+ return;+ }+ const parsed = parseArgs(rest);+ if (parsed.flags.help || parsed.flags.h) {+ process.stdout.write(HELP[command] ?? HELP._);+ return;+ }+ const handler = COMMANDS[command];+ if (!handler) usage(`Unknown command ${command}`, "control-openhands --help");+ await handler(parsed);+}++main().catch((error) => {+ if (error instanceof CliError) {+ out({+ ok: false,+ error: error.message,+ hint: error.hint,+ ...(error.extra ?? {}),+ });+ process.exitCode = error.code;+ return;+ }+ out({ ok: false, error: String(error?.stack ?? error) });+ process.exitCode = 1;+});diff --git a/.agents/skills/verify-openhands/scripts/control-openhands.test.mjs b/.agents/skills/verify-openhands/scripts/control-openhands.test.mjsnew file mode 100755index 0000000000..4c583219b0--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/control-openhands.test.mjs@@ -0,0 +1,621 @@+// Fast checks for control-openhands that need no browser or running stack.+// They run with the rest of the suite (`npm test`), or alone:+// npx vitest run .agents/skills/verify-openhands+import assert from "node:assert/strict";+import { spawnSync } from "node:child_process";+import {+ existsSync,+ mkdirSync,+ mkdtempSync,+ readFileSync,+ readdirSync,+ writeFileSync,+} from "node:fs";+import { createServer } from "node:net";+import { tmpdir } from "node:os";+import { dirname, join, relative, resolve } from "node:path";+import { fileURLToPath } from "node:url";+import { test } from "vitest";+import { buildIdentity } from "./lib/build-id.mjs";+import { BUILD_INPUTS } from "./lib/build-inputs.mjs";+import {+ editorOffset,+ launcherEnvFor,+ portsAfterRestart,+ runPorts,+} from "./lib/launcher-env.mjs";+import { redactStorage, redactStorageValue } from "./lib/redact-storage.mjs";+import { routePattern } from "./lib/route-pattern.mjs";+import { buildLocator, parseRole, toCss } from "./lib/selectors.mjs";++const here = dirname(fileURLToPath(import.meta.url));+const cli = join(here, "control-openhands.mjs");++// A fake Playwright scope that records the locator chain it was asked for.+function recorder(path = []) {+ const step =+ (name) =>+ (...args) =>+ recorder([...path, [name, ...args]]);+ return {+ path,+ getByTestId: step("getByTestId"),+ getByRole: step("getByRole"),+ getByText: step("getByText"),+ getByLabel: step("getByLabel"),+ getByPlaceholder: step("getByPlaceholder"),+ getByTitle: step("getByTitle"),+ getByAltText: step("getByAltText"),+ nth: step("nth"),+ filter: step("filter"),+ locator: step("locator"),+ };+}++function run(args, env = {}) {+ const result = spawnSync(process.execPath, [cli, ...args], {+ encoding: "utf8",+ env: {+ ...process.env,+ OH_VERIFY_HOME: mkdtempSync(join(tmpdir(), "cov-")),+ OH_VERIFY_RUN: "",+ ...env,+ },+ });+ let json;+ try {+ json = JSON.parse(result.stdout);+ } catch {+ json = undefined;+ }+ return { ...result, json };+}++test("scoped testid chain builds nested locators", () => {+ const loc = buildLocator(+ recorder(),+ "testid=add-secret-form >> testid=submit-button",+ );+ assert.deepEqual(loc.path, [+ ["getByTestId", "add-secret-form"],+ ["getByTestId", "submit-button"],+ ]);+});++test("role selectors carry name, exactness and state options", () => {+ assert.deepEqual(parseRole('button[name="Save"][exact]'), {+ role: "button",+ options: { name: "Save", exact: true },+ });+ assert.deepEqual(parseRole("checkbox[checked=false]").options, {+ checked: false,+ });+ const regex = parseRole('link[name="/^Docs/i"]').options.name;+ assert.ok(regex instanceof RegExp && regex.test("docs page"));+ assert.ok(+ parseRole('option[name^="deepseek-pro"]').options.name.test(+ "deepseek-pro (default)",+ ),+ );+ assert.ok(+ !parseRole('option[name^="pro"]').options.name.test("deepseek-pro"),+ );+ assert.ok(+ parseRole('button[name*="SAVE"]').options.name.test("Save changes"),+ );+ assert.throws(+ () => parseRole("button[colour=red]"),+ /Unsupported role attribute/,+ );+});++test("testid segments accept attribute filters", () => {+ const loc = buildLocator(+ recorder(),+ 'testid=onboarding-modal[data-current-step="1"]',+ );+ assert.deepEqual(loc.path, [+ ["locator", '[data-testid="onboarding-modal"][data-current-step="1"]'],+ ]);+});++test("quoted text is exact, bare text is partial, other segments pass through", () => {+ const loc = buildLocator(+ recorder(),+ 'text="Secrets" >> text=Sec >> has-text=QA_ >> nth=1 >> visible >> input[type=file]',+ );+ assert.deepEqual(loc.path, [+ ["getByText", "Secrets", { exact: true }],+ ["getByText", "Sec", { exact: false }],+ ["filter", { hasText: "QA_" }],+ ["nth", 1],+ ["filter", { visible: true }],+ ["locator", "input[type=file]"],+ ]);+});++test("--help lists every command family with examples", () => {+ const { status, stdout } = run(["--help"]);+ assert.equal(status, 0);+ for (const word of [+ "launch",+ "doctor",+ "browser",+ "conversation",+ "evidence",+ "map",+ "Examples:",+ ]) {+ assert.match(stdout, new RegExp(word));+ }+ assert.match(run(["browser", "--help"]).stdout, /testids/);+});++test("usage errors exit 2 with a hint; a missing run exits 3", () => {+ const unknown = run(["frobnicate"]);+ assert.equal(unknown.status, 2);+ assert.equal(unknown.json.ok, false);+ assert.ok(unknown.json.hint);+ const noRun = run(["doctor"]);+ assert.equal(noRun.status, 3);+ assert.match(noRun.json.hint, /control-openhands launch/);+});++test("keys are refused on argv before any request is made", () => {+ const dir = mkdtempSync(join(tmpdir(), "cov-run-"));+ mkdirSync(join(dir, "private"));+ writeFileSync(join(dir, "private", "session-key"), "x".repeat(64));+ writeFileSync(+ join(dir, "run.json"),+ JSON.stringify({+ baseUrl: "http://127.0.0.1:9",+ ports: { ingress: 9 },+ launcherPgid: 0,+ }),+ );+ const result = run(+ ["llm", "set", "--profile", "x", "--model", "m", "--api-key", "secret"],+ { OH_VERIFY_RUN: dir },+ );+ assert.equal(result.status, 2);+ assert.match(result.json.error, /Do not pass keys on the command line/);+ assert.doesNotMatch(result.stdout, /secret"/);+});++test("map routes reads the route registry with nested settings paths", () => {+ const { status, json } = run(["map", "routes"]);+ assert.equal(status, 0);+ const paths = json.routes.map((r) => r.path);+ for (const path of [+ "/",+ "/settings",+ "/settings/llm",+ "/settings/secrets",+ "/automations/:automationId",+ "/shared/conversations/:conversationId",+ ]) {+ assert.ok(paths.includes(path), `missing ${path}`);+ }+});++test("toCss keeps testid/CSS chains in-page and defers engines to Playwright", () => {+ assert.equal(+ toCss("testid=chat-pane-header >> testid=ellipsis-button"),+ '[data-testid="chat-pane-header"] [data-testid="ellipsis-button"]',+ );+ assert.equal(+ toCss('testid=switch[data-state="on"] >> span.label'),+ '[data-testid="switch"][data-state="on"] span.label',+ );+ assert.equal(toCss('role=dialog >> role=button[name="Save"]'), null);+ assert.equal(toCss("testid=list >> nth=0"), null);+});++test("evidence retract is an evidence verb, not a conversation verb", () => {+ const res = spawnSync(process.execPath, [cli, "help", "evidence"], {+ encoding: "utf8",+ });+ assert.match(res.stdout, /evidence retract --feature ID/);+ const conv = spawnSync(process.execPath, [cli, "help", "conversation"], {+ encoding: "utf8",+ });+ assert.doesNotMatch(conv.stdout, /retract/);+ assert.match(conv.stdout, /--workspace PATH/);+});++test("browser help documents the input verbs agents asked for", () => {+ const res = spawnSync(process.execPath, [cli, "help", "browser"], {+ encoding: "utf8",+ });+ for (const verb of [+ "upload-via",+ "drop-files",+ "paste",+ "drag",+ "choose",+ "clipboard",+ "--expect-new-url",+ "--history",+ ])+ assert.match(res.stdout, new RegExp(verb.replace(/[-]/g, "\\-")));+});++test("has-text and visible need a previous segment", () => {+ assert.throws(+ () => buildLocator({ locator: () => ({}) }, "has-text=QA_x"),+ /narrows the previous segment/,+ );+});++test("global flags may come before the command", () => {+ const res = spawnSync(+ process.execPath,+ [cli, "--run", "/nonexistent-run", "status"],+ { encoding: "utf8" },+ );+ assert.doesNotMatch(res.stdout + res.stderr, /Unknown command/);+});++test("launch pins backend versions by flag and fixtures cover tarballs", () => {+ const launch = spawnSync(process.execPath, [cli, "help", "launch"], {+ encoding: "utf8",+ });+ assert.match(launch.stdout, /--sdk-version V/);+ assert.match(launch.stdout, /--automation-version V/);+ assert.match(launch.stdout, /not forwarded/);+ const fixture = spawnSync(process.execPath, [cli, "help", "fixture"], {+ encoding: "utf8",+ });+ assert.match(fixture.stdout, /fixture tarball/);+});++test("restart takes machine settings from the current shell, run settings from the saved env", () => {+ const saved = {+ HTTPS_PROXY: "http://127.0.0.1:39647",+ PATH: "/old/bin",+ UV_INDEX_URL: "https://old.example/simple",+ OH_CANVAS_SAFE_BACKEND_PORT: "18831",+ HOME: "/run/private/home",+ };+ const current = { HTTPS_PROXY: "http://127.0.0.1:43131", PATH: "/new/bin" };+ const env = launcherEnvFor(saved, current, [+ "HTTPS_PROXY",+ "PATH",+ "UV_INDEX_URL",+ ]);+ assert.equal(env.HTTPS_PROXY, "http://127.0.0.1:43131");+ assert.equal(env.PATH, "/new/bin");+ assert.equal(env.UV_INDEX_URL, undefined);+ assert.equal(env.OH_CANVAS_SAFE_BACKEND_PORT, "18831");+ assert.equal(env.HOME, "/run/private/home");+});++test("route patterns find parameterized paths the way the map writes them", () => {+ const conversation = routePattern("/conversations/:conversationId");+ assert.ok(conversation.test("open `/conversations/<id>` first"));+ assert.ok(conversation.test("`/conversations/abc-123`"));+ assert.ok(conversation.test("`/conversations/:conversationId`"));+ assert.ok(!conversation.test("`/conversations`"));+ const optional = routePattern("/settings/:tab?");+ assert.ok(optional.test("`/settings`") && optional.test("`/settings/app`"));+ assert.ok(+ routePattern("/extensions/:extensionName/*").test(+ "`/extensions/demo-page/hello`",+ ),+ );+});++test("map coverage maps parameterized routes by path, not only by file", () => {+ const res = spawnSync(process.execPath, [cli, "map", "coverage"], {+ encoding: "utf8",+ });+ const out = JSON.parse(res.stdout);+ for (const path of [+ "/conversations/:conversationId",+ "/automations/:automationId",+ ])+ assert.ok(!out.routes.fileOnly.includes(path), path);+ assert.deepEqual(out.routes.unmapped, []);+});++test("storage values hide secrets stored as plain strings and inside JSON", () => {+ const sidebar = JSON.stringify({ collapsed: true, width: 280, tabs: ["a"] });+ const out = redactStorage({+ "openhands-transcription-api-key": "sk-dummy-123",+ "openhands-session-key": JSON.stringify("abc"),+ "openhands-backends": JSON.stringify([+ { name: "Local", apiKey: "k-1", host: "http://127.0.0.1:1" },+ ]),+ "qa-profile": JSON.stringify({+ name: "Local",+ apiKey: { value: "k-2", rotated: false },+ tokens: ["k-3"],+ sessionKeys: { "k-4": { label: "laptop" } },+ password: 123456,+ refreshTokens: [],+ authenticated: true,+ connectionRevision: 3,+ }),+ // The zustand persist shape: the secret sits two objects deep.+ "qa-persisted": JSON.stringify({+ state: { apiKey: "k-5", authenticated: true },+ version: 0,+ }),+ "qa-sidebar": sidebar,+ "qa-json-string": JSON.stringify("local"),+ "qa-number": "42",+ "openhands-onboarded": "1",+ "openhands-theme": "light-plus",+ });+ assert.equal(out["openhands-transcription-api-key"], "<redacted>");+ assert.equal(out["openhands-session-key"], "<redacted>");+ assert.deepEqual(JSON.parse(out["openhands-backends"]), [+ { name: "Local", apiKey: "<redacted>", host: "http://127.0.0.1:1" },+ ]);+ // A secret-named field holding a number or a non-empty string, array or+ // object is hidden whole, property names included; empty values and+ // booleans next to it stay.+ assert.deepEqual(JSON.parse(out["qa-profile"]), {+ name: "Local",+ apiKey: "<redacted>",+ tokens: "<redacted>",+ sessionKeys: "<redacted>",+ password: "<redacted>",+ refreshTokens: [],+ authenticated: true,+ connectionRevision: 3,+ });+ assert.deepEqual(JSON.parse(out["qa-persisted"]), {+ state: { apiKey: "<redacted>", authenticated: true },+ version: 0,+ });+ assert.equal(out["qa-sidebar"], sidebar);+ assert.equal(out["qa-json-string"], JSON.stringify("local"));+ assert.equal(out["qa-number"], "42");+ assert.equal(out["openhands-onboarded"], "1");+ assert.equal(out["openhands-theme"], "light-plus");+ // Under a secret-looking storage key the whole value is hidden, whatever+ // its shape; only an empty value stays as it is.+ for (const value of [+ JSON.stringify(["sk-dummy-123"]),+ JSON.stringify({ v: "sk-dummy-123" }),+ "12345",+ ])+ assert.equal(+ redactStorageValue("openhands-transcription-api-key", value),+ "<redacted>",+ );+ assert.equal(redactStorageValue("openhands-transcription-api-key", ""), "");+ // Storage keys and JSON fields share one pattern.+ for (const key of ["openhands-llm-key", "qa-auth", "credentials", "passwd"])+ assert.equal(redactStorageValue(key, "sk-dummy-123"), "<redacted>");+});++test("launch refuses a run id that already exists or escapes the run home", () => {+ const home = mkdtempSync(join(tmpdir(), "runid-"));+ mkdirSync(join(home, "taken"));+ writeFileSync(join(home, "taken", "run.json"), "{}\n");+ const taken = run(["launch", "--new", "--run-id", "taken"], {+ OH_VERIFY_HOME: home,+ });+ assert.equal(taken.status, 2, taken.stderr);+ assert.match(taken.json.error, /already exists/);+ assert.equal(readFileSync(join(home, "taken", "run.json"), "utf8"), "{}\n");+ const escaping = run(["launch", "--new", "--run-id", "../outside"], {+ OH_VERIFY_HOME: home,+ });+ assert.equal(escaping.status, 2);+ assert.ok(!existsSync(join(home, "..", "outside")));+});++test("build inputs cover every file the frontend imports from outside src", () => {+ const repo = resolve(here, "../../../..");+ const covered = (path) =>+ BUILD_INPUTS.some(+ (input) => path === input || path.startsWith(`${input}/`),+ );+ const missing = new Set();+ const walk = (dir) => {+ for (const entry of readdirSync(dir, { withFileTypes: true })) {+ const path = join(dir, entry.name);+ if (entry.isDirectory()) walk(path);+ else if (+ /\.(ts|tsx)$/.test(entry.name) &&+ !/\.test\.tsx?$/.test(entry.name)+ ) {+ const source = readFileSync(path, "utf8");+ for (const [, spec] of source.matchAll(+ /from\s+["'](\.{1,2}\/[^"']+)["']/g,+ )) {+ const target = relative(repo, resolve(dirname(path), spec));+ if (!covered(target)) missing.add(target);+ }+ }+ }+ };+ walk(join(repo, "src"));+ assert.deepEqual([...missing], []);+});++test("build identity changes when a new untracked source file appears", () => {+ const repo = mkdtempSync(join(tmpdir(), "buildid-"));+ const git = (...args) =>+ spawnSync("git", args, { cwd: repo, encoding: "utf8" });+ git("init", "-q");+ mkdirSync(join(repo, "src"));+ writeFileSync(join(repo, "src", "app.ts"), "export const a = 1;\n");+ writeFileSync(join(repo, ".gitignore"), "src/generated.ts\n");+ git("add", "-A");+ git(+ "-c",+ "user.name=t",+ "-c",+ "user.email=t@t",+ "-c",+ "commit.gpgsign=false",+ "commit",+ "-qm",+ "init",+ );+ const clean = buildIdentity(repo, ["src"]);+ assert.doesNotMatch(clean, /-dirty$/);+ writeFileSync(join(repo, "src", "generated.ts"), "ignored\n");+ assert.equal(+ buildIdentity(repo, ["src"]),+ clean,+ "ignored files do not count",+ );+ writeFileSync(join(repo, "src", "not-found.tsx"), "export default 1;\n");+ const added = buildIdentity(repo, ["src"]);+ assert.notEqual(added, clean);+ assert.match(added, /-dirty$/);+ writeFileSync(join(repo, "src", "not-found.tsx"), "export default 2;\n");+ assert.notEqual(+ buildIdentity(repo, ["src"]),+ added,+ "edits to the new file count",+ );+});++// A checkout whose launcher decides the editor port with `body`, the way+// scripts/dev-with-automation.mjs buildConfig does.+function checkoutWithLauncher(body) {+ const repo = mkdtempSync(join(tmpdir(), "editor-"));+ mkdirSync(join(repo, "scripts"));+ writeFileSync(+ join(repo, "scripts", "dev-with-automation.mjs"),+ `export async function buildConfig(args, env) {+ const agentServerPort = Number(env.OH_CANVAS_SAFE_BACKEND_PORT);+ console.log("Checking ports...");+ ${body}+}\n`,+ );+ return repo;+}++test("the editor port is reserved only when the launcher serves VS Code", () => {+ const env = { PATH: process.env.PATH, LOCAL_BACKEND_API_KEY: "run-key" };+ // Since #17660: opt-in through OH_CANVAS_ENABLE_VSCODE=true.+ const optIn = checkoutWithLauncher(`return {+ agentServerPort,+ vscodePort: env.OH_CANVAS_ENABLE_VSCODE === "true" ? agentServerPort + 1000 : null,+ };`);+ const off = editorOffset(optIn, env);+ assert.deepEqual(off, { offset: null, source: "launcher" });+ assert.deepEqual(runPorts(18800, off.offset), {+ ingress: 18800,+ agentServer: 18801,+ automation: 18802,+ frontend: 18803,+ });+ const on = editorOffset(optIn, { ...env, OH_CANVAS_ENABLE_VSCODE: "true" });+ assert.deepEqual(on, { offset: 1000, source: "launcher" });+ assert.equal(runPorts(18800, on.offset).vscode, 19801);+ // Before #17660, and with #18048: always bundled. The probe never hands the+ // run's keys to the launcher it asks.+ const bundled = checkoutWithLauncher(`+ if (env.LOCAL_BACKEND_API_KEY === "run-key") throw new Error("leaked key");+ return { agentServerPort, vscodePort: agentServerPort + 1000 };`);+ assert.deepEqual(editorOffset(bundled, env), {+ offset: 1000,+ source: "launcher",+ });+ // A launcher that cannot be asked keeps the old reservation.+ const missing = editorOffset(mkdtempSync(join(tmpdir(), "editor-")), env);+ assert.equal(missing.source, "fallback");+ assert.equal(missing.offset, 1000);+ assert.match(missing.reason, /Cannot find module|ERR_MODULE_NOT_FOUND/);+});++test("this checkout's launcher answers the editor probe, and --vscode opts in", () => {+ const repo = resolve(here, "../../../..");+ const env = { PATH: process.env.PATH };+ // OH_CANVAS_ENABLE_VSCODE=true serves the editor on main and with #18048.+ assert.deepEqual(+ editorOffset(repo, { ...env, OH_CANVAS_ENABLE_VSCODE: "true" }),+ { offset: 1000, source: "launcher" },+ );+ // Without it: off on main (#17660), on again with #18048.+ const plain = editorOffset(repo, env);+ assert.equal(plain.source, "launcher", plain.reason);+ assert.ok([null, 1000].includes(plain.offset), String(plain.offset));+ const help = spawnSync(process.execPath, [cli, "help", "launch"], {+ encoding: "utf8",+ });+ assert.match(help.stdout, /--vscode/);+ assert.match(help.stdout, /OH_CANVAS_ENABLE_VSCODE/);+});++test("a restart follows the launcher's editor answer, or keeps its ports", () => {+ const without = runPorts(18800, null);+ const withEditor = runPorts(18800, 1000);+ const launcher = (offset) => ({ offset, source: "launcher" });+ // Unchanged answers change nothing and say nothing.+ assert.deepEqual(portsAfterRestart(without, launcher(null)), {+ ports: without,+ });+ assert.deepEqual(portsAfterRestart(withEditor, launcher(1000)), {+ ports: withEditor,+ });+ // The checkout started serving VS Code (say #18048 was pulled): the new+ // editor port is reported, for the caller to check before stopping.+ const gained = portsAfterRestart(without, launcher(1000));+ assert.deepEqual(gained.ports, withEditor);+ assert.equal(gained.added, 19801);+ assert.match(+ gained.warning,+ /now serves VS Code: added ports.vscode \(19801\)/,+ );+ // It stopped serving it: stop no longer waits on that port.+ const lost = portsAfterRestart(withEditor, launcher(null));+ assert.deepEqual(lost.ports, without);+ assert.equal(lost.added, undefined);+ assert.match(+ lost.warning,+ /no longer serves VS Code: dropped ports.vscode \(19801\)/,+ );+ // A launcher that cannot be asked (say mid-rebase) changes nothing.+ const unknown = portsAfterRestart(without, {+ offset: 1000,+ source: "fallback",+ reason: "Cannot find module",+ });+ assert.deepEqual(unknown.ports, without);+ assert.equal(unknown.added, undefined);+ assert.match(unknown.warning, /Cannot find module.*keeping this run's ports/);+});++test("restart refuses, before stopping anything, when a newly served editor port is busy", async () => {+ const listener = createServer();+ await new Promise((done) => listener.listen(0, "127.0.0.1", done));+ const busy = listener.address().port;+ const base = busy - 1001;+ try {+ // A run launched without the editor whose launcher now serves it (here+ // through the opt-in; with #18048, always). No keys are saved, so even a+ // restart that failed to refuse could not start anything.+ const dir = mkdtempSync(join(tmpdir(), "cov-run-"));+ mkdirSync(join(dir, "private"));+ writeFileSync(+ join(dir, "private", "launcher-env.json"),+ JSON.stringify({ OH_CANVAS_ENABLE_VSCODE: "true" }),+ );+ const before = JSON.stringify({+ baseUrl: `http://127.0.0.1:${base}`,+ ports: runPorts(base, null),+ launcherArgs: ["-e", "process.exit(1)"],+ launcherPgid: 0,+ });+ writeFileSync(join(dir, "run.json"), before);+ const result = run(["restart"], { OH_VERIFY_RUN: dir });+ assert.equal(result.status, 3, result.stdout + result.stderr);+ assert.match(+ result.json.error,+ new RegExp(`Port ${busy} \\(vscode\\) is busy`),+ );+ assert.match(result.json.hint, /still up/);+ assert.equal(readFileSync(join(dir, "run.json"), "utf8"), before);+ } finally {+ await new Promise((done) => listener.close(done));+ }+});diff --git a/.agents/skills/verify-openhands/scripts/lib/build-id.mjs b/.agents/skills/verify-openhands/scripts/lib/build-id.mjsnew file mode 100644index 0000000000..17e4c80c20--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/build-id.mjs@@ -0,0 +1,33 @@+// Identity of a checkout's frontend build inputs: the committed tree, the+// uncommitted changes, and untracked (but not ignored) files under them. A+// new source file is part of the build as soon as it exists, so leaving+// untracked files out would reuse a stale build and report it as current.+import { execFileSync } from "node:child_process";+import { createHash } from "node:crypto";+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { BUILD_INPUTS } from "./build-inputs.mjs";++export function buildIdentity(root, inputs = BUILD_INPUTS) {+ const git = (args) =>+ execFileSync("git", args, { cwd: root, encoding: "utf8" });+ const tree = git(["ls-tree", "HEAD", "--", ...inputs]);+ const dirty = git(["diff", "HEAD", "--", ...inputs]);+ const untracked = git([+ "ls-files",+ "--others",+ "--exclude-standard",+ "-z",+ "--",+ ...inputs,+ ])+ .split("\0")+ .filter(Boolean)+ .sort();+ const hash = createHash("sha256").update(tree).update(dirty);+ for (const file of untracked) {+ hash.update(`\0${file}\0`).update(readFileSync(join(root, file)));+ }+ const id = hash.digest("hex").slice(0, 16);+ return dirty.trim() || untracked.length ? `${id}-dirty` : id;+}diff --git a/.agents/skills/verify-openhands/scripts/lib/build-inputs.mjs b/.agents/skills/verify-openhands/scripts/lib/build-inputs.mjsnew file mode 100644index 0000000000..9473196b04--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/build-inputs.mjs@@ -0,0 +1,16 @@+// Repository paths the frontend build reads, relative to the repo root. Their+// tree (plus uncommitted changes) identifies a build: a commit that touches+// none of them reuses the existing build. Anything the app imports from+// outside src/ (config/defaults.json) belongs here too, or a change to it+// would keep serving the old bundle.+export const BUILD_INPUTS = [+ "src",+ "public",+ "package.json",+ "package-lock.json",+ "vite.config.ts",+ "react-router.config.ts",+ "tsconfig.json",+ "tailwind.config.js",+ "config",+];diff --git a/.agents/skills/verify-openhands/scripts/lib/launcher-env.mjs b/.agents/skills/verify-openhands/scripts/lib/launcher-env.mjsnew file mode 100644index 0000000000..f4b0f37014--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/launcher-env.mjs@@ -0,0 +1,162 @@+import { spawnSync } from "node:child_process";+import { mkdtempSync, rmSync } from "node:fs";+import { tmpdir } from "node:os";+import { join } from "node:path";+import { pathToFileURL } from "node:url";++// The environment for (re)starting a run's launcher. Run-scoped values+// (ports, state paths, private HOME) come from the environment saved at+// launch. Machine-scoped values (PATH, proxy, CA bundles: the pass-through+// names) come from the current shell, because they can change between+// sessions: a restart that replayed a stale proxy port could no longer reach+// the model provider.+export function launcherEnvFor(saved, current, passNames) {+ const env = { ...saved };+ for (const name of passNames) {+ if (current[name] !== undefined) env[name] = current[name];+ else delete env[name];+ }+ return env;+}++// Whether a launch of this checkout with a given environment serves the+// bundled VS Code editor, and on which port. OpenHands/OpenHands#17660 made+// the editor opt-in (OH_CANVAS_ENABLE_VSCODE=true) and OpenHands/OpenHands#18048+// bundled it again, so neither is assumed: the checkout's own launcher is+// asked. bin/agent-canvas.mjs runs buildConfig from+// scripts/dev-with-automation.mjs, whose vscodePort is null when the editor is+// off.+//+// The question runs in a child process with a throwaway HOME and state+// directory, because importing the launcher's modules creates a log directory+// under the state directory (by default the operator's ~/.openhands).++// Where the launcher put the editor before #17660, and with+// OH_CANVAS_ENABLE_VSCODE=true since: agent-server port + 1000. Used only when+// the launcher cannot be asked, so a failed probe reserves as much as before.+export const FALLBACK_EDITOR_OFFSET = 1000;++const PROBE = `+import { createServer } from "node:net";+// stdout carries only the answer.+const answer = (value) => process.stdout.write(JSON.stringify(value));+console.log = console.info = (...args) => console.error(...args);+try {+ // Free ports for the launcher's own port check; the answer does not depend+ // on which ports they are.+ const servers = [];+ for (let i = 0; i < 4; i += 1)+ servers.push(await new Promise((resolve, reject) => {+ const server = createServer().once("error", reject);+ server.listen(0, "127.0.0.1", () => resolve(server));+ }));+ const [ingress, agentServer, automation, frontend] = servers.map((s) => s.address().port);+ await Promise.all(servers.map((s) => new Promise((resolve) => s.close(resolve))));+ const { buildConfig } = await import(process.argv[1]);+ const config = await buildConfig({ port: ingress }, {+ ...process.env,+ OH_CANVAS_SAFE_BACKEND_PORT: String(agentServer),+ OH_CANVAS_SAFE_AUTOMATION_PORT: String(automation),+ OH_CANVAS_SAFE_VITE_PORT: String(frontend),+ });+ answer({ agentServer: config.agentServerPort, vscode: config.vscodePort ?? null });+} catch (error) {+ answer({ error: String(error?.message ?? error).split("\\n")[0] });+}+`;++/**+ * Ask the checkout's launcher whether it serves the editor with `env` (the+ * environment the launcher will get), as an offset from the agent-server port.+ * @returns {{ offset: number | null, source: "launcher" | "fallback", reason?: string }}+ */+export function editorOffset(repoRoot, env) {+ const launcher = join(repoRoot, "scripts", "dev-with-automation.mjs");+ const home = mkdtempSync(join(tmpdir(), "ohv-editor-probe-"));+ try {+ const result = spawnSync(+ process.execPath,+ // argv[1] must stay a file URL: the launcher runs main() (a whole stack)+ // only when argv[1] is its plain path, so a URL imports it inertly.+ ["--input-type=module", "-e", PROBE, pathToFileURL(launcher).href],+ {+ cwd: repoRoot,+ encoding: "utf8",+ timeout: 30_000,+ env: {+ ...env,+ HOME: home,+ OH_CANVAS_SAFE_STATE_DIR: join(home, "state"),+ // Placeholders: the probe reads no key, and the real ones stay out.+ LOCAL_BACKEND_API_KEY: "editor-probe",+ OH_SECRET_KEY: "editor-probe",+ },+ },+ );+ let answer;+ try {+ answer = JSON.parse(result.stdout);+ } catch {+ // No answer at all: the launcher exited, or the probe could not start.+ throw new Error(+ result.error?.message ||+ `probe exited ${result.status ?? result.signal} without an answer`,+ );+ }+ if (answer.error) throw new Error(answer.error);+ if (answer.vscode === null) return { offset: null, source: "launcher" };+ if (Number.isInteger(answer.vscode) && Number.isInteger(answer.agentServer))+ return { offset: answer.vscode - answer.agentServer, source: "launcher" };+ throw new Error(`unexpected answer ${result.stdout}`);+ } catch (error) {+ return {+ offset: FALLBACK_EDITOR_OFFSET,+ source: "fallback",+ reason: String(error.message).slice(0, 300),+ };+ } finally {+ rmSync(home, { recursive: true, force: true });+ }+}++/**+ * A run's ports from its block base: ingress P, agent-server P+1, automation+ * P+2, static frontend P+3, and the editor only when the launcher serves it.+ */+export function runPorts(base, offset) {+ return {+ ingress: base,+ agentServer: base + 1,+ automation: base + 2,+ frontend: base + 3,+ ...(offset === null ? {} : { vscode: base + 1 + offset }),+ };+}++/**+ * A restarted run's ports. The block never moves, but the checkout may have+ * changed since launch, so the editor port follows the launcher's new answer+ * (`editor`, from editorOffset). When the launcher cannot be asked, the run+ * keeps the ports it had. `added` is an editor port the run did not use+ * before: the caller checks that it is free.+ * @returns {{ ports: Record<string, number>, added?: number, warning?: string }}+ */+export function portsAfterRestart(previous, editor) {+ if (editor.source === "fallback")+ return {+ ports: previous,+ warning: `Could not ask scripts/dev-with-automation.mjs whether it serves VS Code (${editor.reason}); keeping this run's ports.`,+ };+ const ports = runPorts(previous.ingress, editor.offset);+ if (ports.vscode === previous.vscode) return { ports };+ if (ports.vscode === undefined)+ return {+ ports,+ warning: `The checkout's launcher no longer serves VS Code: dropped ports.vscode (${previous.vscode}).`,+ };+ return {+ ports,+ added: ports.vscode,+ warning: `The checkout's launcher now serves VS Code: added ports.vscode (${ports.vscode}).`,+ };+}diff --git a/.agents/skills/verify-openhands/scripts/lib/redact-storage.mjs b/.agents/skills/verify-openhands/scripts/lib/redact-storage.mjsnew file mode 100644index 0000000000..939ae22873--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/redact-storage.mjs@@ -0,0 +1,49 @@+// Web storage values for `browser storage --values`, with secret-looking+// values hidden by name. Storage holds only strings, and each value is shown+// as follows:+// - Under a storage key that matches SECRET_NAME, a non-empty value becomes+// "<redacted>" whole, whatever it holds: a plain string (Canvas keeps the+// transcription API key under `openhands-transcription-api-key`), or a JSON+// string, array, object or number.+// - Under any other key, a JSON array or object (backend entries embed API+// keys) keeps its structure, but at any depth a field whose name matches+// SECRET_NAME has its value replaced by "<redacted>" when that value is a+// number or a non-empty string, array or object. A container is replaced+// whole, property names included. Booleans, null and empty values stay, so+// `"authenticated": true` stays readable.+// - Anything else (an empty value, a plain string, or a JSON string, number,+// boolean or null) is returned unchanged.+// Storage keys and JSON fields share one pattern. Redaction goes by name only:+// a secret under an innocent name, in free text such as a composer draft, or+// in JSON stored inside a JSON string is printed. Read the output before+// quoting it (report.md: do not publish localStorage).+const SECRET_NAME = /key|token|secret|pass|auth|credential/i;+const REDACTED = "<redacted>";++// True for a number or a non-empty string, array or object.+function hasContent(v) {+ if (typeof v === "number") return true;+ if (typeof v === "string") return v !== "";+ return v !== null && typeof v === "object" && Object.keys(v).length > 0;+}++export function redactStorageValue(storageKey, value) {+ if (!value) return value;+ if (SECRET_NAME.test(storageKey)) return REDACTED;+ let parsed;+ try {+ parsed = JSON.parse(value);+ } catch {+ return value;+ }+ if (parsed === null || typeof parsed !== "object") return value;+ return JSON.stringify(parsed, (field, v) =>+ SECRET_NAME.test(field) && hasContent(v) ? REDACTED : v,+ );+}++export function redactStorage(entries) {+ return Object.fromEntries(+ Object.entries(entries).map(([k, v]) => [k, redactStorageValue(k, v)]),+ );+}diff --git a/.agents/skills/verify-openhands/scripts/lib/route-pattern.mjs b/.agents/skills/verify-openhands/scripts/lib/route-pattern.mjsnew file mode 100644index 0000000000..f684311092--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/route-pattern.mjs@@ -0,0 +1,20 @@+// A route path from src/routes.ts as a pattern that finds it in the map's+// prose, where paths are written in backticks with a placeholder or a concrete+// value for each parameter: `/conversations/<id>`, `/conversations/abc-123`+// or `/conversations/:conversationId`. Optional parameters may be left out and+// a trailing splat matches whatever follows.+const PARAM = "(?::\\w+|<[^>`]+>|[\\w.-]+)";++export function routePattern(path) {+ const escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+ let source = "";+ for (const segment of path+ .replace(/\/?\*$/, "")+ .split("/")+ .filter(Boolean)) {+ const param = /^:\w+(\?)?$/.exec(segment);+ if (!param) source += `/${escape(segment)}`;+ else source += param[1] ? `(?:/${PARAM})?` : `/${PARAM}`;+ }+ return new RegExp(`\`${source || "/"}(?=[\`/?#\\s)]|$)`);+}diff --git a/.agents/skills/verify-openhands/scripts/lib/selectors.mjs b/.agents/skills/verify-openhands/scripts/lib/selectors.mjsnew file mode 100644index 0000000000..cdda90e1b6--- /dev/null+++ b/.agents/skills/verify-openhands/scripts/lib/selectors.mjs@@ -0,0 +1,147 @@+// ---------------------------------------------------------------------------+// Selector grammar shared with the CLI help:+// segments joined by " >> "; each segment is one of+// testid=ID | role=ROLE[name="Name"][exact][checked=true]... (also+// [name^="Prefix"] and [name*="part"]) | text=Text |+// text="Exact" | label=Label | placeholder=Text | title=Text | alt=Text |+// nth=N | has-text=Text | visible | any Playwright/CSS selector.+// ---------------------------------------------------------------------------+export function unquote(value) {+ const trimmed = value.trim();+ if (+ (trimmed.startsWith('"') && trimmed.endsWith('"')) ||+ (trimmed.startsWith("'") && trimmed.endsWith("'"))+ ) {+ return { text: trimmed.slice(1, -1), quoted: true };+ }+ return { text: trimmed, quoted: false };+}++export function parseRole(spec) {+ const match = /^([a-z]+)((?:\[[^\]]*\])*)$/i.exec(spec.trim());+ if (!match) throw new Error(`Bad role segment: role=${spec}`);+ const options = {};+ for (const attr of match[2].matchAll(/\[([^\]=]+)(?:=([^\]]*))?\]/g)) {+ const key = attr[1].trim();+ const raw = attr[2];+ const escape = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+ if (key === "name^" || key === "name*") {+ // [name^="Start"] prefix match, [name*="part"] case-insensitive contains.+ const { text } = unquote(raw ?? "");+ options.name =+ key === "name^"+ ? new RegExp(`^${escape(text)}`)+ : new RegExp(escape(text), "i");+ } else if (key === "name") {+ const { text } = unquote(raw ?? "");+ if (text.startsWith("/") && text.lastIndexOf("/") > 0) {+ const end = text.lastIndexOf("/");+ options.name = new RegExp(text.slice(1, end), text.slice(end + 1));+ } else {+ options.name = text;+ }+ } else if (key === "level") {+ options.level = Number(raw);+ } else if (+ [+ "exact",+ "checked",+ "disabled",+ "expanded",+ "pressed",+ "selected",+ "includeHidden",+ ].includes(key)+ ) {+ options[key] = raw === undefined ? true : raw === "true";+ } else {+ throw new Error(`Unsupported role attribute [${key}]`);+ }+ }+ return { role: match[1], options };+}++export function applySegment(scope, segment) {+ const seg = segment.trim();+ const eq = seg.indexOf("=");+ const engine = eq > 0 ? seg.slice(0, eq) : seg;+ const value = eq > 0 ? seg.slice(eq + 1) : "";+ switch (engine) {+ case "testid": {+ // testid=name[data-state="open"] narrows by extra attributes via CSS.+ const bracket = value.indexOf("[");+ if (bracket > 0) {+ const id = unquote(value.slice(0, bracket)).text;+ return scope.locator(`[data-testid="${id}"]${value.slice(bracket)}`);+ }+ return scope.getByTestId(unquote(value).text);+ }+ case "role": {+ const { role, options } = parseRole(value);+ return scope.getByRole(role, options);+ }+ case "text": {+ const { text, quoted } = unquote(value);+ return scope.getByText(text, { exact: quoted });+ }+ case "label": {+ const { text, quoted } = unquote(value);+ return scope.getByLabel(text, { exact: quoted });+ }+ case "placeholder": {+ const { text, quoted } = unquote(value);+ return scope.getByPlaceholder(text, { exact: quoted });+ }+ case "title": {+ const { text, quoted } = unquote(value);+ return scope.getByTitle(text, { exact: quoted });+ }+ case "alt": {+ const { text, quoted } = unquote(value);+ return scope.getByAltText(text, { exact: quoted });+ }+ case "nth":+ return scope.nth(Number(value));+ case "has-text":+ case "visible":+ if (typeof scope.filter !== "function")+ throw new Error(+ `${engine}= narrows the previous segment; start with a selector, e.g. 'role=row >> ${seg}' (or use text= on its own)`,+ );+ return engine === "has-text"+ ? scope.filter({ hasText: unquote(value).text })+ : scope.filter({ visible: true });+ default:+ return scope.locator(seg);+ }+}++export function buildLocator(root, selector) {+ if (!selector) throw new Error("A selector is required");+ return selector+ .split(/\s+>>\s+/)+ .reduce((scope, segment) => applySegment(scope, segment), root);+}++// Plain CSS for selectors made only of testid= and CSS segments (used by the+// in-page MutationObserver of click --observe); null when Playwright engines+// (role=, text=, nth= ...) are needed.+export function toCss(selector) {+ const parts = [];+ for (const raw of String(selector).split(" >> ")) {+ const seg = raw.trim();+ if (seg.startsWith("testid=")) {+ const value = seg.slice("testid=".length);+ const bracket = value.indexOf("[");+ const id = unquote(bracket > 0 ? value.slice(0, bracket) : value).text;+ parts.push(+ `[data-testid="${id.replace(/"/g, '\\"')}"]${bracket > 0 ? value.slice(bracket) : ""}`,+ );+ } else if (/^[a-z-]+=/.test(seg) || seg === "visible") {+ return null;+ } else {+ parts.push(seg);+ }+ }+ return parts.join(" ");+}diff --git a/AGENTS.md b/AGENTS.mdindex be457120e1..32caa015f7 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -62,6 +62,7 @@ Detailed contributor knowledge is split into skills so it loads only for relevan| [`frontend-development`](.agents/skills/frontend-development/SKILL.md) | React/UI work, i18n, named identifiers, MSW mock mode, lazy loading, bundle performance, and feature-specific UI invariants. || [`pr-design-doc`](.agents/skills/pr-design-doc/SKILL.md) | Writing the PR design document stored in the PR body. || [`release`](.agents/skills/release.md) | Cutting and verifying an `@openhands/agent-canvas` release. |+| [`verify-openhands`](.agents/skills/verify-openhands/SKILL.md) | Driving the real app like a user with `control-openhands`, the feature map of every user-facing behavior, and creating or maintaining that map. |The detailed rules live in each skill's `references/guide.md`; do not copy them back into this file. Update the owning skill whenever an invariant changes.diff --git a/docs/README.md b/docs/README.mdindex fc72c9a976..9a47854e01 100644--- a/docs/README.md+++ b/docs/README.md@@ -9,3 +9,4 @@ This directory contains the project documentation.- [Self-hosting guide](./SELF_HOSTING.md)- [Integrating DefenseClaw](./DefenseClaw.md): run the DefenseClaw security governance layer alongside the Agent Server.- [Testing matrix](./TESTING_MATRIX.md): release smoke-test coverage across installers, operating systems, and agents.+- [Feature verification map](../.agents/skills/verify-openhands/references/feature-map/README.md): every user-facing feature with entry points and rerunnable `control-openhands` recipes; start with the [verify-openhands skill](../.agents/skills/verify-openhands/SKILL.md) to launch and drive the real app.