Repository navigation
fix(app-server): honour a profile's tool selection on cloud; tools is the only tool control - #453
simonrosenberg wants to merge 28 commits into
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
882443c to
fa51e9d
Compare
An active agent profile is resolved into `agent_settings` before the launch, tools included — and then the launch rebuilt the default set and threw the selection away. The agent-profile tool picker is therefore inert on cloud: the choice is stored, resolved, carried, and discarded. An explicit `tools` list is now used as given; `None` still means the server default, so nothing changes for users without a profile. Sub-agent definitions are registered whenever delegation is asked for — by the legacy switch or by selecting `task_tool_set`, which is how an agent profile asks (software-agent-sdk#5151). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fa51e9d to
5365e5f
Compare
Cloud sandboxes always ship a browser, but the resolver defaults browser_available to False on SDKs that take it, so a default-tools profile launched without browser_tool_set. Pass it where supported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Treat legacy persisted tools: [] as the default set instead of an agent with no working tools. - Drop sub-agent definitions needing tools the explicit selection left out, so delegation (e.g. web-researcher) can't bypass the picker. - Remove the 2+-LLM-profile switch_llm attach. create_agent already adds switch_llm whenever enable_switch_llm_tool is set, so the attach only ever fired to override a profile or user that turned it off, and it checked include_default_tools only. - Pin enable_switch_llm_tool off in the selection test so it holds on SDKs that deliver switch_llm alongside tools; trim test docstrings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…alog SDK - Honour resolved `tools` only on a profile launch; a launch without a profile keeps building the default set, so the sub-agents switch still works there. - Keep a profile's switch_llm next to the planning tools in PLAN mode. - Load stored pre-v3 profiles with `tools: []` as unset, so the SDK migration keeps them on the standard set cloud always launched. - Make the browser test assert the resolver receives browser_available=True instead of passing vacuously on 1.49.6. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nt filter - Rewrite stored `tools: []` agent profiles to `null` in migration 172 instead of guessing legacy rows from schema_version on every read. That guess broke once SDK 1.49.6 kept writing v2 rows. - Remove the agent_definitions filter. The sandbox registers every built-in sub-agent itself, so the filter had no effect. The resolved task_tool_set spec now carries the restriction (SDK#5151). - cloud_resolve_kwargs() checks the signature of the resolver it is given, so the materialize dry run is checked against itself. - Match switch_llm and task_tool_set by canonical tool name in one helper. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
|
…cker The profile editor no longer has sub-agent / LLM-switching toggles: tools are only chosen from the catalog. The route lists the tools the sandbox agent-server registers, all usable since cloud sandboxes ship the browser. On an SDK without the catalog it returns 404, which the editor reads as "no picker". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Renumber the empty-tools migration to 173 after main's 172. - Spell selected built-ins by class name and keep one spec per tool, so a profile selecting switch_llm launches on SDK 1.49.6 in both modes. - Reuse the SDK's canonical_tool_name when present; drop the redundant sub-agent clause. - Skip catalog usability probes when list_tool_catalog supports it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Old clients still send enable_sub_agents / enable_switch_llm_tool; when the SDK provides apply_tool_switch_request, apply it against the stored profile so a changed switch edits tools and an unchanged stale one cannot re-add a removed tool. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The SDK release this ships with is now the minimum, and tools is the only tool control: - Remove the apply_tool_switch_request path, cloud_resolve_kwargs and the inspect.signature fallbacks; call the new SDK signatures directly. - Register agent-server tools once at app startup instead of per request. - Cloud launch builds tools from the profile's selection or the standard set (with switch_llm) and never reads enable_sub_agents / enable_switch_llm_tool; drop the built-in respelling and dedup helpers create_agent now covers. - Frontend: remove the global sub-agents toggle, its schema mock, defaults and i18n keys. Sub-agents and LLM switching are configured on profiles. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The no-profile launch took the standard set from openhands-tools plus an appended switch_llm; launch_tool_specs gives the same set from the SDK for both the default and a profile's explicit list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…o pre-v3 profiles Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code review (xhigh) — cross-PR findings (see full list on OpenHands/software-agent-sdk#5151)4. Cloud launches without a profile ignore 9. 11. Migration 173 can abort the upgrade and misses already-rewritten rows — 173_unset_empty_agent_profile_tools.py#L30 Also relevant from the SDK side: #8 (schema bump not rollback/rolling-deploy safe — old pods drop v3 profiles on next write) and #2 ( I'll push fixes and follow up with a summary. |
…sub-agents - Resolve the launch's tools from user.agent_settings.tools on every launch, so the SDK's fold of the retired switches (sub-agents on, switch_llm off) reaches cloud conversations without a profile. - Forward only built-in sub-agents whose tools the parent agent has. - Migration 173: treat a non-integer schema_version as legacy and skip, with a warning, a row that cannot be decrypted or parsed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Entries that fail validation (e.g. a newer schema_version written by a newer pod) are now held aside and serialized back verbatim, and an active pointer naming one is kept, so a reader on an older schema no longer deletes them on its next mutation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fixes for the xhigh review findings — pushed in
|
…p PRs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A member settings save drops the retired enable_sub_agents / enable_switch_llm_tool keys from the stored diff, so they are not re-applied on every load (Reset to standard tools now sticks, and task_tool_set can be kept). - An unversioned legacy member diff with `tools: []` loads as the standard set rather than as an explicit bare list. - Saving or renaming a profile checks names and the profile limit against profiles hidden for schema drift too. - Drop the field validator the wrap validator made redundant; type the wrap validator with Self. - Register the catalog's tools explicitly instead of importing the agent-server tool router for its side effects. - Renumber the empty-profile-tools migration to 174 (main added 173). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Deployment validation: self-hosted (Replicated embedded cluster)Validated on two internal Replicated fleet instances (test customers only) with a release on the test channel
Tool lists below are read from each sandbox's agent spec ( Upgrade lane (shared-5): Stable 0.71.1 (enterprise 1.64.0, SDK 1.49.5) → test releaseSeeded on Stable: settings with
All 8 profiles kept their ids and none were dropped. No response carries
Also checked:
Rollout: the old pod answered until 12:28:30Z while the new pod's init containers ( Fresh lane (shared-6): clean install on the test channel
Gaps
Result: PASS, with the materialize gap as a follow-up. |
main took 174 for the Procrastinate schema, which left two alembic heads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f version Migration 108 stamped member diffs schema_version 1. Merged over the org's current settings, that stamp re-ran the SDK's tool-switch fold, so an org that dropped switch_llm or picked no tools got the default back for every member who hadn't saved since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on-cloud-launch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openhands-sdk #5434 deprecates ACPAgentSettings.llm and drops it from serialized ACP settings, so with the SDK release this PR targets an ACP save leaves the member's stored llm as it was and the llm.model assertion fails. agent_kind and acp_server still show the save persisted, and the test passes on both SDK versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This remains useful, but I converted it back to draft because it is not currently safe to mark merge-ready. #758 records the concrete refresh/rollout work: revision 175 collides with an already released migration on main; runtime and mypy SDK pins predate the APIs this branch calls; skipped malformed/encrypted rows need an audit; and the mixed-version/rollback policy must be validated. Renumbering alone is not enough. No migration was changed or deployed during this audit. |
|
Superseded by #763, which consolidates tool selection, retired-switch handling, opaque-entry preservation and the tool migration with the other Enterprise Agent Profile fixes. The replacement uses released SDK 1.54.0, adds strict launch resolution and revision 187 after the current migration head, and includes an upgrade/audit guide. #763 has passing CI, 7,577 passing local backend tests, real HTTP/model QA, and an independent automated QA PASS. Closing this duplicate PR so review and follow-up happen in one place; the linked issues remain tracked until #763 merges. |
HUMAN:
The agent-profile tool picker (software-agent-sdk#5151 + OpenHands/OpenHands#17516) does nothing on cloud without this: the selection is resolved into
agent_settingsand then thrown away at launch. Now every launch uses the resolvedtools, with or without a profile. It also makes migration 175 and the profile envelope safe on bad or newer rows. Sub-agent scoping is left for follow-up PRs.AGENT:
Why
SaasSettingsStore.load()resolves the active agent profile and carries the result intouser.agent_settings, tools included. The live-status launch then rebuilt the tool list from scratch withget_default_tools(...), so a profile's tool selection never reached a cloud conversation. Any tool-selection UI is inert on cloud until the launch reads what was resolved.software-agent-sdk#5151 also makes
toolsthe only tool control, on profiles and onAgentSettings:enable_sub_agents/enable_switch_llm_toolare no longer stored or returned, and are accepted only as deprecated input folded intotools. Enterprise has to stop reading and sending them.Summary
launch_tool_specs(..., browser_available=True), the same function the agent-server uses, so enterprise keeps no copy of the default set.user.agent_settings.tools: a profile's resolved selection, or the stored settings, where the SDK has folded the retired switches intotools. So a row with sub-agents on keepstask_tool_set, and a row withswitch_llmoff doesn't get it. Withtoolsunset, the launch gets the standard set: terminal, file_editor, task_tracker, browser_tool_set andswitch_llm.switch_llmnext to the planning tools only whentoolsis unset or explicitly selects it.task_tool_setis in the launched tools, all of them, as before. This PR doesn't restrict sub-agent tools; that's for follow-up PRs (software-agent-sdk#5358, #4953).SwitchLLMToolattach is gone, along with the built-in respelling and de-duplication helpers; the SDK'screate_agentnow covers both.browser_available=True, at launch (SaasSettingsStore) and in the materialize preview, which also passescheck_usable=Falsesince cloud sandboxes can't be probed from the app-server. The new SDK signatures are called directly.GET /api/tools/catalogserves the cloud profile editor fromlist_tool_catalog(check_usable=False). The catalog's tools (the default, Gemini and planning presets plustask_tool_set) are registered explicitly once at import ofserver/routes/tool_catalog.pyinstead of inside the request, which used to block the event loop for ~2s on each worker's first call.tools: []profiles totools: null. Cloud always ignored stored tools, so[]meant "the standard set" there. It runs on raw rows before the SDK's v2→v3 profile migration, so a v2[]profile with sub-agents on still ends up with the standard set plustask_tool_set. The SDK's own migration also treats a legacy[]asnull, which covers rows a new pod rewrites before 175 runs. A non-integer or missingschema_versioncounts as legacy, and a row that can't be decrypted or parsed is logged and skipped, so one bad row can't abort the upgrade.schema_version) and writes them back unchanged, including whenactivepoints at one. Before, the next save dropped them. Saving or renaming a profile checks names and the profile limit against those hidden entries too, so a pod can't create a second profile with a hidden one's name.SaasSettingsStore.loadvalidates the merged org/member settings through the SDK, which applies the v7→v8 fold of the switches intotools. A member save drops the retired switches from the stored member diff, which is merged key by key, so they aren't re-applied on every later load. "Reset to standard tools" then sticks, and a selectedtask_tool_setisn't stripped. An unversioned legacy member diff withtools: []loads as the standard set. A member diff that sets no tool keys doesn't carry itsschema_versioninto the merge: migration 108 stamped those diffs v1, which re-ran the fold over the org's current tools and gave backswitch_llm(or the standard set for[]) to every member who hadn't saved since.Release
Requires the SDK release that ships software-agent-sdk#5151 (1.51.0); nothing here supports older SDKs. Before merge, once it's published, bump:
pyproject.toml/uv.lock:openhands-agent-server,openhands-sdk,openhands-toolsdev_config/python/.pre-commit-config.yaml: the mypy hook'sopenhands-sdk==1.39.1, so CI type-checks against the new SDK namestests/unit/test_saas_settings_store.py::test_store_agent_kind_switch_stays_scoped_to_acting_member: 1.51.0 also ships software-agent-sdk#5434, which stops serializingACPAgentSettings.llm, so an ACP save no longer overwrites the member's storedllm. Done here in7103618e6: thellm.modelassertion is dropped,agent_kindandacp_serverstill show the save persisted, and the test passes on both SDK versions.Behaviour changes
task_tool_set, and one who had LLM switching off doesn't getswitch_llm.toolson load (with a deprecation warning) and loses the switch on that member's next save.Issue Number
Part of the agent-profile tool catalog work (software-agent-sdk#5151, software-agent-sdk#4958).
How to Test
All run against software-agent-sdk#5151 installed editable over the 1.49.6 pin (the target suites re-run at
a3359d1, the rest ata88186b).Final round (2026-10-02, after merging
mainat83934366e, against SDKmain35410b3afwith #5406 merged): full backendtests/unit6845 passed, 1 failed (test_process_sandbox_service::test_default_values, the macOS temp dir again).Pre-merge round (2026-10-02, after merging
main, against SDK48be172):maintook revision 174 for the Procrastinate schema, which left two alembic heads, so the empty-tools migration is now 175.tests/unit/app_server, agent profiles, settings store, org store, tool catalog and migration 175: 2262 passed, 2 failed, both unrelated to this PR (test_default_values, and the ACPllmassertion listed under Release, which fails the same way onmainwith the new SDK). The new stale-member-diff test fails without its fix (['terminal', 'switch_llm']).Review-fix round (2026-09-30, enterprise
77e9d3fafter mergingmain, SDK48e2e34):tests/unit/app_server, agent profiles, settings store, org store, org profiles, tool catalog and migration 174: 2302 passed, 1 failed (the same unrelatedtest_default_values). New tests for the save dropping retired switches, the legacy[]member diff, and name/limit checks against hidden profiles fail with their fixes reverted. The pre-commit mypy hook only reports the SDK names it can't see until the pin is bumped (the wrap-validator typing error it also reported is fixed).Target suites (cloud launch,
test_agent_profiles.py,test_tool_catalog.py): 269 passed.Full backend
tests/unit(8 workers): 6718 passed, 1 failed (test_process_sandbox_service::test_default_values, macOS temp dir isn't/tmp; unrelated).Frontend: vitest 2711 passed;
tscclean; eslint and prettier clean on changed files.ruff clean; mypy against the editable SDK reports nothing in changed files.
The new launch and migration tests fail against the old code, and so does the envelope test.
Re-run against SDK
79799a0: the launch service and agent-profile suites pass (272).Stored-settings migration checked by hand: a v6 row with
enable_sub_agents=Trueloads withtask_tool_setandswitch_llm;enable_switch_llm_tool=Falseloads withoutswitch_llm; a member diff or v7 row with a leftover switch folds intotools.The SDK and canvas sides were validated end to end on a local stack (see software-agent-sdk#5151 and OpenHands/OpenHands#17516); Cloud itself was not stood up.
Video/Screenshots
No new UI here beyond removing the global toggle. The picker is in OpenHands/OpenHands#17516.
Type
Notes
task_tool_setcan delegate to every built-in sub-agent, with its own tools. Scoping is for follow-up PRs (software-agent-sdk#5358, #4953).🤖 Generated with Claude Code
Enterprise server image for this PR: