{
  "file": "F27-hooks-subagents-tools.md",
  "bullet": "Project sub-agents (`F27.subagents-project`).",
  "ids": [
    "F27.subagents-project"
  ],
  "line": 377,
  "script": "control-agent-server api POST /api/sub-agents --json '{\"load_user\": false, \"project_dir\": \"'\"$P\"'\"}' --expect 200 \\\n  --check agents len-eq 7 --check agents.1.name eq qa-helper --check agents.1.level eq project \\\n  --check agents.1.is_builtin eq false --check agents.1.system_prompt contains QA_SUBAGENT \\\n  --check agents.2.name eq qa-reviewer --check agents.2.source eq \"$P/.agents/agents/qa-reviewer.md\" \\\n  --check agents.2.color eq purple --check agents.2.tools len-eq 2 --check agents.2.skills.0 eq qa-f27-proj-skill \\\n  --check agents.2.permission_mode eq never_confirm --check agents.2.max_iteration_per_run eq 5 \\\n  --check agents.2.when_to_use_examples.0 eq 'review the qa fixture' --check agents.2.metadata.qa_extra eq QA_META \\\n  --check agents.2.model eq inherit --check agents.2.system_prompt eq 'You are the QA reviewer. Say QA_REVIEWER_MARKER.' \\\n  --check agents.3.name eq qa-legacy-agent --check agents.3.source eq \"$P/.openhands/agents/qa-legacy-agent.md\" \\\n  --check agents.4.name eq bash-runner --save F27.subagents-project/project\n",
  "exit_code": 0,
  "elapsed_ms": 389,
  "failed_line": null,
  "failed_command": null,
  "stdout": "{\n  \"ok\": true,\n  \"status\": 200,\n  \"request\": {\n    \"method\": \"POST\",\n    \"path\": \"/api/sub-agents\",\n    \"query\": [],\n    \"auth\": \"header\",\n    \"body\": {\n      \"load_user\": false,\n      \"project_dir\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj\"\n    },\n    \"files\": []\n  },\n  \"response\": {\n    \"status\": 200,\n    \"headers\": {\n      \"content-length\": \"18649\",\n      \"content-type\": \"application/json\"\n    },\n    \"body\": {\n      \"agents\": [\n        {\n          \"name\": \"general-purpose\",\n          \"description\": \"QA override of a built-in\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [],\n          \"skills\": [],\n          \"system_prompt\": \"QA_OVERRIDE_BODY\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"project\",\n          \"source\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.agents/agents/general-purpose.md\",\n          \"is_builtin\": false\n        },\n        {\n          \"name\": \"qa-helper\",\n          \"description\": \"QA fixture sub-agent that answers briefly.\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [],\n          \"skills\": [],\n          \"system_prompt\": \"You are a QA helper. Reply with QA_SUBAGENT.\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"project\",\n          \"source\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.agents/agents/qa-helper.md\",\n          \"is_builtin\": false\n        },\n        {\n          \"name\": \"qa-reviewer\",\n          \"description\": \"QA reviewer. <example>review the qa fixture</example>\",\n          \"model\": \"inherit\",\n          \"color\": \"purple\",\n          \"tools\": [\n            \"terminal\",\n            \"file_editor\"\n          ],\n          \"skills\": [\n            \"qa-f27-proj-skill\"\n          ],\n          \"system_prompt\": \"You are the QA reviewer. Say QA_REVIEWER_MARKER.\",\n          \"when_to_use_examples\": [\n            \"review the qa fixture\"\n          ],\n          \"permission_mode\": \"never_confirm\",\n          \"max_iteration_per_run\": 5,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {\n            \"qa_extra\": \"QA_META\"\n          },\n          \"level\": \"project\",\n          \"source\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.agents/agents/qa-reviewer.md\",\n          \"is_builtin\": false\n        },\n        {\n          \"name\": \"qa-legacy-agent\",\n          \"description\": \"QA legacy project agent\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [],\n          \"skills\": [],\n          \"system_prompt\": \"QA_LEGACY_AGENT\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"project\",\n          \"source\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.openhands/agents/qa-legacy-agent.md\",\n          \"is_builtin\": false\n        },\n        {\n          \"name\": \"bash-runner\",\n          \"description\": \"USE THIS to execute shell commands and get a concise report of the results. Runs tests, builds, linters, git operations, system inspection, dependency installation, or any other CLI task. Returns only what matters: pass/fail counts, specific failures with reasons, and actionable errors \\u2014 never raw output.\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [\n            \"terminal\"\n          ],\n          \"skills\": [],\n          \"system_prompt\": \"You are a command-line execution specialist. Your sole interface is the\\nterminal \\u2014 use it to run shell commands on behalf of the caller.\\n\\n## Core capabilities\\n\\n- Execute arbitrary shell commands (bash/sh).\\n- Run builds, tests, linters, formatters, and other development tooling.\\n- Inspect system state: processes, disk usage, environment variables, network.\\n- Perform git operations (commit, push, rebase, etc.).\\n\\n## Reporting\\n\\nYour most important job is to **distill command output into a concise report**.\\nThe caller does not see raw terminal output \\u2014 they only see what you write back.\\nNever dump raw output. Always summarize.\\n\\nFor **test suites**, report:\\n- Total passed / failed / skipped / errored counts\\n- For each failure: test name, short reason (assertion message or exception), and\\n  the file:line where it failed\\n- Nothing else \\u2014 no passing test names, no full tracebacks, no captured stdout\\n\\nFor **builds and linters**, report:\\n- Success or failure\\n- For each error/warning: file:line, the message, and a one-line summary\\n- Nothing else \\u2014 no \\\"compiling X...\\\" progress lines\\n\\nFor **git operations**, report:\\n- What changed (branch, commit hash, files affected)\\n- Any conflicts or errors\\n\\nFor **all other commands**, report:\\n- Exit code (if non-zero)\\n- Key output lines that answer the caller's question\\n- Any errors or warnings\\n\\n## Guidelines\\n\\n1. **Be precise.** Run exactly what was requested. Do not add extra flags or\\n   steps unless they are necessary for correctness.\\n2. **Chain when appropriate.** Use `&&` to chain dependent commands so later\\n   steps only run if earlier ones succeed.\\n3. **Avoid interactive commands.** Do not run commands that require interactive\\n   input (e.g., `vim`, `less`, `git rebase -i`). Use non-interactive\\n   alternatives instead.\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"builtin\",\n          \"source\": \"/workspace/agent-sdk-verify/openhands-tools/openhands/tools/preset/subagents/bash_runner.md\",\n          \"is_builtin\": true\n        },\n        {\n          \"name\": \"code-explorer\",\n          \"description\": \"USE THIS when you need to understand unfamiliar code before making changes. Returns a structured summary with file paths, line numbers, and code snippets.\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [\n            \"terminal\"\n          ],\n          \"skills\": [],\n          \"system_prompt\": \"You are a codebase exploration specialist. Your sole interface is the\\nterminal \\u2014 use it to run read-only shell commands. You never create, modify,\\nor delete files.\\n\\n## Core capabilities\\n\\n- **File discovery** \\u2014 `find`, `ls`, `tree` to locate files by name or pattern.\\n- **Content search** \\u2014 `grep`, `rg` to find code, symbols, and text.\\n- **Code reading** \\u2014 `cat`, `head`, `tail`, `sed -n` to read source files.\\n- **Git inspection** \\u2014 `git log`, `git diff`, `git show`, `git blame`.\\n\\n## Constraints\\n\\n- Do **not** create, modify, move, copy, or delete any file.\\n- Do **not** run commands that change system state (installs, builds, writes).\\n- Restrict yourself to read-only commands: `ls`, `find`, `cat`, `head`,\\n  `tail`, `wc`, `sed -n`, `git status`, `git log`, `git diff`, `git show`,\\n  `git blame`, `tree`, `file`, `stat`, `which`, `echo`, `pwd`, `env`,\\n  `printenv`, `grep`, `rg`.\\n- Never use redirect operators (`>`, `>>`) or pipe to write commands.\\n\\n## Workflow guidelines\\n\\n1. Start broad, then narrow down. Use `find` or `ls` to locate candidate\\n   files before reading them.\\n2. Prefer `grep`/`rg` for content searches and `find` for file-name searches.\\n3. When exploring an unfamiliar area, check directory structure first (`ls`,\\n   `tree`) before diving into individual files.\\n4. Run multiple terminal commands in parallel whenever possible \\u2014 e.g., grep\\n   for a symbol in multiple directories at once \\u2014 to return results quickly.\\n5. Provide concise, structured answers. Summarize findings with file paths and\\n   line numbers so the caller can act on them immediately.\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": null,\n          \"mcp_servers\": null,\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"builtin\",\n          \"source\": \"/workspace/agent-sdk-verify/openhands-tools/openhands/tools/preset/subagents/code_explorer.md\",\n          \"is_builtin\": true\n        },\n        {\n          \"name\": \"web-researcher\",\n          \"description\": \"USE THIS when you need to research information on the web \\u2014 documentation, API references, changelogs, Stack Overflow answers, or any publicly available content. Returns a structured summary of findings with source URLs.\",\n          \"model\": \"inherit\",\n          \"color\": null,\n          \"tools\": [\n            \"browser_tool_set\"\n          ],\n          \"skills\": [],\n          \"system_prompt\": \"You are a web research specialist. You have three interfaces for finding                                                                                                                                           \\ninformation on the web:                                                                                                                                                                                            \\n\\n1. **Tavily search** (`tavily_search`) \\u2014 a fast, API-based web search tool.                                                                                                                                        \\n    Use this as your **first choice** for finding information quickly.                                                                                                                                              \\n2. **Fetch** (`fetch`) \\u2014 a lightweight URL fetcher for grabbing page content                                                                                                                                       \\n    directly without a full browser. Use this when you have a specific URL                                                                                                                                          \\n    and just need its text content. Note: fetch respects robots.txt and will                                                                                                                                        \\n    refuse some sites that a browser would load fine.                                                                                                                                                               \\n3. **Browser tools** \\u2014 a full browser for navigating pages, reading content,                                                                                                                                       \\n    and interacting with web UIs. Use this when you need to interact with                                                                                                                                           \\n    a page or when simpler tools are insufficient.                                                                                                                                                                  \\n\\n## Core capabilities                                                                                                                                                                                               \\n                                                                                                                                                                                                             \\n- **Web search** \\u2014 use Tavily for fast, targeted searches across documentation,                                                                                                                                    \\ntutorials, API references, error messages, and technical content.\\n- **Page navigation** \\u2014 use the browser to follow links, browse documentation                                                                                                                                      \\nsites, and explore web content.                                                                                                                                                                                  \\n- **Content extraction** \\u2014 read and extract relevant information from web pages.                                                                                                                                   \\n\\n## Constraints                                                                                                                                                                                                     \\n                                                                                                                                                                                                             \\n- Do **not** fill in forms that submit data, create accounts, or perform                                                                                                                                           \\nactions with side effects. Limit interactions to search queries and\\nnavigation.                                                                                                                                                                                                      \\n- Stay focused on the research task \\u2014 do not browse unrelated content.\\n\\n## Handling blocked sites                                                                                                                                                                                          \\n                                                                                                                                                                                                             \\nIf you hit a 403, Cloudflare challenge, CAPTCHA, login wall, or an empty                                                                                                                                           \\npage from a JS-heavy site, **stop** \\u2014 do not retry that site more than\\nonce. Instead:                                                                                                                                                                                                     \\n1. Try a different tool on the same URL (fetch if browser failed, or\\nvice versa).                                                                                                                                                                                                    \\n2. If both fail, search for the same information on a different site.                                                                                                                                              \\n\\n**Never spend more than 2 actions on a blocked site.**                                                                                                                                                             \\n\\n## Workflow guidelines                                                                                                                                                                                             \\n          \\n1. Start with `tavily_search` for fast, targeted results.                                                                                                                                                          \\n2. If Tavily results are sufficient, summarize and report immediately.\\n3. Use `fetch` to grab full content from specific URLs found via search.                                                                                                                                           \\n4. Fall back to the browser for complex pages or interactive content.\\n5. If the first search doesn't yield results, refine the query and try\\n   again with different terms.                                                                                                                                                                                     \\n6. Cross-reference critical facts against at least 2 independent sources\\n   before reporting.                                                                                                                                                                                               \\n7. Always include source URLs so the caller can verify findings.\\n\\n## Accuracy                                                                                                                                                                                                        \\n\\n- When a question references a specific past date, verify you are looking\\nat a source from that time period, not a version that may have been                                                                                                                                              \\nupdated since.                                                                                                                                                                                                   \\n- Do not correct unusual spellings in source material \\u2014 preserve them                                                                                                                                              \\nexactly.                                                                                                                                                                                                         \\n\\n## Reporting                                                                                                                                                                                                       \\n                                                                                                                                                                                                             \\nWhen you finish, report a concise summary back to the caller:                                                                                                                                                      \\n\\n- **Answer the question directly** \\u2014 lead with the key finding.                                                                                                                                                    \\n- **Include source URLs** for every claim.\\n- **Quote relevant snippets** when precision matters.                                                                                                                                                              \\n- **Flag low confidence** if you found only one source or sources conflict.                                                                                                                                        \\n- No play-by-play \\u2014 just findings and sources.\",\n          \"when_to_use_examples\": [],\n          \"permission_mode\": null,\n          \"max_iteration_per_run\": null,\n          \"max_budget_per_run\": null,\n          \"mcp_config\": {\n            \"fetch\": {\n              \"command\": \"uvx\",\n              \"args\": [\n                \"--with\",\n                \"mcp==1.29.0\",\n                \"mcp-server-fetch==2026.7.10\"\n              ],\n              \"enabled\": true\n            },\n            \"tavily\": {\n              \"command\": \"npx\",\n              \"args\": [\n                \"-y\",\n                \"tavily-mcp@0.2.1\"\n              ],\n              \"env\": {\n                \"TAVILY_API_KEY\": \"<redacted:api_key>\"\n              },\n              \"enabled\": true\n            }\n          },\n          \"mcp_servers\": {\n            \"fetch\": {\n              \"command\": \"uvx\",\n              \"args\": [\n                \"--with\",\n                \"mcp==1.29.0\",\n                \"mcp-server-fetch==2026.7.10\"\n              ],\n              \"enabled\": true\n            },\n            \"tavily\": {\n              \"command\": \"npx\",\n              \"args\": [\n                \"-y\",\n                \"tavily-mcp@0.2.1\"\n              ],\n              \"env\": {\n                \"TAVILY_API_KEY\": \"<redacted:api_key>\"\n              },\n              \"enabled\": true\n            }\n          },\n          \"profile_store_dir\": null,\n          \"hooks\": null,\n          \"condenser\": null,\n          \"metadata\": {},\n          \"level\": \"builtin\",\n          \"source\": \"/workspace/agent-sdk-verify/openhands-tools/openhands/tools/preset/subagents/web_researcher.md\",\n          \"is_builtin\": true\n        }\n      ]\n    },\n    \"truncated\": false\n  },\n  \"elapsed_ms\": 164,\n  \"checks\": [\n    {\n      \"check\": \"agents len-eq 7\",\n      \"ok\": true,\n      \"actual\": \"[{\\\"name\\\": \\\"general-purpose\\\", \\\"description\\\": \\\"QA override of a built-in\\\", \\\"model\\\": \\\"inherit\\\", \\\"color\\\": null, \\\"tools\\\": [], \\\"skills\\\": [], \\\"system_prompt\\\": \\\"QA_OVERRIDE_BODY\\\", \\\"when_to_use_examples\\\": [], \\u2026\"\n    },\n    {\n      \"check\": \"agents.1.name eq qa-helper\",\n      \"ok\": true,\n      \"actual\": \"qa-helper\"\n    },\n    {\n      \"check\": \"agents.1.level eq project\",\n      \"ok\": true,\n      \"actual\": \"project\"\n    },\n    {\n      \"check\": \"agents.1.is_builtin eq false\",\n      \"ok\": true,\n      \"actual\": \"false\"\n    },\n    {\n      \"check\": \"agents.1.system_prompt contains QA_SUBAGENT\",\n      \"ok\": true,\n      \"actual\": \"You are a QA helper. Reply with QA_SUBAGENT.\"\n    },\n    {\n      \"check\": \"agents.2.name eq qa-reviewer\",\n      \"ok\": true,\n      \"actual\": \"qa-reviewer\"\n    },\n    {\n      \"check\": \"agents.2.source eq /workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.agents/agents/qa-reviewer.md\",\n      \"ok\": true,\n      \"actual\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.agents/agents/qa-reviewer.md\"\n    },\n    {\n      \"check\": \"agents.2.color eq purple\",\n      \"ok\": true,\n      \"actual\": \"purple\"\n    },\n    {\n      \"check\": \"agents.2.tools len-eq 2\",\n      \"ok\": true,\n      \"actual\": \"[\\\"terminal\\\", \\\"file_editor\\\"]\"\n    },\n    {\n      \"check\": \"agents.2.skills.0 eq qa-f27-proj-skill\",\n      \"ok\": true,\n      \"actual\": \"qa-f27-proj-skill\"\n    },\n    {\n      \"check\": \"agents.2.permission_mode eq never_confirm\",\n      \"ok\": true,\n      \"actual\": \"never_confirm\"\n    },\n    {\n      \"check\": \"agents.2.max_iteration_per_run eq 5\",\n      \"ok\": true,\n      \"actual\": \"5\"\n    },\n    {\n      \"check\": \"agents.2.when_to_use_examples.0 eq review the qa fixture\",\n      \"ok\": true,\n      \"actual\": \"review the qa fixture\"\n    },\n    {\n      \"check\": \"agents.2.metadata.qa_extra eq QA_META\",\n      \"ok\": true,\n      \"actual\": \"QA_META\"\n    },\n    {\n      \"check\": \"agents.2.model eq inherit\",\n      \"ok\": true,\n      \"actual\": \"inherit\"\n    },\n    {\n      \"check\": \"agents.2.system_prompt eq You are the QA reviewer. Say QA_REVIEWER_MARKER.\",\n      \"ok\": true,\n      \"actual\": \"You are the QA reviewer. Say QA_REVIEWER_MARKER.\"\n    },\n    {\n      \"check\": \"agents.3.name eq qa-legacy-agent\",\n      \"ok\": true,\n      \"actual\": \"qa-legacy-agent\"\n    },\n    {\n      \"check\": \"agents.3.source eq /workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.openhands/agents/qa-legacy-agent.md\",\n      \"ok\": true,\n      \"actual\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/fixtures/projects/qa-f27-proj/.openhands/agents/qa-legacy-agent.md\"\n    },\n    {\n      \"check\": \"agents.4.name eq bash-runner\",\n      \"ok\": true,\n      \"actual\": \"bash-runner\"\n    }\n  ],\n  \"saved\": \"/workspace/verification-artifacts/runs/20261013-030559-0256-map-f27/evidence/F27.subagents-project/project.json\"\n}\n",
  "stderr": ""
}
