Skip to content

fix(agent-server): leave web-researcher out of sub-agents when the browser is disabled - #5921

Merged
enyst merged 1 commit into
mainfrom
claude/umbrella-bug-fixes-tgz9ai-subagents-browser-disabled
Oct 14, 2026
Merged

enyst merged 1 commit into
mainfrom
claude/umbrella-bug-fixes-tgz9ai-subagents-browser-disabled

Conversation

@enyst

@enyst enyst commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

HUMAN:
This PR proposes a fix for a bug uncovered during the first full agentic run of verify-agent-server.


AGENT:

I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.

Requested by Engel · project thread

Decision needed

What should hide web-researcher: only the server config, or also the Chromium probe?

  • Implemented: config only. The route uses configured_browser_available(config), the same helper the tool catalog uses: enable_browser: false hides it, and so does a Docker runtime whose image has no browser. When the browser is enabled but this process finds no Chromium, web-researcher is still listed. This matches what the issue asks for, keeps the route cheap (no probe), and keeps the existing F27.subagents-builtin contract (four built-ins on a server without Chromium).
  • Alternative: also hide it when the Chromium probe fails (is_tool_usable(BROWSER_TOOL_NAME), as live_launch_runtime does for launches). The list would then match what a launch can actually run, but it changes the built-in list on machines without Chromium, and F27.subagents-builtin and its tests would need updating.

Why

With enable_browser: false, POST /api/sub-agents still listed the built-in web-researcher, whose only tool is browser_tool_set. The tool catalog on the same server already reports that tool as unusable, so a client could offer a sub-agent that has no usable tool. The route called discover_builtin_agents() with its default enable_browser=True, ignoring the config.

Summary

  • get_sub_agents passes enable_browser=configured_browser_available(config) is not False to discover_builtin_agents. The function already filtered web-researcher; it was just never told to.
  • Unit test (parametrized on enable_browser) in tests/agent_server/test_sub_agents_router.py.
  • Map: F27.subagents-browser-disabled now restarts with enable_browser: false itself. Before, it relied on an earlier bullet's restart, so --only ran it with the browser enabled. Its # bug marker is removed and the prose describes the fixed behaviour.

Issue Number

Fixes #5911

How to Test

  • uv run pytest tests/agent_server/test_sub_agents_router.py tests/agent_server/test_tool_router.py tests/agent_server/test_api.py: 58 passed. On main, the new test_get_sub_agents_follows_the_browser_setting[False] fails.
  • Map proof (bullet with the added restart, marker still in place):
    • control-agent-server map run --file F27 --only F27.subagents-browser-disabled --fresh --repeat 2 --checkout <main checkout>: xfail, xfail
    • the same command against this branch (AGENT_SERVER_VERIFY_CHECKOUT=<worktree>): xpass, xpass
  • With the marker removed: control-agent-server map check reports no problems, and map run --only F27.subagents-browser-disabled --fresh passes. F27.subagents-builtin and F27.subagents-precedence still pass (--only, fresh).
  • pre-commit run on the changed files: passed.

Video/Screenshots

n/a

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Out of scope: /server_info usable_tools (F27.server-info-browser-disabled, handled separately), and the import-time register_builtins_agents(enable_browser=True) in tool_router.py, which keeps web-researcher in the delegation registry used by conversations. No TypeScript client change is needed because the request and response shapes are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_014MKndVj7XWvRQmvW9w2bDg


Generated by Claude Code


🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:c5dc63d-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-c5dc63d-python \
  ghcr.io/openhands/agent-server:c5dc63d-python

All tags pushed for this build

ghcr.io/openhands/agent-server:c5dc63d-golang-amd64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-golang-amd64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-golang-amd64
ghcr.io/openhands/agent-server:c5dc63d-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:c5dc63d-golang-arm64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-golang-arm64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-golang-arm64
ghcr.io/openhands/agent-server:c5dc63d-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:c5dc63d-java-amd64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-java-amd64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-java-amd64
ghcr.io/openhands/agent-server:c5dc63d-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:c5dc63d-java-arm64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-java-arm64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-java-arm64
ghcr.io/openhands/agent-server:c5dc63d-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-amd64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-amd64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-arm64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-arm64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-minimal-amd64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-minimal-amd64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-minimal-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-minimal-arm64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-minimal-arm64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-minimal-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-slim-amd64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-slim-amd64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-slim-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:c5dc63d-python-slim-arm64
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-slim-arm64
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-slim-arm64
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:c5dc63d-golang
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-golang
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-golang
ghcr.io/openhands/agent-server:c5dc63d-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:c5dc63d-java
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-java
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-java
ghcr.io/openhands/agent-server:c5dc63d-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:c5dc63d-python-minimal
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-minimal
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-minimal
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-minimal
ghcr.io/openhands/agent-server:c5dc63d-python-slim
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python-slim
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python-slim
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime-slim
ghcr.io/openhands/agent-server:c5dc63d-python
ghcr.io/openhands/agent-server:c5dc63de828f5c3a94277a5d591bc16df90d8268-python
ghcr.io/openhands/agent-server:claude-umbrella-bug-fixes-tgz9ai-subagents-browser-disabled-python
ghcr.io/openhands/agent-server:c5dc63d-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., c5dc63d-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., c5dc63d-python-amd64) are also available if needed

…owser is disabled

POST /api/sub-agents called discover_builtin_agents() with its default
enable_browser=True, so the browser-only web-researcher was listed even
with enable_browser: false. Pass the configured browser availability (the
same configured_browser_available the tool catalog uses) instead.

The F27.subagents-browser-disabled map bullet now sets enable_browser:
false itself (it relied on an earlier bullet's restart, so --only ran it
with the browser on), and its known-bug marker is removed.

Fixes #5911

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014MKndVj7XWvRQmvW9w2bDg
@github-actions

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL497411982560% 
report-only-changed-files is enabled. No changed files were found in the coverage report :)

@enyst
enyst marked this pull request as ready for review October 14, 2026 02:18
@enyst
enyst requested a review from all-hands-bot October 14, 2026 02:21

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

Review summary

Scope is correct: the fix lands in the Agent Server REST route that this repository owns, matching the linked issue #5911 (open, bug / priority:low / ready-for-dev) and its acceptance criteria.

What I verified on head c5dc63d

  • Root cause and fix. get_sub_agents previously called discover_builtin_agents() with its default enable_browser=True, so a config with enable_browser: false still listed the browser-only web-researcher. The route now reads http_request.app.state.config (already set in create_app) and passes enable_browser=configured_browser_available(config) is not False, the same helper the tool catalog route uses (tool_router.py). configured_browser_available returns False when enable_browser is off, container_browser_enabled(config) for docker runtime, and None when this process must probe — so is not False preserves all four built-ins for local runtime with the browser enabled (probe unresolved) and correctly drops web-researcher when config disables the browser or the docker image has no browser. That matches the stated design decision (config-only gating, no Chromium probe in this route) and keeps the F27.subagents-builtin four-built-in contract.
  • Acceptance criteria. No-browser config yields the three non-browser built-ins; browser-enabled default is unchanged; user/project agents and the first-wins precedence loop are untouched.
  • Tests. test_get_sub_agents_follows_the_browser_setting[True] and [False] both pass; tests/agent_server/test_sub_agents_router.py, test_tool_router.py, and test_api.py pass locally (11 + 47). ruff check on the changed files passes. The new import does not introduce an import cycle (module imports cleanly), and launch.py/config.py are already part of the server package.
  • CI. All check runs on this head are completed successfully (build/tests/coverage/OpenAPI schema), no failing checks.
  • Feature map. The F27.subagents-browser-disabled bullet now restarts with enable_browser: false itself (so --only runs it in the right state), and its # bug marker and known-bug prose are removed to describe the fixed behavior.
  • Stated non-goals. /server_info usable_tools (F27.server-info-browser-disabled) and the import-time register_builtins_agents(enable_browser=True) in tool_router.py are correctly left out of scope; the PR description calls out both, and the residual delegation-registry behavior is documented in the map bullet.

Eval risk

This only changes which built-in agents a read-only catalog route advertises; it does not alter agent loop, prompts, or tool execution, so no benchmark eval is warranted. The change is gated behind enable_browser config and does not touch persisted settings, serialized events, or the TypeScript request/response shapes.

No material correctness, security, compatibility, or acceptance-criterion defect found.

✅ APPROVED

@enyst
enyst merged commit 4804aa0 into main Oct 14, 2026
56 of 57 checks passed
@enyst
enyst deleted the claude/umbrella-bug-fixes-tgz9ai-subagents-browser-disabled branch October 14, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: POST /api/sub-agents lists the browser-only web-researcher when enable_browser is false

3 participants