Repository navigation
feat(agent-profiles): Agent Profiles — Settings → Agent as the profile library (local + cloud) - #1571
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@OpenHands /codereview-roasted |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
simonrosenberg
left a comment
There was a problem hiding this comment.
🌶️ Code review — roasted
Taste rating: 🟡 Acceptable. This is the right architectural call: instead of #1550's 63-file bespoke editor, you leaned on the existing Agent settings page and the LLM-profiles library shape. Adding an opt-in embedded prop to AgentSettingsScreen (header/save-button hidden, seed from agentSettingsOverride, report state via onSaveControlChange) keeps the global /settings/agent page unchanged when the props are omitted — I verified the header and Save button are only gated behind !embedded. The data layer is clean and idiomatic: per-call AgentProfilesClient through getAgentServerClientOptions() (Rule 1 compliant — no raw axios/fetch), backend/org-suffixed query keys, prefix-match invalidation, disableToast with local try/catch toasts. Local-only gating is done in three consistent places (nav filter, route <Navigate> redirect, and the query only ever mounting under the guarded route), with a focused nav test. i18n is complete — all 7 new keys carry all 15 languages, and the ~16 reused profile keys already exist.
So the bones are good. The roast is mostly about where the genuinely-new logic lives vs. where the tests point.
🔴 The one that actually matters — the new mapping logic is untested
The real new brain of this PR is buildAgentProfileFields() in agent-settings.tsx (the ACP "store null when it's the built-in default command, else the verbatim shell string" branch, plus the schema-driven tool_concurrency_limit coercion). That is exactly the kind of translate-live-form-state-into-a-persisted-payload function that silently rots.
And yet every test that touches this flow mocks the embedded form away. agent-profiles-local-view.test.tsx stubs #/routes/agent-settings and hand-feeds an emitControl, so it validates the view's llm_profile_ref merge (good!) but never runs the real builder. There's no buildAgentProfileFields unit test and no tests/e2e/mock-llm/** spec for agent profiles (grep confirms zero). The AGENT-notes "real agent-server" validation drove the ts-client with hand-constructed payloads — i.e. it exercised the client/endpoints, not this UI mapping. So the built-in-default detection and concurrency coercion currently have no automated coverage at any layer. See the inline comment; a small pure-function test (or an extracted helper) would lock the round-trip in.
🟡 Improvement opportunities (non-blocking)
- Copy-paste of the whole menu shell.
agent-profile-actions-menu.tsxis a near-verbatim clone ofllm-profiles/profile-actions-menu.tsx— the portal positioninguseLayoutEffect, resize/scroll listeners, click-outside, Escape/arrow/Tab keyboard handling, and theisPortaledstatic-override classes are duplicated line-for-line; only the menu items differ (no rename/duplicate here). It already reaches across features to importMenuItemfromllm-profiles/, so the coupling exists anyway. A sharedPortaledActionsMenu(items as children/prop) would delete ~90 lines from both. Fine as a follow-up given the deliberate "mirror the LLM-profiles components" strategy, but worth a tracking note so the two copies don't drift. - Rename-then-save is not atomic. In
handleSave, a rename fires as a separate request before the profile save (see inline). If the save fails after a successful rename, the profile is left renamed-but-not-updated with a generic error toast — the user can retry, but the stored state is now inconsistent with what they saw. Acceptable given the two-endpoint API shape; just calling it out. - Version-doc drift. The service header and
use-agent-profilescomment say the endpoints "shipped in agent-server v1.29.0", butpackage.jsonpins@openhands/typescript-clientat1.28.0(unchanged by this PR) and the Docker matrix builds againstagent-server:1.29.3. Not a bug (CI/typecheck pass, so 1.28.0 exportsAgentProfilesClient), but the "v1.29.0" note is confusing next to a 1.28 pin. - No version gate on the nav item. The "Agent profiles" entry shows for every local backend. A user pointed at an older agent-server (before
/api/agent-profilesexisted) will see the nav item, click it, and hit the load-error empty state (no toast, thanks todisableToast). That's consistent with the repo's documented "accept all advertised versions" stance, so it's graceful degradation rather than a bug — noting it so it's a conscious choice.
Testing gaps
- No unit coverage for
buildAgentProfileFields(the ACP built-in-defaultnullvs shell-string branch +tool_concurrency_limitcoercion) — the most regression-prone new logic. - No
tests/e2e/mock-llm/spec for the Settings → Agent profiles flow. The existing 60/60 mock-LLM run proves you didn't regress the global agent page, but nothing exercises create/edit/activate/delete of a profile end-to-end. Asettings/-subdir spec would fit the existing layout and selective-run mapping. Suggested follow-up, not a merge blocker.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW. Additive route + settings library, local-backend-gated, cloud redirects to the unchanged page. The only touch to shared code is theembeddedopt-in onAgentSettingsScreen, and the global page path is unchanged when the new props are omitted (verified). Not in the eval-risk category — no prompt/tool-execution/loop/condenser changes; agent-profile selection is user-driven config, not agent behavior. Worst realistic failure is a mis-mapped save payload in the untested builder, contained to this feature.
VERDICT: ✅ Worth merging once the buildAgentProfileFields mapping gets a unit test (or the human tester confirms the ACP built-in-default round-trip in-app). Leaving this as a COMMENT rather than an approval purely because the PR's most novel logic is the one piece with zero automated coverage — everything else is solid.
KEY INSIGHT: Great minimal-surface design (reuse the page, don't rebuild it) — but the tests validate the boring wiring you reused and mock away the one new function worth testing.
Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:
- Add a
.agents/skills/custom-codereview-guide.mdfile to your branch (or edit it if one already exists) with the/codereviewtrigger and the context the reviewer is missing.- Re-request a review — the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
- When your PR is merged, the guideline file goes through normal code review by repository maintainers.
Resolve with AI? Install the iterate skill in your agent and run
/iterateto automatically drive this PR through CI, review, and QA until it's merge-ready.Was this review helpful? React with 👍 or 👎 to give feedback.
This review was generated by an AI agent (OpenHands) on behalf of the requester.
|
I've completed the SummaryI reviewed the "minimal local Agent Profiles library" PR — grounding every claim against the checked-out branch rather than trusting the description. I read the full diff (23 files, ~1.9k lines) across the data layer (service + query/mutation hooks), the UI components, the Verdict: 🟡 Acceptable — COMMENT review (posted: pullrequestreview-4613069842). What I verified holds up
Why I left a COMMENT rather than APPROVEThe PR's one genuinely-new, regression-prone function — I also flagged (non-blocking): near-verbatim duplication of the actions-menu shell vs. I confirmed this is not in the eval-risk category (no prompt/tool/loop/condenser changes), and assessed overall risk as 🟢 LOW. Two actionable inline comments were attached at the exact lines. |
|
@OpenHands /codereview-roasted Re-review please. Since the last review I addressed the one blocker: extracted |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
|
@OpenHands /codereview-roasted |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
simonrosenberg
left a comment
There was a problem hiding this comment.
/codereview-roasted — re-review
Taste Rating: 🟡 Acceptable — the data layer and profile-library UI are clean and reuse existing patterns well; the prior blocker is genuinely fixed. But this PR quietly changes the conversation-start payload for every local conversation, which lands it in the eval-risk category, so I'm leaving a COMMENT for a human to sign off rather than an APPROVE.
I grounded everything against the checked-out branch (005bb1c), read the full diff (43 files), and traced the start-conversation path 1–2 levels into the SDK-facing payload builder.
Prior blocker — resolved ✅
buildAgentProfileFields() is now a pure exported function in src/routes/agent-settings.tsx, and __tests__/routes/build-agent-profile-fields.test.ts exercises it directly (built-in-default→null vs verbatim shell-string, custom preset, blank-model→null, concurrency coercion, and the throw path). Real code, real assertions on output. 👍
What's good
- API conventions honored.
AgentProfilesServicegoes through the ts-clientAgentProfilesClientviagetAgentServerClientOptions()— no raw axios/fetch (Rule 1 clean). Query keys are centralized inAGENT_PROFILES_QUERY_KEYS; no magic strings at call sites. - Graceful degradation.
useAgentProfilesusesmeta: { disableToast: true }and is gated to local backends, so an old agent-server that 404s/api/agent-profilesdoesn't spam toasts, andnormalizeLaunchedProfile()returnsnullon malformed/absent provenance. - Tests mock the service, not the hook (e.g.
agent-profiles-manager.test.tsx→vi.mock(".../agent-profiles-service.api")), matching the repo testing rules. embedded-mode reuse ofAgentSettingsScreenmirrors theLlmSettingsScreenembed pattern; the ref-backed save-control avoids re-emitting on every keystroke.
[MAIN CONCERN — for a human to decide] Every local conversation now launches via agent_profile_id
src/hooks/mutation/use-create-conversation.ts:82
const requestedAgentProfileId =
agentProfileId ?? agentProfiles?.active_agent_profile_id ?? undefined;This defaults to the active profile even when the user never touched the picker. Combined with the agent-server lazily seeding a default openhands profile on first GET, the practical effect is: after this PR nearly all local conversations start with agent_profile_id and no agent_settings (buildStartConversationRequest drops agent_settings entirely on the profile path).
Why this needs a human eye:
- Agent-behavior change. The conversation-start payload — which agent, which tools, which LLM — is now resolved server-side from the profile instead of the inline
agent_settingsthe frontend has always sent. That's exactly the "changes agent behavior / could affect eval performance" category the repo's review policy says not to auto-approve. - Tool attachment is unverified on this path. The
openhandsagent-profile schema forbidstools/include_default_tools, so whether a profile-launched conversation ends up with the default exec tools (terminal,file_editor,task_tracker, …) depends entirely on the server's resolver defaults. The PR's evidence confirmsPOST /api/conversations→ 201 and thatlaunched_agent_profileis stamped, but I don't see confirmation that a profile-launched OpenHands conversation actually has working exec tools and can complete a real task end-to-end. If the resolver doesn't include default tools, home-launched conversations would be toolless — a serious regression for the primary use case. - The seed path is already known-brittle. The
hasDanglingLlmReffallback (use-create-conversation.ts:98) exists precisely because the seededdefaultprofile can carry anllm_profile_refthat doesn't resolve (SDK #3933), which would 404 and brick home-launch. Having to special-case the seed is a signal this launch path isn't fully baked server-side yet.
Ask: please confirm (screenshot/log or a note) that a fresh local backend, home → start conversation from the seeded/active profile, yields a conversation with the normal exec tools and runs a real tool call. Ideally capture this as a mock-LLM e2e (see below) since the unit tests can only assert payload shape, not server tool resolution.
I've added the e2e-tests label — this touches the conversation-start path and currently has no e2e coverage for profile-launch.
[IMPROVEMENT OPPORTUNITIES]
use-create-conversation.ts:112— positional-arg tail hack.createConversationis now 10 positional params and the call site doesconst profileArgs: [undefined, string] | [] = ...; createConversation(query, …, agentType, ...profileArgs)to skipsandboxId. You already left theTODOto convert to an options object — strongly agree; this position-skipping is a latent footgun (any future param insertion silently shiftsagentProfileId). Not blocking, but the options-object refactor would remove a whole class of bug and is worth doing before more callers pile on.secretson the profile path.buildStartConversationRequeststill attaches savedcustomSecretsasLookupSecrets while omittingsecrets_encryptedon the profile branch — which is correct (plaintextX-Session-API-Keyheaders avoid the pre-1.21.x decrypt-strip bug). Just confirm the server acceptsagent_profile_id+secretstogether; the AGENT evidence didn't mention exercising saved custom secrets through a profile launch.
[TESTING GAPS]
- No e2e covering the actual home→profile→run flow (unit tests validate payload shape only, which cannot catch server-side tool/LLM resolution failures). Given the seed brittleness above, a
tests/e2e/mock-llm/case that launches from a profile and asserts a real tool call would be the highest-value addition here.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟡 MEDIUM — Cleanly gated to local backends and cloud-safe, well-tested at the unit level, and the profile-library UI is low-risk. The medium rating is driven entirely by the silent switch of all local conversation launches to the server-resolvedagent_profile_idpath, whose tool/LLM resolution is not covered by automated tests and depends on a server seed that already needed a client-side workaround. - Recommendation: Don't auto-merge. A human maintainer should confirm a profile-launched OpenHands conversation has the expected exec tools (run a real task once), then this is fine to ship.
VERDICT: ✅ Worth merging after the tool-resolution sanity check — the design is sound and cloud-safe; the open item is verification, not rework.
KEY INSIGHT: The frontend correctly makes agent_profile_id and agent_settings mutually exclusive, but by defaulting to the active profile for every local launch it hands the entire "what tools/LLM does this agent get" decision to a server resolver that this PR itself had to defensively work around — so the one thing worth a human's eyes is proving a profile-launched conversation is actually fully functional, not just 201.
Improve this review? If any feedback seems off, add/adjust
.agents/skills/custom-codereview-guide.mdon this branch with the missing context and re-request review.Resolve with AI? Install the iterate skill and run
/iterate.Was this review helpful? React with 👍 or 👎.
This review was generated by an AI agent (OpenHands) on behalf of the reviewer.
|
I've completed the SummaryI grounded the review against the checked-out branch ( Verdict: 🟡 Acceptable — COMMENT review (posted here). What I confirmed
Why COMMENT instead of APPROVEThe repo's review policy says not to auto-approve changes that affect agent behavior / evals. This PR quietly routes every local conversation through Actions taken
No code was modified — this was a review-only task. |
simonrosenberg
left a comment
There was a problem hiding this comment.
🟡 Acceptable — works, reuses existing patterns well, and the one blocker from the last round (extract + unit-test buildAgentProfileFields) is genuinely resolved. A few things to tighten before this is spotless. Grounded against the checked-out branch (43 files, +3344/-626), not the description.
What's good (so I'm not just roasting)
buildAgentProfileFieldsis now a pure, exported, unit-tested function (__tests__/routes/build-agent-profile-fields.test.tsexercises the ACP built-in-default→nullvs verbatim-shell-string branch and thetool_concurrency_limitcoercion). That's exactly what was asked for.- No API-guard violations. Every agent-server call goes through
AgentProfilesClientviagetAgentServerClientOptions(); no rawaxios/fetch/openHandsreached into the new code (only aretrieveAxiosErrorMessageutil import).src/api/no-direct-agent-server-calls.test.tsshould stay green. - All 8 new
SETTINGS$*/CHAT$*i18n keys exist in all 15 languages — verified statically, socheck-translation-completenessshould pass. - Mutation hooks are consistent (prefix-invalidate
AGENT_PROFILES_QUERY_KEYS.all,meta.disableToast+ caller-side toasts) and the embedded-mode refactor ofAgentSettingsScreenis clean and cloud/local-gated.
[IMPROVEMENT OPPORTUNITIES]
-
[
src/hooks/mutation/use-rename-agent-profile.ts] Dead module.useRenameAgentProfileis never consumed —agent-profiles-local-view.tsxcallsAgentProfilesService.renameProfile(...)directly (grepfinds no importer outside the file itself). Either use the hook in the editor (you'd get the list invalidation for free) or delete it. Right now it's 24 lines of untested, unreachable code. -
[
src/hooks/use-chat-input-profile-state.ts+chat-input-profile-picker.tsx] TheisInConversationpath is unreachable.ChatInputProfilePicker/ChatInputProfileMenuContentare only rendered bychat-input-actions.tsxwhenpickerKind === "agent-profile", i.e.!isCloud && !conversationId. SoconversationIdis alwaysnullin the only consumer andisInConversationis alwaysfalse. That means:- the
createConversation.mutate({ agentProfileId })+navigate(...)branch inselectProfile, - the "start new with profile" hint block (lines 96–102), and
- the
CHAT$START_NEW_WITH_PROFILE_HINTkey (shipped in 15 languages)
can never execute through the real render path — a test can only reach them by calling the hook directly. Either drop the branch + hint + key, or, if it's deliberate forward-compat for showing the picker in-conversation later, say so in a comment and add a gating-layer test that proves it's reachable. As-is it's carrying complexity (and translated copy) for a no-op.
- the
-
[
src/hooks/mutation/use-create-conversation.ts+agent-server-conversation-service.api.tsL363] Positional-param sprawl / theprofileArgsskip hack.const profileArgs: [undefined, string] | [] = effectiveAgentProfileId ? [undefined, effectiveAgentProfileId] : []spreading[undefined, <id>]to skipsandboxIdis exactly the kind of thing that silently misroutes when someone reorders the now-10 positional args. You already left theTODO: refactor to an options object. This PR is the change that pushescreateConversationto 10 params — it's the natural (and cheapest) place to do the options-object refactor rather than defer it. Not blocking, but the hack will rot.
[MINOR / NON-BLOCKING]
- Gating style is inconsistent: the route guards on
backend.kind !== "local"whileuseCreateConversation/chat-input-actionsguard on=== "cloud"/isCloud. Equivalent today (only two kinds), but pick one. useAgentProfilesdefaultsenabled: trueand relies on every consumer being pre-gated to local.meta.disableToastkeeps a stray cloud 404 quiet, so it's safe now, but the "local-only" invariant lives entirely in the callers, not the hook.
[TESTING]
Coverage is solid and follows repo conventions (mock the service, not the hook; real pure-function tests for the mapping). No mock-only anti-patterns. The hasDanglingLlmRef fallback in use-create-conversation.ts is well-commented and has a test — good, since that's the subtle bit.
⚠️ Eval / behavior-risk flag (why COMMENT, not APPROVE)
This changes the conversation-launch path: agent_profile_id (resolved server-side) XOR inline agent_settings, and skips the ACP tag / encrypted-settings / subscription check on the profile path. That can change the effective agent a conversation runs with (tools, sub-agents, LLM). Per this repo's review policy I don't auto-approve changes that can plausibly affect agent/benchmark behavior — flagging for a human maintainer to sanity-check that a profile launch produces the intended tools + LLM before merge.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk: 🟡 MEDIUM — additive, cloud-gated, degrades cleanly to the legacyagent_settingslaunch, and CI is green (Windows build passed; Ubuntu build + mock-LLM/Docker E2E pending at review time). Blast radius is medium because it touches the sharedAgentSettingsScreen(newembeddedmode) and the launch path, but both are well-tested.
VERDICT: ✅ Worth merging once the dead useRenameAgentProfile and the unreachable isInConversation/hint/key are resolved (or explicitly justified) — and after a human eyeballs the launch-path behavior change.
KEY INSIGHT: The "reuse AgentSettingsScreen in embedded mode" bet pays off and keeps the diff lean; the remaining rough edges are all unused surface area (a dead hook, an unreachable picker branch, a param hack you already flagged) rather than incorrect logic.
Improve this review? If any feedback above seems incorrect or irrelevant to this repository, add/edit
.agents/skills/custom-codereview-guide.mdon your branch (with the/codereviewtrigger) to teach the reviewer, then re-request. See the customization docs.Resolve with AI? Install the iterate skill and run
/iterateto drive this PR through CI, review, and QA until it's merge-ready.Was this review helpful? React with 👍 or 👎.
This review was generated by an AI agent (OpenHands) on behalf of @simonrosenberg.
|
Done. I completed the Review: #1571 (review) (COMMENT) What I didI grounded the review against the checked-out branch (43 files, +3344/−626) rather than the PR description — reading the adapter, conversation service, the reused Verdict: 🟡 Acceptable — COMMENT (not APPROVE)Confirmed the previous blocker is resolved: Three improvement opportunities (all grounded, none are correctness bugs):
Why COMMENT rather than APPROVE: per this repo's review policy, the PR changes the conversation-launch path ( No code changes were requested of me — this was a review request — so I made no commits. |
…e Agent settings form Adds a Settings → Agent profiles library (local backends only) that mirrors the LLM-profiles UX: a list of named profiles with a create/edit view that reuses the existing Agent settings form as the editor — you just add a name (and, for OpenHands agents, pick an LLM profile). Deliberately minimal vs the full Phase-4 UX: no chat-input picker, no live switch, no Settings information-architecture rework. Condenser / verification / MCP stay global, exactly as on main. - Data layer: AgentProfilesService + list/save/delete/rename/activate hooks wrapping the ts-client AgentProfilesClient (endpoints shipped in agent-server v1.29.0). - Editor: AgentSettingsScreen gains an opt-in `embedded` mode (hides its header + global Save, seeds from an override, and reports state via a save control) — mirroring how LlmSettingsScreen is embedded in the LLM-profiles view. The global Agent settings page is unchanged. - Library: AgentProfilesLocalView (list/create/edit) + manager/body/row/menu + delete modal, at the additive route /settings/agents, gated to local backends (cloud has no /api/agent-profiles surface yet, epic #3730). - Maps the form to AgentProfileSaveInput: OpenHands requires an llm_profile_ref (via a picker); ACP stores acp_server/acp_model and the command as a shell string. Validated end-to-end against a real agent-server. Part of OpenHands/software-agent-sdk#3713 (Phase 4). An alternative to the larger #1550. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onversation switch
Adds the full chat integration for Agent Profiles (epic #3713, #3727), keeping
the simplified library/editor from the previous commit:
- New-conversation picker (home): an agent-profile toggle replaces the LLM-
profile toggle. Selecting activates the profile so the next conversation
launches from it; conversations start via `agent_profile_id` (resolved
server-side) instead of an inline agent_settings dump.
- Mid-conversation switch, capability-gated by the running agent:
- OpenHands conversation → live LLM-profile switch (`/switch_profile`).
- ACP conversation → live model switch (`set_session_model`, existing
ChatInputModel).
- Home / cloud fall back to the agent-profile picker / model picker.
- Threads `agent_profile_id` through the conversation-start path
(buildStartConversationRequest: agent_profile_id XOR agent_settings; skip the
ACP tag / encrypted-settings / subscription check on the profile path) and
reads the server's `launched_agent_profile` provenance to mark the current
profile without settings-matching.
- Replaces the old SwitchProfileButton/context-menu with the new pickers.
Validated end-to-end against a real agent-server (SDK main): starting a
conversation with `agent_profile_id` returns 201 and stamps
`launched_agent_profile { agent_profile_id, revision }`.
Ported from #1550's chat implementation. Gates green: typecheck, eslint,
prettier, i18n (15 langs), vitest (3496 passed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… stamp the launched LLM ref The seeded `default` agent profile is the enriched baseline that mirrors global agent_settings, not a deliberate profile pick. Launching it via `agent_profile_id` made the server rebuild the agent purely from the profile, dropping the canvas-only enrichments the profile-resolution path can't carry — the `<RUNTIME_SERVICES>` system-message suffix, the `canvas_ui` tool, and project-skill loading. Route the well-known `default` profile through the agent_settings launch instead; named profiles are deliberate custom configs and keep the profile path. Fixes the mock-llm-docker-e2e automation RUNTIME_SERVICES failure. Also from #1571 review: - Stamp the launched OpenHands profile's `llm_profile_ref` into conversation metadata (not the standalone active LLM profile) so the switcher pill names the exact profile the conversation runs when the two differ (#1082). - Add `retry: false` to the LLM-ref validation fetch, matching the sibling agent-profiles fetch, so a slow/erroring /api/profiles falls back promptly. Hoist the well-known name to `WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME` (shared by the launch path and onboarding). Re-onboarding intentionally overwrites `default`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ofile load `useLlmConfigured` derives `isAcpAgent` and the referenced LLM from the active agent profile but omitted that query's loading state from `isLoading`. On a cold cache an ACP agent (which needs no key) briefly read as an unconfigured OpenHands agent, flashing the "LLM not set up" banner until the profiles query resolved. Thread the `useActiveAgentProfile` loading signal into the indeterminate state so consumers render nothing until the active agent profile is known (#1571 review). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ands profiles The `default`→agent_settings shortcut (which preserves <RUNTIME_SERVICES>/canvas_ui) must not apply to an ACP `default` profile: activation is pointer-only, so global agent_settings is stale (still OpenHands) when an ACP profile is active — routing it via agent_settings launched the wrong agent (mock-llm-acp-agent.spec.ts step 3 expected agent_profile_id, got OpenHands agent_settings). ACP also carries no <RUNTIME_SERVICES>/canvas_ui enrichment, so there's nothing to preserve. Gate the shortcut on agent_kind === "openhands"; ACP defaults keep the profile path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
1. The 2. You can't actually clear 3. We lost the specific switch-failure message 4. Retry policy is inconsistent across the agent-profiles fetches 5. Stale comment in 6. Stale 7. The two chat-input pickers are near-duplicates (nit, optional) |
- Gate the default-profile agent_settings downgrade to local backends
only; cloud always launches from the resolved agent_profile_id.
- Emit an explicit schema-default (not an omitted key) when
tool_concurrency_limit is cleared, so edit-save actually resets it.
- Restore the tailored "Switched to {name} failed" toast via
meta.disableToast + a dedicated onError.
- Share one AGENT_PROFILES_RETRY_OPTIONS constant across the launch
path, redirectIfAcpActive, and useAgentProfiles so retry policy
can't drift between call sites.
- Fix a stale comment on optimisticActiveProfile's write path.
- Self-heal a dangling llm_profile_ref in the agent-profile editor by
validating it against the live LLM-profiles list on load.
resolvePickerKind hard-coded cloud conversations to the read-only
model picker, on the premise that cloud has no per-conversation
switch endpoint. That's not true: POST
/api/v1/app-conversations/{id}/switch_profile has existed since
OpenHands#14288 (2026-05-05), predating this PR, and the frontend
plumbing to call it (AgentServerConversationService.switchProfile's
cloud branch) was already implemented and just unreachable.
Cloud OpenHands conversations now resolve to the LLM-profile picker,
same as local, matching how ACP already behaves identically on both
backends. main's old SwitchProfileButton had no cloud gate either, so
this restores previously-working behavior rather than adding new
scope.
✅ Mock-LLM E2E Tests60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
✅ Mock-LLM Docker E2E Test Results60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
|
🚀 Released in v1.2.0. |
HUMAN:
Validated end-to-end against both a local agent-server (latest SDK
main) and the live cloud preview of the backend PR (OpenHands/OpenHands#15060). Drove profile CRUD, launch-from-profile, the Settings → Agent library, the ACP chip/model picker, and the full onboarding flow (OpenHands + Claude Code) in-app. A human should still click through Settings → Agent, the chat-input picker, and onboarding in-app before checking this box.AGENT:
Scope note: this PR grew from the original "local Agent Profiles library" into the full Phase-4 Agent Profiles surface — now local + cloud, with Settings → Agent as the profile library, onboarding that lands on an agent profile, and several correctness fixes found while validating against real backends. Everything below was driven through the real UI (Playwright) against real agent-servers, not just unit-mocked.
Validated live:
main,OH_SECRET_KEYset): profile CRUD (create/edit/rename/set-active/delete), launch-from-profile (agent_profile_id→ 201 +launched_agent_profilestamped), in-conversation LLM-profile switch (/switch_llm), ACP conversation chip + model picker, and onboarding (OpenHands → default agent profile refs the configured LLM + banner clears; Claude Code → default agent profile becomesacp/claude-code, no LLM key needed).ohpr-15060-148preview of feat(enterprise): Agent Profiles on the cloud/SaaS backend (#15044) OpenHands#15060): agent-profiles CRUD (201/200/rename/activate/422-on-missing-ref/delete), org LLM-profile listing, and the un-gated UI drove create → 201 + home launch →POST /api/v1/app-conversations {agent_profile_id}→ 200 withlaunched_agent_profilestamped and the conversation running on the cloud LLM. 0 console errors, CORS clean.Automated gates:
npm run typecheck,eslint,prettier,check-translation-completeness(15 langs), andnpx vitest run(3620 passed / 0 failed).Why
Agent Profiles (epic OpenHands/software-agent-sdk#3713, Phase 4) is a large feature. PR #1550 shipped it but bundled a bespoke kind-aware master-detail editor + a Settings IA rework. This PR keeps the full launch/switch experience while stripping configuration UX down to reuse the Agent settings form we already have — adding a name on top of the existing agent editor turns it into an Agent Profile. Most knobs (condenser, verification, MCP) stay global and are inherited.
The model is: the active agent profile IS the current agent. So "Settings → Agent" no longer needs to be a separate global form — it becomes the profile library, and everything that used to read global
agent_settings(ACP-ness, LLM readiness) now reads the active profile. Paired with backend OpenHands/OpenHands#15060, this works on cloud too.Summary
Settings → Agent is the Agent Profile library
AgentSettingsScreen(embedded) + a name./settings/agentredirects to/settings/agents; the default settings path + ACP route-guard target follow./settings/agents(list → create/edit + set-active + delete) mirroring the LLM-profiles components. OpenHands profiles reference an LLM profile (llm_profile_ref, required); ACP profiles name a provider and carry no LLM.Local + cloud
callCloudProxy(bearer +X-Org-Id) for agent-profiles CRUD + org LLM-profile listing (the editor's picker);AgentProfilesService/ProfilesService.listProfilesbranch to it on cloud. Un-gated the nav item, route, home picker, and launch (agent_profile_idnow rides the cloudPOST /api/v1/app-conversations, which feat(enterprise): Agent Profiles on the cloud/SaaS backend (#15044) OpenHands#15060 resolves + stamps).Chat integration (#3727)
agent_profile_id(resolved server-side)./switch_profile); ACP → live model switch (set_session_model). On cloud the in-conversation surface keeps the model picker by design (no cloud per-conversation switch endpoint, and cloud masks profile secrets).Active profile is the source of truth
useLlmConfigured, the ACP route guard) now derives from the active agent profile's kind — not stale globalagent_settings(activate is pointer-only and never writes them). Falls back to settings only while the profile list loads.llm_profile_ref), not the standalone active LLM profile — and never shows for ACP profiles (the subprocess owns its LLM).Onboarding lands on an agent profile
agent_settings+ an LLM profile / ACP secrets but never touched an agent profile, leaving the active profile disconnected. Now it upserts + activates the seededdefaultagent profile from the user's choice: OpenHands → points itsllm_profile_refat the LLM profile just configured; ACP → makes it anacpprofile for the chosen provider (valid default model, no key).LLM-profile "Active" → "Default"
llm_profile_refseeded into new agent profiles. The agent-profile "Active" badge is unchanged.Correctness fixes found while validating
AgentSettingsScreenexport + a thin route wrapper (mirrorsLlmSettingsRoute).normalizeAgent(the conversation wire parser) droppedacp_server, so an ACP conversation launched from a profile showed a generic chip + empty model picker (theacpservertag isn't stamped on profile launches). Now preserved.defaultprofile reset condenser/verification/suffix/skill_refs/mcp_server_refs(and ACP session mode/timeout) to defaults. Saves now merge the edited fields over the stored profile (kind-aware — a kind switch stays a clean variant replacement), fetched withX-Expose-Secrets: encryptedso skill MCP secrets round-trip as tokens, not masks.agent_settingspath (activation is pointer-only) and silently launched the wrong agent. The launch now awaits the list viaensureQueryData(shared query key;retry: falseso backends without the surface degrade immediately), and the dangling-llm_profile_refdowngrade logs aconsole.warn.How to Test
Local:
main(≥ v1.29.0) withOH_SECRET_KEYset, e.g. on:8017.npm ci && VITE_MOCK_API=false VITE_BACKEND_BASE_URL=http://localhost:8017 npm run dev:frontend.openhands-onboarded): pick OpenHands + enter a real LLM key → land in a runnable conversation; or pick Claude Code → runnable with no key./settings/agents): create/edit/rename/set-active/delete OpenHands + ACP profiles./settings/agentredirects here.Cloud (backend with OpenHands/OpenHands#15060, e.g. a preview env):
8. Register the cloud backend; Settings → Agent is present (no redirect). CRUD + set-active + delete a profile; home launch starts a conversation via
agent_profile_id.Type
Issue Number
Part of OpenHands/software-agent-sdk#3713 (Phase 4, OpenHands/OpenHands#3726 + OpenHands/OpenHands#3727). Backend: OpenHands/OpenHands#15060. A smaller-config alternative to #1550.
Known SDK-side limitations (
agent_profile_idlaunch path)Three architectural gaps in the
agent_profile_idlaunch path — resolved server-side entirely from the stored profile, so it doesn't inherit anything a legacyagent_settingspayload could carry — surfaced while driving this PR's e2e suite against real backends. Same class each time: the SDK profile resolver (_build_openhands_settings) drops anAgentContext/settings enrichment that theagent_settingspath carries. The first two are worked around client-side; the third has no canvas workaround and blocks this PR (see below).skill_refs) — worked around: a profile'sskill_refsdefaults to[](none) server-side when unset, and no profile-creation UI (onboarding, Settings) exposes a control for it — so every new agent profile silently got zero public/user skills.useSaveAgentProfilenow defaultsskill_refstonull(all discovered) whenever unset (commit a30683a). Root cause: Skills & MCP: drop embedded profile skills — one server-owned catalog, per-profile refs, uniform tri-state software-agent-sdk#3979 (+ Remove ollama reference from documentation for now OpenHands#3959).stream=truewired onto the agent's LLM at construction (unlikeagent_settingslaunches, which force it — PR feat: stream OpenHands agent responses #1474), soon_tokennever gets wired, and a laterswitch_llmcall crashes withStreaming requires an on_token callback.ensureLlmProfileStreamsself-heals the referenced LLM profile's persistedstreamfield on first profile-launch (commit 65a429f), migration-shim. Root cause: Profile-launched conversations never enable LLM streaming — on_token crash on switch_llm software-agent-sdk#4014.AgentContext.load_project_skillsdefaults toFalseand the resolver never enables it, so workspace.agents/skills//.openhands/skills//AGENTS.mdare never loaded for profile-launched conversations. Unlike the two above,load_project_skillsis neither a stored-profile field nor a request field — it's hardcoded (absent) inside the SDK resolver, so only an SDK fix can restore it. This is whymock-llm-skills.spec.ts:146fails deterministically (not flake). Root cause: Profile-launched conversations never load project skills (load_project_skills stuck False in resolver) software-agent-sdk#4016. This PR is held until hotfix(frontend): Clear base URL when advanced options is unselected OpenHands#4016 ships in an agent-server release + the pin here is bumped.Cleanup of the two client-side workarounds tracked in #1986 — remove them once their SDK issues ship a root fix.
🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.33.0-pythonopenhands-automation==1.1.49d71042bb496cb0c4503cc186016a6356953c73aPull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-9d71042Run
All tags pushed for this build
About Multi-Architecture Support
sha-9d71042) is a multi-arch manifest supporting both amd64 and arm64sha-9d71042-amd64) are also available if neededUpdate (2026-07-08) — deny-list skills
SDK OpenHands/OpenHands#4017 replaced the profile's
skill_refsallow-list (and embedded skills) with adisabled_skillsdeny-list, so two notes above are superseded:withDefaultSkillRefs/ensureLlmProfileStreamsshims were removed (commit9122e83d) — the SDK now defaults correctly server-side, so there is nothing to work around.mcp_tools), so theX-Expose-Secrets: encryptedround-trip on edit-save is a no-op; the generic profile merge carries thedisabled_skillsdeny-list automatically. Canvas is already deny-list-native via the user-leveldisabled_skillssettings UI; a per-profile skill picker stays out of scope for this minimal editor.