Repository navigation
Description
A client building an Agent Profile editor has to answer two questions about tools, and the SDK can answer neither:
- What will this profile's agent actually get?
- Which tools may a user pick from?
Both are facts the SDK owns, so every client ends up guessing — OpenHands/OpenHands#17235 currently hardcodes a six-name allow-list and a copy of DEFAULT_EXEC_TOOL_NAMES to fill the gap.
1. materialize reports intent, not outcome
POST /api/agent-profiles/{name}/materialize runs resolve_agent_profile_dry_run and is otherwise the right endpoint for this. But _build_openhands_settings passes the field straight through ("tools": profile.tools), so a profile that leaves tools unset materializes as None — while the launch resolves it to four tools.
Verified against a live agent-server (1.46.0), same profile:
POST /api/agent-profiles/probe-default/materialize
resolved_settings.tools : None
POST /api/conversations {agent_profile_id: <that profile>}
agent.tools : ['browser_tool_set', 'file_editor', 'task_tracker', 'terminal']
The gap is not just create_agent()'s defaulting. _resolve_agent_from_profile appends browser_tool_set after resolve_agent_profile returns, gated on is_tool_usable() and on profile.tools is None — a rule no client can reproduce without duplicating both the default names and the injection logic, and which drifts the moment either changes.
Ask
Have the dry-run also report the resolved outcome — the tool names the agent would actually be constructed with, after create_agent()'s defaulting and the serving layer's injections — alongside the stored tri-state, which is still what gets persisted.
A second, smaller ask that makes this usable in a create flow: let materialize accept a draft profile body, not only a saved profile by name, so an editor can preview before the first save.
Shape is up to you; something like AgentProfileDiagnostics.resolved_tool_names: list[str] next to the existing resolved_mcp_config_keys / resolved_skills, which already follow exactly this "what would actually resolve" pattern.
2. Nothing marks a tool as user-selectable
/server_info's usable_tools and /tools/ both return the process's tool registry. tool_router.py registers four presets unconditionally at import:
register_default_tools(enable_browser=True)
register_builtins_agents(enable_browser=True)
register_gemini_tools(enable_browser=True)
register_planning_tools()so a stock agent-server advertises eighteen names, of which most should never appear in a profile editor:
| Name | Why not selectable |
|---|---|
edit, read_file, write_file, list_directory |
Gemini preset — a parallel family to file_editor; no product path builds an agent from it |
planning_file_editor |
planning agent's internal PLAN.md editor; needs a plan_path computed per launch, which a stored profile cannot supply |
workflow |
low-level half of a pair whose own docstring says to prefer workflow_tool_set |
task, task_tool_set |
delegation, owned by enable_sub_agents |
FinishTool, ThinkTool, SwitchLLMTool, InvokeSkillTool, VisionInspectTool |
built-ins attached via include_default_tools |
canvas_ui, canvas_ui_control |
client-defined, injected at launch |
The agent settings schema does not help either: its tools field is value_type: array with choices: [].
So a client must maintain a hand-curated list and keep it in sync with SDK releases by hand — and getting it wrong is not cosmetic, since this picker decides what an agent is allowed to do.
Ask
Let a tool declare whether it is user-selectable, and expose that where the tool list is served.
There is a clean precedent: usability is already declared per tool (ToolDefinition.is_usable(), captured into _USABILITY_REG at register_tool time and surfaced through list_usable_tools()). A user_selectable classvar handled the same way would fit the existing shape, default True so nothing changes for third-party tools, and be set False on the built-ins, the delegation pair, the planning editor and the low-level workflow.
Whether the Gemini family is "not selectable" or "selectable but a distinct family" is a product call I would not presume — a family/group label might serve better than a boolean there.
Why both, together
They are the two halves of one question, and answering only the first still leaves clients curating a list by hand. With both, a profile editor becomes: ask the server what can be picked, ask the server what this selection resolves to, render both. No duplicated defaults, no drift on SDK upgrade.
It would also let a client show why a tool is present — default / server-injected / from MCP / attached by a skill — which is the honest answer to "which of these can I actually remove?". Today a user cannot tell an injected tool from a chosen one.
Desired Behavior
The SDK answers both questions, so a client renders what the server reports instead of curating its own lists:
- The dry run behind
POST /api/agent-profiles/{name}/materializereports the tool names the agent would actually be constructed with — aftercreate_agent()'s defaulting and the serving layer's environment-dependent injections — alongside the stored tri-state, and can evaluate a draft profile body so an editor can preview before the first save. - A tool declares whether it is user-selectable, and the served tool list reflects that declaration.
Status (2026-09-28)
Half of question 1 has landed in PR #5154 (the unified launch pipeline for #5141).
_resolve_agent_from_profile no longer exists: prepare_agent_launch materializes
tools into the resolved settings from an explicit browser_available runtime input,
and materialize calls that same function with this server's runtime. So the dry run now
reports the concrete tool list including the environment-dependent injection, and a test
plus a live e2e compare the preview against a real launch field by field.
Still open here, and what #5151 implements:
- the stored tri-state alongside the resolved list (feat(agent-profiles): one launch pipeline for every conversation start #5154 replaces
tools: nullwith
the concrete list inresolved_settings; it does not surface the stored value
separately); - draft evaluation — feat(agent-profiles): one launch pipeline for every conversation start #5154 added an inline
agent_profileto conversation start,
not tomaterialize; - everything under question 2 (
user_selectable,catalog_description,
GET /api/tools/catalog).
Note for whoever rebases #5151: its agent_server/profile_launch.py is superseded by
#5154's agent_server/agent_launch.py, which probes the container's browser
availability rather than the host's on the Docker path.
Acceptance Criteria
-
resolve_agent_profile_dry_runreports the tool names the agent would actually be constructed with, including the serving layer's environment-dependent injections. - A profile with
tools: nullreports the standard set;[]reports empty; an explicit list reports itself. The stored tri-state remains separately visible. - Materialize can evaluate a draft profile body, not only a saved profile by name.
- A tool can declare that it is not user-selectable, and the served tool list reflects it.
- The built-ins, the delegation pair, the planning file editor and the low-level
workfloware marked accordingly; a third-party tool that declares nothing stays selectable. - A client that renders the reported lists needs no local copy of
DEFAULT_EXEC_TOOL_NAMESand no hardcoded exclusions.
Relevant code
openhands-sdk/openhands/sdk/profiles/resolver.py—resolve_agent_profile_dry_run,AgentProfileDiagnostics,_build_openhands_settingsopenhands-agent-server/openhands/agent_server/conversation_service.py— the browser injection, which PR feat(agent-profiles): one launch pipeline for every conversation start #5154 moves intoopenhands-sdk/openhands/sdk/profiles/resolver.py::prepare_agent_launchbehind an explicitbrowser_availableinputopenhands-sdk/openhands/sdk/tool/registry.py—register_tool,_USABILITY_REG,list_usable_toolsopenhands-agent-server/openhands/agent_server/tool_router.py— the unconditional preset registration- Consumer:
OpenHands/OpenHands#17235(src/constants/profile-tools.tsholds the workaround for both halves) - Related: [Agent Profile] Sub-agent delegation bypasses a profile's tool and MCP restrictions #4953, [Agent Profile] Profiles can only append to the system prompt, not replace it #4956
Activity
github-actions commentedon Sep 11, 2026
✅
ready-for-devlabel appliedThis issue meets the readiness criteria and is ready for contribution.
A contributor can now open a PR that links this issue (
Fixes #<number>).This is an automated check — no AI was used to generate this comment.
[-]Profile clients can't ask what tools an agent will get, or which tools are pickable[/-][+][Agent Profile] Clients can't ask what tools an agent will get, or which tools are pickable[/+]simonrosenberg commentedon Sep 17, 2026
Where an agent's tools come from, and a proposed catalog design
I built SDK
main(365ceb3, agent-server 1.49.1) and Agent Canvasmain(07590fd). I ran canvas against the local SDK build with the e2e mock LLM, which records every completion request, and opened agents from the canvas home page and through the API. The tables below compare what was stored, what the server set up, and thetoolsarray the LLM actually received.What an agent actually gets
toolsagent.tools)defaultprofile (canvas uses theagent_settingspath)nullagent_profile_id),enable_sub_agents: true[glob, grep]tasktool.enable_sub_agents: true,enable_switch_llm_tool: falsenullfetch) in settings[]What these runs show, beyond what the issue already describes:
materializereports what is stored, not what launches. It returnedtools: nullfor the default profile andtools: []for the last row, whose agent had five tools.enable_sub_agentsis silently ignored oncetoolsis an explicit list (row 2).create_agent()only addstask_tool_setwhentools is None(settings/model.py#L1403-L1409). The UI shows sub-agents as on, but the agent can't delegate.usable_toolsis a static check, not a guarantee. Chromium was detected, so the server addedbrowser_tool_set. The browser then failed to start inside the server, andBrowserToolSet.create()returned zero tools with only a log warning. The same startup worked in a standalone process, so I have not found the cause./api/tools/listed 18 names. Two of them,canvas_uiandFinishTool, come from canvas's owntools/canvas_ui_tool.py, which canvas loads with--import-modules. An SDK-only server lists 16.register_client_toolsregisters each client tool name for the life of the process.tool_module_qualnamesnamedapply_patchandtom_consult, it listed 23 (apply_patch,tom_consult,sleeptime_computeadded)./server_info.usable_toolsfollows the same list, so it can't serve as a picker catalog as-is.ThinkTool,SwitchLLMTool,InvokeSkillToolandVisionInspectToolare never in that list. Built-ins are found throughBUILT_IN_TOOL_CLASSES, not the registry.FinishToolonly appears because canvas registers it.Where tools come from
agent.tools: list[Tool{name, params}]).registry.py#L113). On the agent-server, the imports come from:tool_router.py#L15-L18, which loads four presets:openhands.toolspackage__init__: ask_oracle, task, task_tool_set, workflow, workflow_tool_set.--import-modulesstartup flag.tool_module_qualnames(conversation_service.py#L1759).RemoteConversationsends every tool registered in the client process, and the server keeps those registrations for good. Conversations being resumed re-import theirs.apply_patch,tom_consultandsleeptime_computeship inopenhands-toolsbut only appear once something imports them.browser_tool_setbecomes 14browser_*tools,task_tool_setbecomestask,workflow_tool_setbecomesworkflow. A catalog therefore has to be keyed by the name a profile stores, not by the names the LLM sees.create_agent()defaults (DEFAULT_EXEC_TOOL_NAMES+task_tool_set).conversation_service.py#L446-L455).agent_settingspath:DEFAULT_TOOL_NAMESplus browser/task gating ingetAgentTools.tools.include_default_tools):FinishToolandThinkTool: always.SwitchLLMTool: whenenable_switch_llm_toolis on.InvokeSkillTool: added automatically whenever an invocable AgentSkills-format skill is loaded, which is almost always the case.VisionInspectTool: added automatically when the model can't read images and a saved vision-capable profile exists (agent/base.py#L570-L599).filter_tools_regexdoes not apply to built-ins.client_tools,conversation_service.py#L1788):canvas_ui_controlandlaunch_child_conversationon both launch paths (agent-server-adapter.ts#L1241).mcp_config(filtered bymcp_server_refs), plus MCP servers from plugins: explicitly attached, marketplace auto-loaded, and installed/user/project plugins (local_conversation.py#L1083,#L1133), plusload_plugin()mid-conversation.tools/list_changed).launch_child_conversationstarts new conversations.mcp_configentries.ACP profiles are out of scope for this: ACP agents own their tooling, and only
mcp_configis forwarded.Proposal
The only party that can answer "what can be picked" and "what will this resolve to" is the server that builds the agent. Clients should render its answer rather than recompute it. Concretely:
1. Tools declare catalog metadata.
ToolDefinition:user_selectable: ClassVar[bool] = True, plus a statictitle, a shortsummary, agroup, andrequires(e.g.chromium, or theoracleLLM profile forask_oracle, which today is listed as usable even when no such profile exists).register_toolrecords them the same way it records usability today.user_selectable = Falseon:taskandtask_tool_set(owned byenable_sub_agents)planning_file_editorworkflowClientToolcanvas_ui2. The catalog is fixed once the server has started.
--import-modules).client_tools,tool_module_qualnames) is scoped to that conversation and never listed.--import-modules, and it shows up in profile editors.3.
GET /api/tools/catalog, announced astool_catalog_v1inserver_info.capabilities.profile_secret_scope_v1already does, avoids the version guessing described in [Agent Profile] The profile model isn't self-describing — clients hardcode version numbers to guess which fields a server accepts #4964. Rough shape:{ "tools": [ {"name": "terminal", "title": "Terminal", "group": "core", "selectable": true, "available": true}, {"name": "browser_tool_set", "group": "web", "selectable": true, "available": false, "unavailable_reason": "chromium not found", "requires": ["chromium"]}, {"name": "task_tool_set", "selectable": false, "controlled_by": "enable_sub_agents"} ], "defaults": { "tool_names": ["terminal", "file_editor", "task_tracker"], "injected_when_unset": [{"name": "browser_tool_set", "when": "available"}], "enable_sub_agents_adds": "task_tool_set" }, "builtins": [ {"name": "FinishTool", "always": true}, {"name": "ThinkTool", "always": true}, {"name": "SwitchLLMTool", "controlled_by": "enable_switch_llm_tool"}, {"name": "InvokeSkillTool", "controlled_by": "skills"}, {"name": "VisionInspectTool", "controlled_by": "vision_profile"} ] }mcp_server_refs), not per tool. Tool names per server can be shown on demand with the existingPOST /api/mcp/test.4. One tool-planning function shared by launch and dry run.
_resolve_agent_from_profileinto an SDK function that bothresolve_agent_profileandresolve_agent_profile_dry_runcall.AgentProfileDiagnosticsthen gainsresolved_tools: [{name, source}]. Sources:default,profile,server_injected,enable_sub_agents,builtin,skills,mcp_server,plugin_mcp.POST /api/agent-profiles/materializewith the profile in the body).agent_settingslaunch path, so canvas can dropgetAgentToolsas well asprofile-tools.ts.5. Make
enable_sub_agentsapply even whentoolsis explicit.create_agent()would addtask_tool_set(de-duplicated) whenever the flag is on, so the flag is the only owner of delegation and editors don't need to re-add it on save.task. That matches what the toggle already shows the user.6. Clients render, they don't compute. Canvas's editor would:
materializepreview with a source badge per tool, adding its own client tools to the preview itself;tool_catalog_v1.Cloud can call the same SDK catalog function for the static part. Availability has to come from the runtime, not the app server, and cloud needs to honour
profile.toolsbefore a picker there does anything.Tool selection does not make an agent restricted
This affects how the picker should be presented, especially for a "read-only explorer" profile:
terminalalone can do everything the other tools can.toolsandmcp_server_refs([Agent Profile] Sub-agent delegation bypasses a profile's tool and MCP restrictions #4953).launch_child_conversationstarts children without the parent's profile (child-conversation-launch.ts#L286), so they use the global settings and default tools.mcp_server_refsfiltering, so the profile's MCP scope does not cover them.Suggested order
GET /api/tools/catalogand the capability flag.resolved_toolswith sources, draft materialize, theenable_sub_agentsfix.DEFAULT_TOOL_NAMESandprofile-tools.ts.profile.toolsand serve the catalog.feat(agent-profiles): tool catalog and a truthful materialize preview
feat(agent-profiles): tool catalog and a truthful materialize preview