Skip to content

feat(settings): add the Agent Profiles page replacing Agent behind a feature flag (OHE-3747) - #755

Merged
hieptl merged 10 commits into
mainfrom
hieptl/ohe-3456-agent-profiles-page
Oct 27, 2026
Merged

hieptl merged 10 commits into
mainfrom
hieptl/ohe-3456-agent-profiles-page

Conversation

@hieptl

@hieptl hieptl commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

  • A human has tested these changes.

AGENT:


Why

A member in OHE has no way to manage agent profiles: the personal Agent page is a single-agent form, and Agent Canvas redirects every settings page to /settings/app when locked to Cloud. OHE-3456 asks for a personal Agent Profiles page inside the OHE settings shell that matches the Canvas experience, with personal and org-scoped profiles together on one page like the Secrets page.

Summary

  • Behind enable_agent_profiles_page (SaaS): Agent Profiles (/settings/agents) replaces Agent in Personal Settings, /settings/agent redirects there, and the ACP guard is off (the agent kind then comes from the active profile). With the flag off, the Agent page and navigation are exactly as today.
  • Page layout follows the Secrets page: the member's own profiles (add, edit, rename, delete, set as default; every write uses scope=personal) and an Organization agent profiles section listing the org's shared ones read-only (set as default only), hidden when the org has none. A Default badge marks the active profile.
  • Editor: name, agent (OpenHands, or ACP when enable_acp), LLM profile, sub-agents and "let the agent switch LLM profiles" (as tools entries task_tool_set / switch_llm, since SDK 1.58.1 retired the boolean switches), parallel tool calls, MCP servers (all or chosen), secrets (no restriction or chosen; personal and organization-shared secrets listed with an Organization badge), and ACP preset, command, model and credentials.
  • Shared ACP form helpers move from the Agent page into utils/acp-agent-form.ts; ProfileActionsMenu makes Edit, Rename and Delete optional so org rows offer only Set as default; ProfileNameInput takes the agent-profile name rule.

Issue Number

OHE-3747, part of OHE-3456. Needs #753 (the scope API) on the backend; stacked on #754 because both touch the same navigation files.

How to Test

From frontend/:

npx vitest run __tests__/routes/settings.test.tsx __tests__/routes/agent-settings.test.tsx __tests__/hooks/use-settings-nav-items.test.tsx __tests__/components/features/settings __tests__/routes/llm-settings.test.tsx __tests__/i18n
npm run lint
npm run check-translation-completeness

All pass locally. Manually, as a member on a deployment running #753 with OH_WEB_CLIENT_FEATURE_FLAGS_ENABLE_AGENT_PROFILES_PAGE=true, at least one LLM profile, one MCP server and one saved secret:

  1. Settings > Personal Settings shows Agent Profiles and Agent Context, and no Agent; /settings/agent lands on /settings/agents.
  2. Add agent profile: name it, pick an LLM profile, leave MCP on "All servers" and Secrets on "No profile restriction", Save. The row appears without a Default badge.
  3. Row menu > Set as default: the Default badge moves. Start a conversation from Canvas and confirm it launches from this profile.
  4. Edit: switch MCP to "Choose servers" and clear one, switch Secrets to "Choose secrets" and pick one (an organization secret shows the Organization badge), turn off "Let the agent switch LLM profiles", rename, Save. Reopen: the selections persisted and the Default badge survived the rename.
  5. With enable_acp on: create an ACP profile, pick a preset, enter credentials, Save. The row's secondary label reads "ACP".
  6. If the org has shared profiles, they appear under Organization agent profiles with only Set as default in their menu.
  7. Delete the default personal profile: the pointer clears and no row carries the badge.

Video/Screenshots

Screenshots added by an AI agent (OpenHands) on behalf of a reviewer. Captured from this PR's head (047afa0) running npm run dev:mock:saas with temporary MSW mocks for /api/agent-profiles (the backend from #753 isn't available here), with enable_agent_profiles_page and enable_acp on. Profile names, LLM profiles, MCP servers and secrets are mock data. The images live on the pr-assets/755-screenshots branch, which can be deleted after merge.

Navigation: flag off (today) vs flag on. With the flag on, Agent is replaced by Agent Profiles + Agent Context, and /settings/agent redirects to /settings/agents.

Flag off: /settings/agent (unchanged) Flag on: /settings/agents
Flag off: existing Agent page Flag on: Agent Profiles list

Row actions. Personal profiles get Edit, Set as default and Delete. Org-shared profiles only get Set as default.

Personal row menu Organization row menu
Personal profile row menu Org profile row menu

Set as default moves the Default badge and shows a toast. Delete asks for confirmation first.

After "Set as default" on pr-reviewer Delete confirmation
Default badge moved to pr-reviewer Delete profile modal

Editor. Create and edit share one in-place form: name, agent kind, LLM profile, the sub-agents and switch-LLM toggles (saved as tools entries), parallel tool calls, MCP servers ("All servers" or "Choose servers") and secrets ("No profile restriction" or "Choose secrets", with org-shared secrets badged Organization). For an ACP agent, the LLM and tool fields are replaced by preset, command, model and credentials.

Add agent profile (defaults) Edit: OpenHands, chosen MCP + secrets Edit: ACP agent (Claude Code preset)
Add agent profile form Edit OpenHands profile with chosen servers and secrets Edit ACP profile

Type

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

Notes


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-3fc195d

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  openhands/app_server/web_client
  web_client_models.py
Project Total  

This report was generated by python-coverage-comment-action

…files pages (OHE-3744)

Two env-backed web-client feature flags, both default off:

- enable_agent_context_page (ENABLE_AGENT_CONTEXT_PAGE) shows the dedicated
  Agent Context settings page.
- enable_agent_profiles_page (ENABLE_AGENT_PROFILES_PAGE) replaces the
  personal Agent page with Agent Profiles, and implies the Agent Context
  page since the Agent page hosted the memory toggle.

isSettingsPageHidden hides /settings/agent-context and /settings/agents
unless the matching flag is on, so the nav item and the route redirect
share one rule. No visible change while both flags are off.
…flag (OHE-3745)

Moves the "Enable Persistent Memory" toggle out of Settings > Agent into
its own Personal Settings item, /settings/agent-context (SaaS only),
shown when enable_agent_context_page (or enable_agent_profiles_page) is
on. The page saves enable_memory_context through the existing settings
endpoint. With the flag on, the Agent page no longer renders the inline
section; with it off, the Agent page is unchanged. The item is
OpenHands-only (disabledByAcp), as the inline section was.
…feature flag (OHE-3747)

With enable_agent_profiles_page on (SaaS), Personal Settings shows
"Agent Profiles" (/settings/agents) instead of "Agent", and
/settings/agent redirects there. The page follows the Secrets layout:
the member's own profiles (add, edit, rename, delete, set as default,
every write with scope=personal) and an "Organization agent profiles"
section listing the org's shared ones read-only (set as default only),
hidden when empty.

The editor covers name, agent (OpenHands, or ACP when enable_acp), LLM
profile, sub-agents and "let the agent switch LLM profiles" (as tools
entries, since the SDK retired the boolean switches), parallel tool
calls, MCP servers, secrets (personal and organization-shared, with an
Organization badge) and ACP preset, command, model and credentials. The
ACP guard is off while the profiles page is on, since the agent kind
then comes from the active profile. With the flag off, the Agent page
and nav are unchanged.
@hieptl
hieptl force-pushed the hieptl/ohe-3456-agent-context-page branch from 57f5308 to 4181692 Compare October 24, 2026 08:38
@hieptl
hieptl force-pushed the hieptl/ohe-3456-agent-profiles-page branch from 4e39c1e to 047afa0 Compare October 24, 2026 08:38
@hieptl hieptl changed the title feat(settings): replace the personal Agent page with Agent Profiles (OHE-3456) feat(settings): add the Agent Profiles page replacing Agent behind a feature flag (OHE-3747) Oct 24, 2026
@hieptl
hieptl marked this pull request as ready for review October 26, 2026 15:53

@tofarr tofarr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🍰 - I added some screenshots too

Base automatically changed from hieptl/ohe-3456-agent-context-page to main October 27, 2026 11:20
hieptl and others added 7 commits October 27, 2026 18:35
Resolve the conflicts with main after #753, #1007 and #754 were squash-merged:

- routes.ts, routes/settings.tsx: keep main's text and re-add the
  /settings/agents route and SAAS_ONLY_PATHS entry.
- i18n/translation.json: main's file plus the 32 keys only this branch adds;
  declaration.ts regenerated with make-i18n.
- constants/settings-nav.tsx: drop the Agent Context item the auto-merge
  duplicated, keeping main's copy after the new Agent Profiles item.
…Agent Profile editor (OHE-3748) (#1008)

System prompt in three modes (OpenHands default, default plus
instructions as system_message_suffix, custom persona), and the
condenser and verification sections of the agent-settings schema
rendered per profile, excluding the global-only verification keys.
Hidden fields and cleared values are left out of the stored section so
server defaults apply; a section is never written back unseeded.
…le editor (OHE-3749) (#1009)

* feat(settings): add system prompt, condenser and verification to the Agent Profile editor (OHE-3748)

System prompt in three modes (OpenHands default, default plus
instructions as system_message_suffix, custom persona), and the
condenser and verification sections of the agent-settings schema
rendered per profile, excluding the global-only verification keys.
Hidden fields and cleared values are left out of the stored section so
server defaults apply; a section is never written back unseeded.

* feat(settings): add skills with organization scope to the Agent Profile editor (OHE-3749)

A Skills section listing the server's global and user skills plus the
skills of every marketplace the member inherits or registered, with an
Organization badge on organization-marketplace skills. All skills are on
by default; unchecked ones are saved as the profile's disabled_skills
deny-list.

* feat(settings): add a tools picker and tool catalog endpoint to the Agent Profile editor (OHE-3754) (#1012)

GET /api/tools/catalog serves the SDK tool registry's catalog (a copy of
the endpoint proposed in #763). The editor's sub-agents and LLM-switching
switches move under a Tools section with two modes: "Standard set" keeps
today's behaviour, "Choose tools" lists the catalog and saves an explicit
tool list, which the profile-backed automation templates require. The
picker is seeded from the standard set, pinned entries keep their params,
a pinned tool the catalog does not list is shown and flagged once the
catalog has loaded, and at least one tool is required.
…E-3755) (#1013)

* feat(settings): add system prompt, condenser and verification to the Agent Profile editor (OHE-3748)

System prompt in three modes (OpenHands default, default plus
instructions as system_message_suffix, custom persona), and the
condenser and verification sections of the agent-settings schema
rendered per profile, excluding the global-only verification keys.
Hidden fields and cleared values are left out of the stored section so
server defaults apply; a section is never written back unseeded.

* feat(settings): add skills with organization scope to the Agent Profile editor (OHE-3749)

A Skills section listing the server's global and user skills plus the
skills of every marketplace the member inherits or registered, with an
Organization badge on organization-marketplace skills. All skills are on
by default; unchecked ones are saved as the profile's disabled_skills
deny-list.

* feat(settings): let org admins manage organization Agent Profiles (OHE-3755)

Behind the new enable_org_agent_profiles flag (ENABLE_ORG_AGENT_PROFILES),
admins and owners (frontend permission manage_org_agent_profiles) get an
"Add organization profile" button and Edit/Delete on the organization's
profiles; legacy ACP org profiles can only be deleted. Other members keep
the read-only section.

The editor takes a profileScope. For an org profile it hides the agent
kind and the MCP section (saving mcp_server_refs: []), always lists the
organization's shared secrets explicitly, loads instance and inherited
marketplace skills only, and warns when a legacy org profile still has
null refs. Writes use the edited row's scope.

* feat(settings): add a tools picker and tool catalog endpoint to the Agent Profile editor (OHE-3754) (#1012)

GET /api/tools/catalog serves the SDK tool registry's catalog (a copy of
the endpoint proposed in #763). The editor's sub-agents and LLM-switching
switches move under a Tools section with two modes: "Standard set" keeps
today's behaviour, "Choose tools" lists the catalog and saves an explicit
tool list, which the profile-backed automation templates require. The
picker is seeded from the standard set, pinned entries keep their params,
a pinned tool the catalog does not list is shown and flagged once the
catalog has loaded, and at least one tool is required.
…tems (OHE-3456)

The user context menu hides the Agent Context and Agent Profiles entries
until enable_agent_context_page and enable_agent_profiles_page are on, and the
mocked config in these tests leaves both off. Exclude those paths the way the
tests already exclude the other hidden routes.
The previous commit let prettier rewrap the whole file; keep only the
flag-gated path exclusion it was meant to add.

@tofarr tofarr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🍰

@hieptl
hieptl merged commit c17dac1 into main Oct 27, 2026
23 checks passed
@hieptl
hieptl deleted the hieptl/ohe-3456-agent-profiles-page branch October 27, 2026 14:05
hieptl added a commit that referenced this pull request Oct 27, 2026
…storage-api-and

Resolves the conflicts with the merged Agent Profiles work (#753, #754,
#755, #763, #1007, #1010, #1011) by keeping both sides: both feature
flags and their nav-hiding rules, both LLM-profile delete guards and
rename cascades in org_profiles, and the Model Router launch hydration
after main's SDK-based Agent Profile resolution in saas_settings_store.
The user-menu test keeps the isSettingsPageHidden filter, which covers
main's hard-coded agent-page set as well as the Model Router page.

Semantic follow-ups: re-add the resolve_profile_llm import main dropped
from saas_settings_store (the router hydration still uses it), and
renumber the Model Router migration from 199 to 201 chaining off main's
200 (main now holds 199 and 200), and move the alembic head pinned by
main's agent-profile upgrade test from 200 to 201 accordingly.
@openhands-release-bot openhands-release-bot Bot added the released: 1.81.0 Shipped in 1.81.0 label Oct 28, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.81.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.81.0 Shipped in 1.81.0 type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants