128 Commits

Author SHA1 Message Date
Hiep Le 89dc8bd446 feat: land the Canvas Extensions frontend (load pages, sidebar, customize) (#16895) 2026-08-27 17:53:40 +00:00
Hiep Le 732f866ed6 chore: bump SDK deps (software-agent-sdk 1.44.0, automation 1.9.0, extensions 0.19.0) (#16968)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-08-27 17:40:12 +00:00
Graham Neubig d104ffdc33 feat: fix default and free models (#16922)
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Juan Pedro Michelini Jorge <juan@juan.com.uy>
Co-authored-by: allhands-bot <allhands-bot@users.noreply.github.com>
2026-08-27 15:58:35 +00:00
george larson cd64987665 fix(providers): follow next_page_id so cloud picks surface past the default page size (#16758) 2026-08-23 11:27:47 -04:00
Vasco Schiavo 19c6b40944 fix(ci): edit the mock-LLM E2E PR comment in place (#16591) 2026-08-23 13:57:08 +00:00
george larson 10d2285dd0 fix(acp): surface a 'credentials configured' banner state on Docker/cloud (#15643) (#16145)
Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
2026-08-23 09:54:48 -04:00
KeelTrace 4bf8dd3aaf feat(settings): select supported LLM providers (#16772)
Co-authored-by: Juan Pedro Michelini Jorge <juan@juan.com.uy>
2026-08-22 00:14:07 -03:00
FraterCCCLXIII d70cf83a33 feat(conversation): add overview panel and unified commits drawer (#16230)
Co-authored-by: hieptl <hieptl.developer@gmail.com>
2026-08-20 17:47:40 +07:00
Vasco Schiavo 6dcc9f5b3e refactor: finish the microagent→skill rename in the frontend (#16672) 2026-08-18 11:03:26 +02:00
Juan Pedro Michelini Jorge 8989bf3bb5 feat: set Canvas default model to Kimi K3 and tag it free (#16657)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-08-17 16:12:28 -03:00
Graham Neubig d66157e689 test: capture Docker E2E container logs (#16660)
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Vasco Schiavo <115561717+VascoSch92@users.noreply.github.com>
2026-08-17 19:05:21 +00:00
Graham Neubig 0d15c5e79e feat(canvas): present structured error outcomes (#16231)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: allhands-bot <allhands-bot@users.noreply.github.com>
2026-08-15 14:01:26 -04:00
Graham Neubig dc99e98615 fix: preserve backend scope in conversation links (#16091)
Co-authored-by: neubig <398875+neubig@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: allhands-bot <allhands-bot@users.noreply.github.com>
2026-08-14 20:20:19 -04:00
Juan Pedro Michelini Jorge fa21e01a6c fix(onboarding): preselect OpenHands LLM provider after picking OpenHands agent (#16531)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-08-14 11:05:27 -03:00
Graham Neubig 83ba34cce6 chore: bump SDK deps (software-agent-sdk 1.42.1, automation 1.7.1, typescript-client 1.38.0) (#16554)
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2026-08-12 21:16:34 -04:00
Graham Neubig bf2e37dcad fix: preserve MCP credentials during Canvas mutations (#16144)
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2026-08-04 22:48:42 -04:00
Hiep Le 565c10daa2 chore: bump @openhands/extensions to 0.16.0 (#16321) 2026-08-05 02:32:41 +07:00
Rishav Naskar 947d9a0358 fix(backends): pin backend identity on sidebar conversation links (#16243)
Co-authored-by: hieptl <hieptl.developer@gmail.com>
2026-08-04 13:15:32 +07:00
Hiep Le 5d5a0648db feat: mock the setup contract from the published fixtures (#16221) 2026-08-01 00:16:05 +07:00
FraterCCCLXIII 932edbf812 feat(backends): compact Cloud vs Agent-server add-backend chooser (#16211)
Co-authored-by: Devin <devinvinson@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: Graham Neubig <neubig@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2026-07-31 02:35:47 -04:00
Rohit Malhotra 8dfa1d510c fix: Revive local telemetry consent banner (#16183)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-07-29 17:58:08 -04:00
simonrosenberg f4612aaafb fix: remove ACP settings access gating (#1908)
* Remove ACP settings access gating

* Test ACP settings access in mobile hub

* test: stabilize mock-LLM skills navigation

Co-authored-by: openhands <openhands@all-hands.dev>

* test: retry mock-LLM skills navigation

Co-authored-by: openhands <openhands@all-hands.dev>

* test: avoid redundant model switch reload

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-07-25 08:39:56 +00:00
Hiep Le 7b1e07d6f8 feat: add windows desktop installer build, docs, and win32 fixes (#1897)
* feat: add Windows desktop installer build, docs, and win32 fixes

* fix: failing tests

* refactor: update the code based on feedback
2026-07-24 06:25:07 +00:00
Rohit Malhotra efd20f7d56 fix: suppress telemetry consent prompt in Cloud Canvas (#1848)
* Suppress telemetry consent modal in Cloud Canvas

Treat same-origin locked Cloud cookie deployments as already consented for Canvas library telemetry so the modal does not flicker before the main app login flow.

Co-authored-by: openhands <openhands@all-hands.dev>

* Stabilize mock LLM settings tests after ACP

Reset the default agent profile back to OpenHands through the agent-profile API before LLM-profile setup paths that need /settings/llm. This prevents an ACP profile left by the previous serial spec from redirecting later settings tests to /settings/agents.

Co-authored-by: openhands <openhands@all-hands.dev>

* Stabilize files tab mock E2E git setup

Ensure the attached-workspace conversation has both an origin remote and a real HEAD commit before asserting that the Files tab defaults to diff view. The diff default now intentionally depends on both attached source metadata and an available commit base.

Co-authored-by: openhands <openhands@all-hands.dev>

* Fix desktop right panel toggle visibility

Update the desktop right-panel toggle to set both the user-toggled flag and the visible state. The missing visibility update left the panel visually closed in mock E2E while off-screen tab controls remained mounted.

Co-authored-by: openhands <openhands@all-hands.dev>

* Make files tab mock E2E open the panel explicitly

Wait for the desktop panel toggle to report an open state before interacting with Files tab controls, then verify the Diff segment can be selected for the attached-workspace conversation.

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-07-20 15:33:24 +00:00
Hiep Le a8edaa7cf4 feat: show actionable connection health on installed server cards (#1833)
* feat: show actionable connection health on installed server cards

* fix: failing tests

---------

Co-authored-by: Graham Neubig <neubig@gmail.com>
2026-07-20 16:00:02 +02:00
🐾 smolpaws 2b7ceea667 refactor: define canvas UI as an SDK client tool (#1797)
* refactor: define canvas UI as an SDK client tool

Send a JSON-defined canvas_ui_client tool on new, profile-based, and resumed conversation requests while retaining the legacy Python registration for persisted conversations. Normalize the new SDK event kinds to the existing Canvas UI rendering.

Co-authored-by: smolpaws <engel@enyst.org>

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: omit canvas client tool from ACP launches

* refactor: rename canvas client tool

Use the semantic canvas_ui_control name and contain the SDK-generated action discriminator behind exported constants.

Co-authored-by: Engel Nyst <engel.nyst@gmail.com>

---------

Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Debug Agent <157206163+simonrosenberg@users.noreply.github.com>
2026-07-15 09:40:57 +00:00
Hiep Le 133d8d9494 test: deflake mock-LLM Docker CSS-scope regression test (#1643) 2026-07-09 22:32:02 +07:00
simonrosenberg 54d718ad4e feat(agent-profiles): Agent Profiles — Settings → Agent as the profile library (local + cloud) (#1571)
* feat(agent-profiles): minimal local Agent Profiles library reusing the 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>

* feat(agent-profiles): add chat-input agent-profile picker + live in-conversation 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>

* test(agent-profiles): extract + unit-test buildAgentProfileFields mapping

Addresses the code-review feedback that the profile-fields builder — the ACP
"built-in default command → null vs verbatim shell string" branch plus the
schema-driven tool_concurrency_limit coercion — was the most novel logic in the
PR yet had no automated coverage (every test mocked the embedded form away).

- Extracts the closure into a pure exported `buildAgentProfileFields()` in
  agent-settings.tsx; the embedded control now just snapshots state into it.
- Adds 8 unit tests locking the round-trip: ACP built-in-default → null, custom
  command → shell string, custom preset, blank-model → null, OpenHands
  enable_sub_agents passthrough, concurrency coercion (valid / empty / throws).
- Clarifies the service header (client ships in ts-client 1.28.0; the server
  endpoints it targets shipped in agent-server v1.29.0) per the version-doc nit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): address review feedback + fix e2e regression

- Fix mock-LLM E2E regression: the profile-identity spec still targeted the
  removed `switch-profile-button`; point it at the new `chat-input-llm-profile`
  picker (mirrors #1550's e2e update).
- Use the `useRenameAgentProfile` hook in the editor instead of calling the
  service directly (the hook was otherwise dead code; now the rename gets list
  invalidation for free).
- Drop the unreachable in-conversation branch from the home AgentProfile picker:
  the picker only renders on home (a running conversation shows the LLM/model
  picker), so `useChatInputProfileState` is now home-only (activate as launch
  default), and the "start new with profile" hint + its
  CHAT$START_NEW_WITH_PROFILE_HINT key (15 langs) are removed.
- Update the two affected tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): correctness fixes from #1571 code review

- switch-llm-profile: run the inline "Switched to" message, #1082 metadata
  persist, and error reporting in mutation-level callbacks so they survive the
  switcher menu unmounting on select
- agent-server-adapter: derive acp_server from agent.acp_server when the
  acpserver tag is absent, so a profile-launched ACP conversation keeps its
  model picker and provider chip
- use-create-conversation: await the LLM-profile list before the
  dangling-llm_profile_ref launch guard so a mid-load send can't launch blind
- chat-input pickers: read switch/activate pending state via useIsMutating so
  the pill button actually disables during an in-flight switch
- use-activate-agent-profile: surface activation errors (drop disableToast) and
  optimistically flip active_agent_profile_id with rollback
- chat-input-actions: fall back to the LLM picker on the home page when the
  backend has no /api/agent-profiles surface

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): pass embedded props to reused Agent settings form

The profile editor reused AgentSettingsScreen via the route module's default
export. React Router's Vite plugin wraps a route default with
withComponentProps, which invokes it with route props and drops any props a
parent passes — so `embedded`/`onSaveControlChange` never reached it,
`saveControl` stayed null, and the Save button was permanently disabled
(couldn't create or edit a profile at all).

Split the route into a named `AgentSettingsScreen` export (the reusable
component embedded consumers import) plus a thin default `AgentSettingsRoute`
wrapper, mirroring `LlmSettingsRoute`. The local-view now imports the named
export. Updated the unit-test mock to provide the named export (the old mock
only stubbed `default`, which is exactly what masked this at unit level).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agent-profiles): un-gate Agent Profiles on cloud backends

The cloud enterprise app-server now exposes the same /api/agent-profiles
contract as the local agent-server (OpenHands #15060, epic #3730), so lift
the local-only gating and route cloud calls through the cloud proxy.

Transport:
- cloud/agent-profiles-service.api.ts: CRUD via callCloudProxy (bearer +
  X-Org-Id) against the identical /api/agent-profiles paths; org resolved
  server-side from the session, so no {org_id} segment.
- cloud/org-profiles-service.api.ts: list org LLM profiles at
  /api/organizations/{org_id}/profiles so the editor's llm_profile_ref
  picker works on cloud. Only listing is cloud-routed.
- AgentProfilesService + ProfilesService.listProfiles branch to the cloud
  transport when the active backend is cloud (mirrors SettingsService).

Surfaces un-gated:
- Settings → Agent profiles nav item + route (no more redirect to /settings/agent).
- Home chat-input agent-profile picker (fetch + pickerKind) on cloud.
- Launch-from-profile: cloud AppConversationStartRequest now carries
  agent_profile_id (added to the type + the cloud create request), which the
  backend resolves and stamps as launched_agent_profile.

In-conversation live switch on cloud is intentionally left on the model
picker for now: the cloud backend has no per-conversation profile-switch
endpoint yet and org LLM-profile detail masks the api_key, so a client-side
switch isn't possible — tracked as a follow-up for full parity.

Tests updated for the new nav behavior (agent-profiles shown on both).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(agent-profiles): update useAgentProfiles docstring for cloud support

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(agent-profiles): clarify cloud in-conversation switch is intentionally local-only

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): preserve acp_server through the wire normalizer

An ACP conversation launched from an agent profile (agent_profile_id) showed
a generic chip and an empty in-conversation model picker: the provider
identity never reached the UI.

Root cause: #1571 taught the conversation adapter to source acp_server from
`agent.acp_server` (SDK #3692) when the `acpserver` tag is absent — which is
exactly the profile-launch case, since that path doesn't stamp the tag. But
`normalizeAgent` (the wire parser feeding the adapter) projected only
`{kind, acp_model, llm}` and dropped `acp_server`, so the adapter's fallback
always saw undefined → acp_server null → no ACP provider → generic chip + no
model list.

Add `acp_server` to the normalizeAgent projection (the type already declared
it). Regression test covers the no-tag / agent-sourced path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agent-profiles): make Settings → Agent the profile library

Collapse the two Settings sections ("Agent" global form + "Agent profiles"
library) into a single "Agent" entry that IS the Agent Profile library: it
lists the user's profiles and its create/edit view is the reused Agent
settings form plus a name (the embedded AgentSettingsScreen). The active
profile is the current agent.

- settings-nav: one "Agent" item → /settings/agents (the library).
- /settings/agent redirects to /settings/agents; default settings path +
  ACP route-guard target updated accordingly.

Also derive the ACP-enabled state from the ACTIVE AGENT PROFILE rather than
settings.agent_settings.agent_kind. Activate is pointer-only and never writes
agent_settings, so the global settings are stale when an ACP profile is
active; the nav-disable, home ACP context, useLlmConfigured, and the ACP
route guard now read the active profile (new useActiveAgentProfile hook) and
fall back to settings only while the profile list is loading.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): gate the LLM-setup banner on the active agent profile's LLM

useLlmConfigured decided "is the LLM ready" from the standalone active LLM
profile, but conversations now launch from the active AGENT profile. For an
OpenHands profile the relevant LLM is the one it references via
llm_profile_ref — not whichever LLM profile happens to be "active". So the
"Your LLM isn't set up" banner could be wrong in both directions (e.g. the
active LLM profile has a key but the agent profile references a keyless one).

Resolve the LLM profile to check from the active agent profile's
llm_profile_ref (openhands), falling back to the active LLM profile only when
there's no ref yet. ACP agent profiles stay always-configured (subprocess
owns its LLM). New unit test covers the discriminating case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agent-profiles): relabel LLM profile "Active" → "Default"

The active LLM profile no longer drives new conversations (the active AGENT
profile does) — it's just the default llm_profile_ref seeded into new agent
profiles. Relabel the LLM-profile badge "Active" → "Default" and the row
action "Set as active" → "Set as default" to stop implying it launches
conversations. New i18n keys (SETTINGS$PROFILE_DEFAULT / _SET_DEFAULT, 15
langs). The agent-profile "Active" badge is unchanged — that one IS active.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(onboarding): land the user's choice on the active agent profile

Onboarding configured global agent_settings + an LLM profile (OpenHands) or
ACP secrets, but never touched an AGENT profile — so the active agent profile
stayed the seeded `default` (openhands → ref `default`), disconnected from what
onboarding set up. Result: an OpenHands user who entered a key still hit "LLM
isn't set up" (the active agent profile referenced a keyless profile), and ACP
users never got an ACP agent profile at all.

Add useApplyOnboardingAgentProfile: upsert + activate the well-known `default`
agent profile from the onboarding choice. The OpenHands LLM step now points it
at the LLM profile it just created; the ACP secrets step makes it an ACP
profile for the chosen provider (opus[1m]/valid default, no LLM key needed).

Verified e2e: OpenHands onboarding → default agent profile refs the configured
LLM + banner clears; Claude Code onboarding → default agent profile is
acp/claude-code, active, no LLM required.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: drop unused eslint-disable in onboarding agent-profile hook

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agent-profiles): gate mutate controls for cloud view-only members

Reuse #1532's org-permission gating for the Agent Profiles UI. Agent
profiles are org-scoped on cloud (bearer + X-Org-Id, edit_org_settings),
so a cloud member previously saw Add/Edit/Delete/Set-active controls that
would 403 server-side — the same flash-then-403 problem #1532 fixed for
LLM profiles.

- Generalize useCanManageLlmProfiles -> useCanManageOrgProfiles (it reads
  the generic edit_org_settings permission; local users always true).
- Thread canManage through AgentProfilesManager -> Body -> Row, mirroring
  LlmProfilesManager: hide the Add button and the row actions menu for
  view-only members.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: fix stale comments surfaced by PR review

Comment-only. No behavior change.

- chat-input-actions.tsx: the pickerKind summary claimed "cloud → model
  picker (cloud has no profile surface)", contradicting the code, which
  uses the AgentProfile picker on cloud home too (#15060). Rewrite to
  match the actual cases; trim the duplicated render-site recap.
- acp-route-guard.ts / settings-nav.tsx / settings.tsx: the ACP redirect
  target moved to /settings/agents (plural) in this PR, but three
  docstrings still said /settings/agent. Update them.

* test(mock-llm-e2e): wire the active agent profile to the mock LLM

Fixes the mock-LLM e2e regression where the home composer stayed blocked
(submit disabled / launcher never ready) so conversation-launching specs
timed out. Conversations now launch from the active AGENT profile (#1571),
and `useLlmConfigured` follows that profile's `llm_profile_ref` — not the
active LLM profile. The specs seed `openhands-onboarded` and configure an
LLM profile the old way, so the seeded "default" agent profile still
pointed at a keyless LLM and the composer never unblocked.

Mirror what onboarding does for a real user: after activating the mock LLM
profile, upsert + activate the "default" agent profile referencing it. Add
a shared `ensureMockLLMAgentProfile` helper (called from ensureMockLLMProfile
and from the conversation spec, which sets up inline).

Verified locally: the full mock-llm-conversation spec passes 4/4 (real
conversation runs against the mock LLM) with this change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): address PR #1571 review feedback

Human review (VascoSch92):
- useLlmConfigured: fall back to the active LLM profile when the active agent
  profile's llm_profile_ref is stale/absent, mirroring the launch-time fallback
  in useCreateConversation. Without this the two contradicted each other: launch
  succeeded via the fallback but the hook reported unconfigured and spuriously
  disabled the composer + banner (even inside a running conversation). Adds a
  regression test for the stale-ref scenario.
- Drop the dead launched_profile plumbing (wire parse + types + adapter map):
  it had zero readers (the home picker keys off active_agent_profile_id and the
  in-conversation picker is LLM/model by design), so the "Consumed by the
  picker" comments were misleading.
- Point the remaining /settings/agent links at /settings/agents (ACP model
  context, chat-input model state, chat error re-auth, command menu) so the
  route rename doesn't cost an extra redirect hop.

/codereview-roasted:
- Extract the triple-nested pickerKind ternary into a pure, unit-tested
  resolvePickerKind() helper.
- Document why cloud OpenHands onboarding intentionally does not repoint the
  active agent profile (persistAsProfile is local-only; cloud resolves the
  agent-profile/LLM wiring server-side).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(agent-profiles): scope the profile-launch enrichment gap (#1571 review)

- Document at buildStartConversationRequest that the profile path relies on the
  server/SDK to restore exec tools + public skills (software-agent-sdk#3967),
  and that canvas_ui + the RUNTIME_SERVICES suffix are intentionally canvas-only.
- Point the createConversation positional-args TODO at the tracked issue (#1587).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): preserve unmodeled fields on edit-save + await profiles at launch

Two fixes from the #1571 review:

Edit-save wiped every profile field the minimal editor doesn't model
(condenser, verification, system_message_suffix, skill/MCP refs, embedded
skills, ACP session mode/timeout): the save endpoint is a whole-profile
overwrite, and the editor posted only its own fields. The save payload now
spreads the stored profile under the edited fields via a pure, kind-aware
mergeAgentProfileSaveInput — a kind switch stays a clean variant replacement
(the server's extra="forbid" union rejects mongrel payloads), and
server-managed identity (id/name/revision) is stripped. The edit fetch now
uses X-Expose-Secrets: encrypted so any skills[].mcp_tools values round-trip
as Fernet tokens instead of persisting the mask literally (same pattern as
the LLM-profile editor).

Launch raced the agent-profiles query: useCreateConversation read the hook's
maybe-unresolved data, so a send fired before the list loaded fell through to
the stale global agent_settings path — which activation (pointer-only) never
updates — and silently launched the wrong agent. The launch now awaits the
list via queryClient.ensureQueryData on the shared query key (mirroring the
LLM-profile ref validation below it), with retry: false so backends without
the surface degrade to the legacy launch immediately. The dangling-llm-ref
downgrade also logs a console.warn so the silent fallback is diagnosable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(acp): drive ACP spec through the Agent Profile editor, not the retired route

Settings → Agent is now the Agent Profile library (#1571): the standalone
/settings/agent form redirects to /settings/agents, whose editor reuses the
same embedded agent-settings-screen form. The ACP mock-llm spec and the
resetToOpenHandsAgentViaUI cleanup helper still navigated the old route and
waited on the retired agent-save-button, so they timed out — and the cleanup
helper's failure (swallowed by afterAll's try/catch) left the "default" agent
profile stuck in ACP mode, poisoning downstream specs that share the backend.

- Add openAgentProfileEditor(page, name): navigate /settings/agents, open the
  named profile's editor via its row action menu (row located by the
  profile-name span[title], mirroring activateProfileViaUI).
- Rewrite resetToOpenHandsAgentViaUI to drive the new editor (switch kind →
  OpenHands, pick an LLM profile, save via save-agent-profile-btn).
- Point ACP spec steps 1 & 2 at the editor; swap agent-save-button →
  save-agent-profile-btn.
- Verify step 1 against GET /api/agent-profiles/default (the new source of
  truth) instead of legacy /api/settings; acp_command is a shell string there
  (ts-client AgentProfile.acp_command: string | null), not a token array.

* fix(build): keep the styling core in one chunk to avoid a tv() init-order crash

This PR's new imports grew/shifted the auto-split `vendor` chunk enough that
Rolldown's size-based splitter (`maxSize`) sliced the styling core apart —
separating a HeroUI component's top-level `tv()` recipe from tailwind-variants'
core within the emitted init order. The recipe then evaluated before
tailwind-variants initialized, throwing `TypeError: s is not a function` at
module load. React Router reported "Error loading route module root-layout,
reloading page", looped, and rendered a blank page — deterministically crashing
the whole app and failing 13 mock-llm-e2e specs (npm + docker) that load the
shell.

Give the styling core (@heroui/react + tailwind-variants + tailwind-merge +
clsx) its own group that is never size-split, so it initializes as a coherent
unit before any consumer's top-level `tv()` call. Verified locally: the home
route renders (was a blank page) with zero console errors.

* test(mock-llm): make LLM-profile setup idempotent and fix stale ACP launch assertion

With the crash fixed, the app renders and a second class of failure surfaced:
specs that call `ensureMockLLMProfile` after the first one deadlocked on a stuck
"Delete Profile" modal, and the ACP spec's payload assertion checked the old
launch shape.

- ensureMockLLMProfile: create the mock LLM profile only when absent instead of
  delete-then-recreate. Once the active agent profile references it (wired right
  after, via ensureMockLLMAgentProfile — #1571), the LLMProfile FK guard rejects
  deletion; the delete-confirm modal then silently stays open and its backdrop
  blocks every later click (`add-llm-profile` timed out across files, home,
  automations, mcp, model-switch, preset-automation). The mock config is
  deterministic, so reusing an existing same-named profile is correct.
  deleteProfileIfExists is unchanged — it still works for the non-referenced
  profiles that other specs delete.
- mock-llm-acp-agent step 3: conversations now launch from the active
  AgentProfile (#1571), so the POST /api/conversations payload carries
  `agent_profile_id` and omits `agent_settings` (mutually exclusive, per
  agent-server-adapter). Assert that shape instead of the retired
  `agent_settings.agent_kind`; the ACP reply-token check still proves the ACP
  agent ran.

* ci: degrade gracefully when the linked SDK reference isn't a PR

"Resolve linked SDK PR" (mock-llm-docker-e2e.yml) greps the PR description
for OpenHands/software-agent-sdk#NNNN or .../pull/NNNN and tries to build
against that PR's branch. GitHub's "#NNNN" shorthand looks identical for
issues and PRs, so a description that links a tracking issue (e.g. #3713)
matches the same regex — and /pulls/{number} 404s for an issue number,
failing the whole job under `bash -e` instead of falling back to the
released SDK version like the "no match" branch already does.

Treat a failed PR lookup the same as "no linked PR found": log and exit 0,
leaving git_ref unset so the job falls through to the released version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(test): make ensureMockLLMProfile/AgentProfile converge, not skip

Two real e2e failures traced to test-helper bugs surfaced only once #3968
(SDK 1.32.0) let profile-launched conversations actually run:

- ensureMockLLMProfile: the earlier idempotent-reuse fix (deadlock guard
  against the LLMProfile FK constraint) skipped writing the profile's
  config entirely whenever a same-named profile already existed —
  correct for repeat calls with the SAME config, but silently ignored a
  DIFFERENT one. mock-llm-image-upload requests a vision-capable model
  ("openai/gpt-4o") to get past the mock LLM's default; when an earlier
  spec in the same CI run had already created "mock-llm" with the
  default model, the override never applied and the agent replied "the
  currently selected model does not support image understanding" —
  confirmed via the CI screenshot. Fixed by editing the existing profile
  in place (via the LLM settings UI's Edit flow, never deleting it) so
  every call converges on the requested model/apiKey/baseUrl regardless
  of what an earlier test left behind.

- ensureMockLLMAgentProfile: OpenHandsAgentProfile.skill_refs defaults to
  `[]` (none discovered) when omitted from the save payload. Workspace-
  scoped project skills are discovered independently of this and keep
  working, but a profile-launched conversation's agent never sees any
  public/preset skill (e.g. an installed automation's bundled skill)
  without an explicit skill_refs. Set it to `null` (all discovered),
  matching what a real onboarding-seeded profile effectively gets.

mock-llm-model-switch step 2's post-switch reply timeout is left
unaddressed: its trajectory hard-codes one padding turn for "the
agent-server's internal condenser/skill-analysis call before the main
loop" (a documented, historically-fragile assumption per the test's own
comment) — plausibly now off by one now that #3968 lets the agent make
additional real tool-use calls around a /model switch. Fixing this
requires an empirical trajectory-turn count from a real 1.32.0
conversation trace, which needs a CI cycle to observe correctly rather
than guessing blind.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* revert(test): drop skill_refs=null from ensureMockLLMAgentProfile

CI showed this regressed mock-llm-skills.spec.ts (project skill in
workspace/.agents/skills/), which passed before this change: fixed the
narrow preset-automation slash-command skill-activation case at the
cost of breaking a more fundamental, previously-solid #3968 validation
— a net-negative trade, not a clean win.

The shared "default" agent profile backs every spec in the suite;
widening its skill_refs to "all discovered" has global blast radius
across unrelated tests, evidently including some interaction with
project-skill discovery/activation tracking that isn't understood yet.
A fix for preset-automation's specific skill needs to be scoped to that
one profile/test, not applied to the profile every other spec shares.

Keeps the ensureMockLLMProfile edit-in-place fix (proven, isolated,
fixes mock-llm-image-upload with no observed side effects).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): default new profiles' skill_refs to "all discovered"

OpenHandsAgentProfile.skill_refs defaults to `[]` (none) server-side when
omitted from a save payload. Neither onboarding's profile seed nor the
Settings "Add Agent Profile" editor exposes a skill_refs control, so every
newly-created profile silently gets zero public/user/project skills — a
profile-launched conversation's agent can't activate any of them (#1571
launches conversations from the active agent profile). This is exactly
the mock-llm-preset-automation regression: a slash-command-triggered
skill never activates because the "default" test profile has no
skill_refs, matching what a real user's fresh profile would also hit.

useSaveAgentProfile is the single choke point for every profile save
(onboarding seed + Settings create/edit), so default skill_refs to `null`
("all discovered") there whenever the caller hasn't set it explicitly —
matches what users actually expect (a new agent has access to their
skills unless deliberately scoped down) and requires no SDK change. The
pinned typescript-client doesn't type skill_refs on AgentProfileSaveInput
yet (SDK/wire drift), so this reaches it via an untyped merge; `in`
checks the runtime object since mergeAgentProfileSaveInput's edit-preserve
spread can carry it at runtime despite the missing type.

Re-applies the equivalent default to ensureMockLLMAgentProfile (the e2e
test helper bypasses this hook via a raw fetch) so the test suite mirrors
real behavior.

Verified: full unit suite green (3618 passed), typecheck clean,
agent-profiles-local-view.test.tsx passes unaffected (it mocks
useSaveAgentProfile at the hook boundary, so this change is invisible to
it). Locally reproduced the fix: mock-llm-preset-automation's slash-
command skill-activation test now passes; mock-llm-image-upload
(previously fixed) still passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): self-heal LLM profile stream=true for profile-launched conversations

A profile-launched conversation (agent_profile_id) never sends
agent_settings, so PR #1474's `llm.stream = true` (buildConfiguredOpenHands
AgentSettings, agent-server-adapter.ts) never reaches it — the referenced
LLM profile's stored `stream` field (SDK default: false) is used as-is by
resolve_agent_profile/_build_openhands_settings, with no override, unlike
the legacy path.

The agent-server decides once, at conversation construction, whether to
wire the `on_token` streaming callback — based on whether any of the
agent's LLMs has stream=True at that moment — and never re-evaluates it
afterward (confirmed by reading LocalConversation.switch_llm: it swaps the
LLM but never touches _on_token). So a profile-launched conversation whose
LLM profile was never saved with stream=true gets on_token=None for its
entire lifetime. switchProfile's switch_llm call (unconditionally sending
stream: true, unchanged by this fix) then crashes the next completion with
"Streaming requires an on_token callback", since on_token can never be
(re-)wired post-construction. Confirmed via real agent-server tracebacks in
both mock-llm-e2e and mock-llm-docker-e2e CI runs.

Streaming is a pre-existing, independently-shipped feature (PR #1474) that
must not regress for legacy-launched conversations — ruling out simply
dropping switch_llm's stream:true (would silently disable streaming after
a switch for the one case that works today). And since existing users'
LLM profiles predate this fix, defaulting stream:true only at future
profile-save time (mirroring the skill_refs fix) would still crash on
their first profile-launched conversation post-deploy.

ensureLlmProfileStreams is a migration shim: at the one call site
guaranteed to run for every profile-launched conversation (already
fetching the LLM-profiles list to validate llm_profile_ref exists), check
the referenced LLM profile's full config and, if stream isn't already
true, save it with stream:true — self-healing both new and existing
profiles on first use, memoized per profile name for the session so it's
a no-op read on every subsequent launch. Mirrors the profile-duplicate
flow's exact pattern for round-tripping the encrypted secret
(getProfile(name, "encrypted") + saveProfile(..., include_secrets: true))
so the stored api_key is never clobbered. Touches neither the legacy
agent_settings path nor switch_llm — both keep working exactly as before.

Safe to delete once virtually all users are migrated, or once
resolve_agent_profile forces stream=true for OpenHands profiles upstream
(same category of fix as the skill_refs default — likely the same #3967
umbrella), whichever comes first.

Verified: full unit suite green (3620 passed, +2 new tests exercising
this exact self-heal/no-op branching), typecheck clean. Locally
reproduced the fix: mock-llm-model-switch's on_token crash no longer
occurs; preset-automation and image-upload remain passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(agent-profiles): link the skill_refs/streaming shims to their tracking issue

References OpenHands/agent-canvas#1619 (the cleanup-tracking issue for both
workarounds) and the specific upstream SDK issues, so the removal criteria
is discoverable from the code itself, not just the PR description.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): drop skill_refs/streaming migration shims (SDK #4017 landed)

software-agent-sdk#4017 (PR #4018) fixes both gaps these shims worked
around: OpenHandsAgentProfile.skill_refs now defaults to null (all
discovered) server-side, and the agent-server forces llm.stream=true
for profile-launched conversations. Both shims are now dead code.

Validated end-to-end against the SDK branch (OH_AGENT_SERVER_LOCAL_PATH)
before removing: real HTTP round-trips confirmed skill_refs defaults to
null and the launched agent's LLM streams even though the underlying LLM
profile is stored with stream=false; the full mock-llm-skills.spec.ts and
mock-llm-profile-management.spec.ts suites pass unchanged.

Removes:
- withDefaultSkillRefs (src/hooks/mutation/use-save-agent-profile.ts)
- ensureLlmProfileStreams + its two dedicated tests
  (src/hooks/mutation/use-create-conversation.ts)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(agent-profiles): correct comments for the disabled_skills deny-list

SDK #4017 replaced the profile's skill_refs allow-list (and embedded skills)
with a disabled_skills deny-list. Canvas is already deny-list-native — the
user-level disabled_skills UI exists and the generic profile merge carries the
field automatically — so only two stale comments referencing embedded skills /
skill refs needed correcting. No functional change; the per-profile skill
picker stays out of scope for the minimal editor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(agent-profiles): drop stale skill_refs from fixtures for the deny-list

SDK #4017 replaced the profile's skill_refs allow-list (and embedded skills)
with a disabled_skills deny-list. Update the fixtures/comments that still
referenced the removed fields (they ride untyped through `as unknown` casts /
raw POST bodies, so the generic merge round-trips them regardless):
- merge-agent-profile-save-input.test.ts + agent-profiles-local-view.test.tsx:
  skill_refs -> disabled_skills, drop embedded `skills`, schema_version 3,
  ACP fixtures drop the skill field (ACP has none). Correct the stale
  exposeSecrets/mcp_tools comment (profiles are secret-free now).
- mock-llm-helpers.ts: the omitted-field comment now describes the deny-list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(agent-profiles): profile fixtures use the v1 baseline schema_version

SDK #4017 collapsed the pre-ship AgentProfile schema history to a clean v1
baseline (no v2/v3, no migrations). Update the two profile fixtures to
schema_version: 1 to match the shipped model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(agent-profiles): launch the `default` profile via agent_settings; 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>

* fix(agent-profiles): gate the LLM-setup banner on the active agent-profile 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>

* fix(agent-profiles): scope the default→agent_settings launch to OpenHands 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>

* fix(agent-profiles): address PR #1571 review findings (VascoSch92)

- 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.

* fix(agent-profiles): restore cloud in-conversation LLM-profile switching

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.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 17:22:55 +00:00
Vasco Schiavo d8f7097112 test(e2e): deflake mock-LLM profile activation helper (#1580) 2026-07-08 16:17:00 +02:00
Graham Neubig c552545926 feat(mcp): add OAuth support to MCP install flow
Squash merge PR #1583.

This merge commit was created by an AI agent (OpenHands) on behalf of Graham Neubig.

Co-authored-by: openhands <openhands@all-hands.dev>
2026-07-07 12:03:36 +02:00
Hiep Le b6727865b7 feat: instrument PostHog analytics for the onboarding funnel (#1547)
* feat: instrument PostHog analytics for the onboarding funnel

* test: de-flake onboarding layout probe and profile activation
2026-07-02 22:26:39 +07:00
Graham Neubig 09d56a330b [codex] Always show first-run onboarding (#1528)
* Always show first-run onboarding

* Fix first-run onboarding CI regressions

* Fix root onboarding launch navigation

---------

Co-authored-by: Codex <codex@openai.com>
2026-06-29 10:01:05 +00:00
Vasco Schiavo 17e3328812 test(e2e): de-flake git control bar workspace pill assertion (#1475)
The mock-LLM files-and-git step 3 asserted the control bar shows the
workspace folder basename ("my-app"). But once the local
`git remote get-url origin` probe detects the remote that step 2 adds,
the bar shows the repo slug instead — the folder pill is only the
pre-detection fallback (GitControlBarRepoButton: selectedRepository ||
workspaceName). The assertion raced that probe and failed intermittently.

Accept either the folder basename or the configured remote slug, and
share the slug via a single EXPECTED_REPO_SLUG constant used by both the
trajectory's git remote add and the assertion.
2026-06-24 16:06:28 +02:00
Hiep Le 8d8ae5f8a0 feat: add deployment-choice modal for GitHub and Slack responders (#1379)
* feat: add deployment-choice modal for GitHub and Slack responders

* fix: failing e2e tests
2026-06-23 18:42:27 +00:00
Engel Nyst 01d141d0cd ci: collapse mock e2e PR comment tables (#1465)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-23 15:56:16 +02:00
Graham Neubig a1c68313b2 Add lock-to-cloud backend setup mode (#1389)
* Show onboarding before public backend auth gate

Co-authored-by: openhands <openhands@all-hands.dev>

* Make backend setup the first onboarding step

Co-authored-by: openhands <openhands@all-hands.dev>

* Restore Cloud backend option in onboarding

Co-authored-by: openhands <openhands@all-hands.dev>

* Make first-run backend onboarding calmer

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: update public onboarding e2e expectation

* fix: cover onboarding-first public auth e2e

* test: keep ProgressEvent polyfill through teardown

* chore: refresh PR checks after QA

* Add lock-to-cloud backend setup mode

Co-authored-by: openhands <openhands@all-hands.dev>

* Hide skip on locked Cloud backend onboarding

Co-authored-by: openhands <openhands@all-hands.dev>

* Remove add-backend onboarding subtitle

Co-authored-by: openhands <openhands@all-hands.dev>

* Skip healthy backend onboarding step

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: support skipped backend step in onboarding e2e

* chore: Remove PR-only artifacts

* fix: address onboarding review nits

* fix: show onboarding for locked cloud first run

* ci: support stacked mock llm runs

* test: assert scoped shell background

* fix: resolve merge conflicts with main (fix-public-onboarding stacking)

- Remove duplicate handleConnected/actionRowClassName/titleKey declarations
  in check-backend-step.tsx that resulted from merging the parent PR's
  changes on top of our lock-to-cloud additions
- Remove erroneous waitFor(onboarding-backend-connected) steps from the
  'shows a connection error' test which uses a no-backend context where
  the connection banner is never shown

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: remove unused isLockedToCloud export

All callsites use getLockedCloudHost() !== null directly.
Remove the redundant helper to keep the public API intentional.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: show onboarding first in locked-cloud mode when a session key is present

On PR #1389 Hiep reported that `static-server.mjs --lock-to-cloud ...`
landed on the Manage Backends recovery modal ("Add Backend") instead of
first-run onboarding after a fresh `~/.openhands`.

Root cause: when the build had a baked-in `VITE_SESSION_API_KEY` (or one
was injected via `--session-api-key`), `makeDefaultLocalBackend()` seeded
a Local backend even in locked-to-Cloud mode. That made `isNoBackend()`
false, so `lockedNoBackend` was false and first-run onboarding was
skipped; the subsequent `/server_info` probe failed and `root.tsx`
rendered `MissingAgentServerScreen` (Manage Backends recovery modal).

Fix:
- `makeDefaultLocalBackend()` returns null when `getLockedCloudHost()` is
  set, so locked mode never auto-seeds a Local backend.
- `root.tsx` broadens the gate to `lockedNeedsOnboarding`: locked + (no
  backend OR active backend is not Cloud) triggers onboarding, covering a
  stale persisted Local backend from a previous non-locked session too.

Verified by building with a baked `VITE_SESSION_API_KEY` and serving with
`--lock-to-cloud`: the app now shows the first-run onboarding Cloud-login
screen instead of the recovery modal, and no Local backend is seeded.
Non-locked mode still seeds the Local backend as before.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: locked-cloud onboarding layout + restore CI test mock

CI fix:
- `use-create-conversation-metadata.test.ts` mocks the whole
  `agent-server-config` module but was missing `getLockedCloudHost`, which
  `makeDefaultLocalBackend()` now imports. Add it (returning null) so the
  default local backend seeds and the create-conversation mutation
  succeeds again.

Onboarding layout (locked-to-Cloud first-run step):
- Drop the `max-w-sm` cap on the locked CloudLoginColumn so the "Skip the
  setup — connect instantly with your OpenHands Cloud account." text fills
  the modal content width instead of wrapping in a narrow centered column.
- Add `pb-7` to the onboarding scroll area so the "Login with OpenHands
  Cloud" button is no longer flush with / cut off by the modal bottom.
  Widening the text (fewer lines) plus the bottom padding together give
  the button breathing room.

Co-authored-by: openhands <openhands@all-hands.dev>

* test: add getLockedCloudHost to agent-server-config test mocks

`makeDefaultLocalBackend()` now imports `getLockedCloudHost` from
`agent-server-config`. Two tests that fully mock that module were missing
the export, so the default local backend never seeded and every create-/
read-conversation path threw `NoBackendAvailableError`:

- `agent-server-conversation-service.test.ts` (23 failures on ubuntu CI)
- `use-create-conversation-metadata.test.ts` (already fixed in prev commit)

Add `getLockedCloudHost: vi.fn(() => null)` to both mocks so the non-locked
default-backend seeding path works again.

Co-authored-by: openhands <openhands@all-hands.dev>

* Enhance conversation sidebar with pinned section and grouped organization (#1144)

* Add pinned conversations and reorderable workspace folders to the sidebar.

Persist pins per backend with a capped pinned section, pin-on-hover cards that keep the icon aligned with hover actions via an invisible ellipsis spacer, and drag-and-drop folder ordering stored in panel preferences.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Simplify grouped folder rows for drag and expand.

Drop the grip and chevron controls, remove selection highlight and layout animation, and drag or click the folder label directly while keeping row hover feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Polish folder drag-and-drop and pinned section visuals.

Drag the whole folder (and contents) as the drag image, show an accent drop
line between folders with position-aware reordering, and animate sibling
folders into place only around a reorder. Swap the folder icon to its open or
closed counterpart on hover, add a chronological-view divider plus an outline
pin icon to the pinned section header, and render that header in normal weight.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add hover metadata popover for sidebar conversations.

Show a modal-styled popover on conversation hover with the full title, status
dot, and repo/branch-or-directory, model, and created-date rows. Reserve the
action overlay width so titles truncate instead of colliding with the pin,
drop the small status tooltip, and gate the popover behind a new "Hover
metadata" toggle in the filter dropdown (persisted, on by default).

Co-authored-by: Cursor <cursoragent@cursor.com>

* Improve folder drag preview and placeholder.

Show a rounded, surfaced drag image anchored to the grab point and blank the
original row (preserving its height) via opacity so Chrome does not cancel the
native drag.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden sidebar "Load more" pagination

Dedupe loaded conversations by id and keep fetching pages until the
visible list actually grows, so a single "Load more" click reliably
surfaces new rows despite the 10s background refetch dropping in-flight
fetchNextPage calls or pages yielding zero visible rows. Show the
skeleton throughout. Also drop the native title tooltip on card titles
and record the still-intermittent double-click symptom as a KNOWN ISSUE.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Keep pinned conversations exclusive to the pinned section.

Filter pinned threads out of grouped/chronological lists to prevent duplicates, add regression coverage for both list modes, and add the missing upgrade-button translation key with typed i18n usage.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: failing tests

* fix: lint

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: hieptl <hieptl.developer@gmail.com>

* Fix locked cloud onboarding follow-ups

Co-authored-by: openhands <openhands@all-hands.dev>

* Slow down onboarding follow-up GIFs

Co-authored-by: openhands <openhands@all-hands.dev>

* Skip onboarding when active backend already has a configured LLM

Detect returning users via flat `llm_api_key_set` + `agent_settings.llm.model` (or subscription auth), regardless of backend kind. Locked-Cloud-not-logged-in and stale local backend still fall through to the modal so the existing recovery paths kick in.

Co-authored-by: openhands <openhands@all-hands.dev>

* Scope onboarding skip rule to Cloud backends only

Local agent-servers can be started with an env-injected `LLM_API_KEY`, which makes `llm_api_key_set` an unreliable returning-user signal — Mock-LLM E2E fresh-install tests were tripping on the SDK default model + env key combo. For Local backends the skip stays driven by the existing `openhands-onboarded` localStorage flag; Cloud backends continue to use the settings-based rule.

Co-authored-by: openhands <openhands@all-hands.dev>

* Trigger CI re-run (empty commit)

Workflows didn't fire on 80ea575a — pushing empty commit to nudge the webhook.

Co-authored-by: openhands <openhands@all-hands.dev>

* Always pre-fill onboarding LLM step with OpenAI GPT-5.5 default

The returning-Cloud-user case is now handled at the host level (OnboardingHost skips the whole modal). Users who actually reach the LLM step are first-time installs who want the default pre-filled — restoring the pre-PR-1389 behavior that the onboarding-regressions E2E asserts. Also drops the now-empty unit test that mirrored the old step-level preservation.

Co-authored-by: openhands <openhands@all-hands.dev>

* chore: Update PR QA artifacts

* Generalize onboarding-skip to Local backends with configured LLMs

Hiep flagged that the onboarding modal still walks users through Set Up
your LLM after they connect to a pre-configured backend. Investigation:

  * On Cloud, the fast-path keyed off settings.llm_api_key_set + a
    non-empty llm.model. That worked.
  * On Local, the fast-path bailed early on backend.kind !== 'cloud'.
    But the local agent-server reports the exact same readiness signal
    via llm_api_key_is_set (and the local settings-service mapper
    already remaps that to llm_api_key_set on the way through). The
    only reason the skip didn't fire was the explicit kind gate.

Drop the gate, accept either field name, and rename the predicate to
reflect what it actually checks (isBackendLlmReady). A truly fresh
agent-server reports both flags as false, so the modal still shows for
genuine first-run setup.

Tests:
  * Updated 'does not skip onboarding for a Local backend' to its
    inverse: 'skips for a Local backend with an LLM already configured'.
  * Added 'still shows the modal for a fresh Local agent-server with no
    API key set' to lock in the fresh-install case.
  * All 3328 vitest tests pass; typecheck clean.

Refs Hiep's review comment on PR #1389.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): address Hiep's review on PR #1389 (#1389)

Resolves the three issues Hiep reported on PR #1389:

1. **Choose Agent step gets skipped after Cloud login.** When the
   backend slide finished via Cloud login and `skipBackendStep` flipped
   true, the slide indices renumbered (agent: 1→0, setup: 2→1). The
   user's numeric `currentStep` of 1 — pointing at Choose Agent before
   the flip — now pointed at Set Up LLM, and the corrective effect that
   decremented it ran a render too late. Track the user's *phase*
   ("backend" | "agent" | "setup" | "hello") instead of a numeric
   step. The visible slide index is derived from phase + slideOrder, so
   renumbering can never move the user onto a different logical step.
   The previous `wasSkippingBackendStep` ref + decrement effect is
   replaced by a single effect that snaps phase forward only when the
   current phase is no longer in slideOrder (e.g. "backend" right
   after the slide collapsed).

2. **Existing Cloud LLM settings not shown to returning users.** The
   skip-onboarding fix from commit 78254e1b already routes returning
   users with a configured LLM around the onboarding modal entirely,
   so they never hit the Set Up LLM step in the first place. The new
   phase-based flow preserves that behavior; no further change needed.

3. **Redundant 'Or' divider** between manual and Cloud columns in
   BackendConnectionOptions. Both columns have prominent titles
   ("OpenHands Cloud" with logo on the right) and a generous gap
   already; the explicit divider added visual noise without
   information. Remove the divider markup.

Also gitignores local static-server runtime artifacts (workspace/,
build-fresh/) that were getting picked up by 'git add -A'.

Two regression tests cover the standard (non-locked-cloud) flow: one
verifies the user stays on Choose Agent after completing Cloud login
from the side-by-side picker, and one verifies the 'Or' divider is
gone. All 3,241 unit tests pass; lint and typecheck are clean.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: suppress Add Backend modal in locked-to-cloud mode

Resolves hieptl's review feedback on PR #1389: when the static server is
launched with --lock-to-cloud, navigating to the app showed the Manage
Backends recovery modal ("Add Backend") instead of going straight to
Cloud onboarding/login.

Root cause: the `openhands-onboarded` localStorage flag is origin-scoped
and persists across deployments. A user who previously completed
onboarding in a non-locked session on the same origin carries that flag
into a locked-to-Cloud session. The stale flag suppressed
first-run onboarding (`shouldShowFirstRunOnboarding` was gated on
`!onboardingCompleted`), so the app fell through to the
`/server_info` probe. With no usable local backend in locked mode the
probe throws `AgentServerUnavailableError`, and root.tsx renders the
`MissingAgentServerScreen` / `ManageBackendsModal` recovery modal.

Fix: when `lockedNeedsOnboarding` is true, ignore the completion flag
and force first-run onboarding (which owns the Cloud login). The
non-locked path is unchanged — `onboardingCompleted` still suppresses
the modal for returning users with a configured backend.

Also confirms the minor cleanup from the bot review: `isLockedToCloud()`
was already removed in commit addda40e; no remaining references.

Adds a regression test reproducing hieptl's exact scenario (stale
`openhands-onboarded` flag + locked-to-Cloud + no backend) and asserting
the onboarding modal renders instead of the Manage Backends modal.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): don't skip onboarding modal for launcher-seeded backend

PR #1389 generalized the OnboardingHost "returning user with a
configured LLM" skip from Cloud-only to all backends (commit 78254e1b).
That broke the mock-LLM E2E fresh-install / onboarding-happy-path /
onboarding-regressions specs:

  tests/e2e/mock-llm/backends/mock-llm-auth-modes.spec.ts:57
    "auth mode: fresh install with runtime-injected key ›
     reaches the onboarding modal without pre-seeded localStorage"

The mock-LLM E2E stack runs every spec serially against a single
shared agent-server. Earlier specs configure an LLM profile that
persists in the server's settings, so by the time the fresh-install
spec runs (with a clean browser context, no `openhands-onboarded`
flag, and a launcher-seeded default-local backend), the server
reports `llm_api_key_is_set: true` + a non-empty model.
`OnboardingHost.isBackendLlmReady` then returned true, so the host
marked onboarding complete and returned null — the first-run modal
never mounted and the test timed out waiting for
`onboarding-step-choose-agent`. Main is green on the same test
because main's skip was Cloud-only.

The settings-based LLM-ready signal is unreliable for the
launcher-seeded default-local backend: the agent-server can be
started with an env-injected LLM key, and shared-server deployments
retain configured LLMs across browser sessions. Keying first-run
onboarding off the server's LLM state would suppress the modal for
a genuinely fresh browser install.

Fix: keep the skip for Cloud backends and for Local backends the
user explicitly added via "Add Backend" (which carry a non-default
id), but suppress it for the launcher-seeded default-local backend
(`SEEDED_DEFAULT_BACKEND_ID`). First-run detection for that backend
stays driven by the `openhands-onboarded` localStorage flag, matching
main's behavior and restoring the E2E fresh-install contract. The
PR's core intent (suppress the Add Backend recovery modal in
locked-to-Cloud mode, commit 47619f11) is unchanged.

Tests:
  * Updated "skips the modal for a Local backend..." to seed a
    user-added Local backend (non-default id) so the skip still
    fires for the Add-Backend scenario.
  * Added "still shows the modal for a launcher-seeded default-local
    backend even when the agent-server reports a configured LLM" to
    lock in the fresh-install regression.
  * All 3332 vitest tests pass; typecheck + lint + build clean.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): don't auto-complete onboarding for launcher-seeded backend

Commit 9029e036 fixed OnboardingHost so the first-run onboarding modal
shows for the launcher-seeded default-local backend even when the
shared mock-LLM agent-server reports a configured LLM. But the same
over-suppression existed in src/root.tsx: a separate
`isBackendLlmReady` check (no default-local exclusion) fed a
`markCompleted()` effect that persisted `openhands-onboarded=1`
whenever the active backend reported a ready LLM — including the
launcher-seeded default-local backend.

That root-level effect was the remaining cause of the
mock-llm-onboarding-regressions.spec.ts:16 failure
("keeps the modal open on backdrop click and Escape"):

  * The OnboardingModal already renders with no `onClose` on its
    ModalBackdrop, so backdrop clicks and Escape are no-ops — the
    modal itself was never closeable that way.
  * The test failure was actually the `expect.poll` asserting
    `openhands-onboarded` stays null: root.tsx's `markCompleted`
    effect fired (agent-server had a configured LLM from earlier
    serial specs) and persisted completion, even though the modal
    stayed mounted.

Fix: apply the same `SEEDED_DEFAULT_BACKEND_ID` exclusion to
root.tsx's `isBackendLlmReady` that OnboardingHost already uses.
The settings-based LLM-ready signal is unreliable for the
launcher-seeded default backend (env-injected keys, shared-server
LLM persistence across browser sessions), so first-run detection
there stays driven by the `openhands-onboarded` localStorage flag.
The skip still fires for Cloud backends and for Local backends the
user explicitly added via "Add Backend" (non-default id).

The OnboardingModal's non-dismissible backdrop/Escape behavior is
unchanged and already correct (ModalBackdrop receives no `onClose`,
so `closeOnEscape`/`closeOnBackdropClick` default-true handlers
call `onClose?.()` which is a no-op).

Tests:
  * Added root.test.tsx case "does not mark onboarding complete for
    the launcher-seeded default-local backend even when the
    agent-server reports a configured LLM" — verified it fails
    without the root.tsx fix and passes with it.
  * All 3333 vitest tests pass; typecheck + lint + build clean.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: force Cloud replacement for stale Local backend in locked mode

Critical fixes for the locked-to-Cloud flow (PR #1389 review):

1. root.tsx: the ready-backend fast-path in locked mode now requires the
   active backend to match the locked Cloud host (normalized via the new
   isSameCloudHost helper), not just . A reachable stale
   Local backend (or a Cloud backend on a different host) that reports a
   configured LLM no longer bypasses the Cloud login/replacement flow.
   The markCompleted effect is also guarded so it only persists completion
   for the legitimate locked Cloud host.

2. onboarding-modal.tsx: in locked mode, CheckBackendStep is only skipped
   when the active backend IS the locked Cloud host. A reachable stale
   Local backend keeps the backend slide visible so Cloud login can
   replace it.

Also addresses minor review suggestions:
- LOCK_TO_CLOUD_WINDOW_KEY is now module-private (only getLockedCloudHost
  reads it; static-server.mjs/tests use the literal string).
- Extract shared isBackendLlmReady helper into its own module
  (is-backend-llm-ready.ts) so root.tsx and OnboardingHost stay in sync
  without duplicating the rule and without pulling the onboarding modal
  graph into root's eager bundle.
- Inline the no-op initialValueOverrides intermediate in setup-llm-step.

Adds regression tests for the stale-Local-backend and other-Cloud-host
scenarios in both root.test.tsx and onboarding-modal.test.tsx.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): close stale-backend lock-to-Cloud bypass in CheckBackendStep (#1389)

PR-review bot pointed out (HEAD 55d382be) that keeping the backend
slide visible for a non-matching backend in locked mode is insufficient:
CheckBackendStep itself still hits its connected-backend shortcut for
a reachable stale Local backend, hiding the Cloud login UI and showing
a Next button that lets the user continue as Local.

Apply the same host-match guard inside CheckBackendStep. A new local
`treatAsNoBackend` (= noBackendSelected || lockedCloudHostMismatch)
drives:
  - title: ONBOARDING$LOGIN_TO_CLOUD_TITLE (not BACKEND_TITLE)
  - render: BackendConnectionOptions (Cloud login UI), no ConnectionBanner
  - no "Show configuration" toggle and no Next-shortcut action row

`noBackendSelected` still governs whether handleConnected calls
`addBackend` or `updateBackend`, so the stale backend is replaced
rather than duplicated.

Strengthen the regression test the bot flagged: it now asserts the
Cloud login title and login button are visible, and that the
`onboarding-backend-show-configuration` toggle, `onboarding-backend-next`
button, and the (misleading) Connected subtitle are all absent.

All 3,249 unit tests pass; lint and typecheck are clean.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): clear stale active org_id when replacing a Cloud backend host (#1389)

PR-review bot raised one remaining state carry-over: replacing a
mismatched Cloud backend updates its host/apiKey via `updateBackend`,
but the persisted `active.orgId` (X-Org-Id) is keyed to the OLD
host's org list. The newly-locked Cloud backend would keep sending an
invalid `X-Org-Id` until the user manually re-picked an org.

Fix in CheckBackendStep.handleConnected: when the submitted payload's
host differs from the previously-active backend's host, call
`setActive(backend.id, null)` to drop the now-invalid org selection.
The user re-picks an org on the new host via the usual org switcher.

Local-only edits are unaffected because Local backends always carry
`active.orgId === null`, so the conditional is a no-op there.

New regression test seeds a Cloud backend at other-cloud.example.com
with `orgId="stale-org-from-other-host"`, drives the Cloud login
button, and asserts `getActiveSelection().orgId === null` while the
backend row is updated in place (same id).

All 3,250 unit tests pass; lint and typecheck are clean.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix(onboarding): dismiss modal immediately after Cloud login in locked mode (#1389)

Resolves the flicker hieptl reported on PR #1389: after logging into
OpenHands Cloud in locked-to-Cloud mode, the onboarding modal advanced
to the Choose Agent slide (the "next window"), then got torn down by
the root first-run gate, then briefly remounted via OnboardingHost —
appearing to flash in and out.

Cloud login IS the onboarding completion in locked mode, so:
- CheckBackendStep now calls onClose (dismiss) instead of onNext when
  a Cloud login succeeds in locked-to-Cloud mode, so the next slide
  never shows. Standard (non-locked) mode still walks the user through
  agent/LLM setup via onNext.
- root.tsx's locked-mode first-run gate now treats onboardingCompleted
  as authoritative once the active backend IS the locked Cloud host,
  so the first-run screen hides immediately on login (without waiting
  for the Cloud settings probe to confirm a configured LLM). The flag
  is still ignored when the active backend is not the locked Cloud
  host, preserving the stale-flag bypass protection.

Added failing tests (now passing) reproducing both halves of the flicker:
- onboarding-modal: Cloud login in locked mode calls onClose, not onNext.
- root: the first-run screen hides immediately after Cloud login
  completes (post-login state with no configured LLM), instead of
  reopening via OnboardingHost.

Co-authored-by: openhands <openhands@all-hands.dev>

* chore: Remove PR-only artifacts

* ci: revert docker.yml pull_request branch filter change

Reverts the removal of `branches: [main]` from the `pull_request`
trigger in .github/workflows/docker.yml (introduced in 5bb8049f). That
change is unrelated to the locked-to-Cloud onboarding work on this PR
and is out of scope. Restores the file to match main exactly so the
Docker workflow again only runs on PRs targeting `main`.

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Graham Neubig <gneubig@users.noreply.github.com>
Co-authored-by: neubig <398875+neubig@users.noreply.github.com>
Co-authored-by: allhands-bot <allhands-bot@users.noreply.github.com>
Co-authored-by: hieptl <hieptl.developer@gmail.com>
Co-authored-by: FraterCCCLXIII <panentheum@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 16:06:12 +00:00
Graham Neubig 5728144593 Show onboarding before public backend auth gate (#1385)
* Show onboarding before public backend auth gate

Co-authored-by: openhands <openhands@all-hands.dev>

* Make backend setup the first onboarding step

Co-authored-by: openhands <openhands@all-hands.dev>

* Restore Cloud backend option in onboarding

Co-authored-by: openhands <openhands@all-hands.dev>

* Make first-run backend onboarding calmer

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: update public onboarding e2e expectation

* fix: cover onboarding-first public auth e2e

* test: keep ProgressEvent polyfill through teardown

* chore: refresh PR checks after QA

* chore: Remove PR-only artifacts

* fix: address onboarding review nits

* test: assert scoped shell background

---------

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Graham Neubig <gneubig@users.noreply.github.com>
Co-authored-by: neubig <398875+neubig@users.noreply.github.com>
Co-authored-by: allhands-bot <allhands-bot@users.noreply.github.com>
Co-authored-by: hieptl <hieptl.developer@gmail.com>
2026-06-18 17:07:35 -04:00
simonrosenberg 944679d9fd [AgentProfile][canvas] Give SSE/shttp MCP servers referenceable names (custom editor + marketplace) (#1386)
* feat(mcp): give SSE/shttp MCP servers a user-given name

SSE/shttp servers were serialized under auto-generated dict keys
("sse", "shttp", "shttp_1"), making them unreferenceable by name in
AgentProfile mcp_server_refs. Surface an optional "Server name" field
so they get a stable, user-meaningful key — consistent with stdio.

- Add name? to MCPSSEServer / MCPSHTTPServer
- toSdkMcpConfig: reserve(entry.name || "sse"/"shttp") so the name
  becomes the dict key; reserve() still de-dups collisions
- parseMcpConfig: round-trip user-given names, but treat auto-generated
  keys as nameless so existing configs re-serialize unchanged
- Plumb name through the add/update mutations and flattenMcpConfig
- Add optional "Server name" input to the SSE/shttp editor form

Part of #3726 (AgentProfile epic #3713).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(mcp): name marketplace remote installs after the catalog slug

The marketplace install path builds its own payload, separate from the
custom editor. Stdio entries already carry serverName, but remote
(sse/shttp) installs set no name — so GitHub, Linear, etc. landed under
the auto-generated "sse"/"shttp" key and were unreferenceable in
mcp_server_refs, the same gap the custom-editor fix addressed.

Set name: entry.id on the remote-install payload so e.g. GitHub keys as
"github". reserve() still de-dups repeat installs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(e2e): expect GitHub MCP install under the "github" key

The marketplace remote-install path now names servers after the catalog
slug, so a GitHub install persists under mcpServers.github (referenceable
in mcp_server_refs) rather than the auto-generated "shttp" fallback.
Update the install/delete e2e assertions accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(mcp): validate the optional SSE/shttp server name as a safe key

The Server name we added for SSE/shttp becomes the mcp_config dict key
(and the mcp_server_refs reference), but the form only validated stdio
names. An sse/shttp name with spaces/special chars would produce a
malformed key. Apply the same ^[a-zA-Z0-9_-]+$ rule stdio uses, while
keeping the field optional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Debug Agent <simon@openhands.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 21:39:21 +02:00
Hiep Le 57d078a271 refactor: extract TreeNode out of file-tree-view (#1358)
* refactor: extract TreeNode out of file-tree-view

* fix: failing tests
2026-06-16 18:53:17 +00:00
Hiep Le e011407118 fix: detect invalid credentials in MCP Test Connection (#1175) 2026-06-15 16:03:39 +00:00
Graham Neubig a289be7593 [codex] Fix ACP MCP auth header forwarding (#1164)
* Fix ACP MCP auth header forwarding

* Fix MCP auth header review feedback

* Expect redacted MCP auth headers

---------

Co-authored-by: neubig <398875+neubig@users.noreply.github.com>
Co-authored-by: Graham Neubig <gneubig@users.noreply.github.com>
2026-06-13 23:18:07 -04:00
Rohit Malhotra 92b25e0af3 ci: selective E2E test execution based on changed files (#1286)
* ci: add paths filters to E2E workflows to skip irrelevant PRs

Add paths: filters to the pull_request triggers of the three E2E
workflows so they are skipped when a PR only touches files that
cannot affect the test suite (docs, specs, .agents/, unrelated
test directories, etc.).

- mock-llm-e2e.yml: triggers on src/, public/, scripts/, bin/,
  config/, tests/e2e/mock-llm/, tests/e2e/support/, package.json,
  package-lock.json, build/TS/styling configs, and its own workflow
  file.

- snapshot-tests.yml: triggers on src/, public/,
  tests/e2e/snapshots/, tests/e2e/support/, package.json,
  package-lock.json, build/TS/styling/playwright configs, and its
  own workflow file. Both pull_request and push-to-main triggers
  are filtered with the same path set.

- mock-llm-docker-e2e.yml: same paths as mock-llm-e2e.yml plus
  docker/** and playwright.mock-llm-docker.config.ts. The
  workflow_run trigger (post-Docker-build on main) is unaffected
  by path filters and always runs.

workflow_dispatch is unaffected by paths: filters in all three
workflows, so a manual run always executes the full suite.

Co-authored-by: openhands <openhands@all-hands.dev>

* ci: organize mock-LLM E2E tests into feature subdirectories with selective execution

Reorganize the 15 mock-LLM spec files from a flat directory into feature
subdirectories that mirror the source code structure:

  tests/e2e/mock-llm/
    settings/    — LLM profiles, ACP agent, model switching
    conversations/ — core conversation flow, image upload
    automations/ — automation lifecycle, preset cards
    onboarding/  — first-run onboarding flow
    backends/    — auth modes, cross-connect, partial stack
    home/        — workspace selection, folder browser
    skills/      — skill loading and activation
    regressions/ — CSS isolation, event pagination, etc.

Add a test-mapping config (test-mapping.json) and resolver script
(scripts/resolve-affected-tests.mjs) that maps changed source files
to the affected test subdirectories. The resolver has three modes:

  1. Feature-isolated changes (e.g. src/components/features/settings/**)
     → run only the mapped subdirs + regressions
  2. Cross-cutting changes (src/api/**, package.json, shared helpers,
     or any unmapped src/ file) → run the full suite (__ALL__)
  3. Non-relevant changes (docs, specs) → nothing (workflow paths
     filter already skipped)

The mock-llm-e2e.yml workflow now has a 'Resolve affected test
directories' step that queries PR changed files via the GitHub API,
runs the resolver, and passes the result to Playwright. workflow_dispatch
always runs the full suite.

All relative imports in moved spec files are updated. The Playwright
config discovers specs recursively so no config change is needed.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: update PROJECT_ROOT paths in backend specs moved to subdirectory

The partial-stack and cross-connect specs resolve PROJECT_ROOT from
import.meta.url using ../../.. (3 levels). After moving them from
tests/e2e/mock-llm/ to tests/e2e/mock-llm/backends/, they need
../../../.. (4 levels) to reach the repo root. Without this fix,
bin/agent-canvas.mjs resolves to a nonexistent path and the
backend-only test fails with MODULE_NOT_FOUND.

Co-authored-by: openhands <openhands@all-hands.dev>

* ci: include new mock-LLM specs in selective runs

Co-authored-by: openhands <openhands@all-hands.dev>

* ci: fail closed for mock e2e selection

Co-authored-by: openhands <openhands@all-hands.dev>

* ci: avoid pending skipped e2e checks

Co-authored-by: openhands <openhands@all-hands.dev>

* test: align folder workspace e2e with auto-selection

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-13 00:30:09 -04:00
Engel Nyst 2888a5ca4e fix: preserve hidden LLM base URL on basic saves (#1347)
Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-13 05:05:25 +02:00
Engel Nyst af9c653f3c settings: trust public OpenHands provider models (#1280)
* settings: trust public OpenHands provider models
* test: update OpenHands profile E2E expectation
* test: allow transitional OpenHands model shape in E2E
* test: update OpenHands provider profile E2E
* ci: pin mock e2e to SDK provider PR

Temporarily run mock-LLM E2E against OpenHands/software-agent-sdk#3548 so the provider settings refactor is validated with the matching SDK end state.

* test: stabilize automation trajectory for SDK pin

Use non-empty safety replies for the automation-run conversation so the mock trajectory completes whether the pinned SDK does or does not consume an internal LLM turn first.

* ci: isolate SDK PR pin to smoke test

Keep the full mock-LLM and Docker E2E suites on the released agent-server/automation stack, and add a targeted profile-management E2E job that runs against the SDK PR git ref.

* ci: remove temporary SDK PR pin

Revert the temporary OpenHands/software-agent-sdk#3548 git ref before switching the PR to the release-branch SDK pin.

* ci: pin SDK smoke to release PR

Point the temporary SDK smoke-test pin at OpenHands/software-agent-sdk#3638 (Release v1.28.0) so PR #1280 validates against the release branch hash.

Co-authored-by: openhands <openhands@all-hands.dev>

Remove the temporary SDK release-branch pin now that software-agent-sdk v1.28.0 is published, and run the mock E2E workflow against the released agent-server package.

* test: align agent server version references

Update docs and drift-detection expectations for the 1.28.0 agent-server pin.

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-13 01:56:11 +00:00
Graham Neubig df93ca36a7 Add Windows portability guards for workspace flows (#1311)
* Add Windows portability guards for workspace flows

* Increase snapshot workflow timeout

* Trigger CI after timeout update

* Fix windows portability PR after main merge

---------

Co-authored-by: neubig <398875+neubig@users.noreply.github.com>
2026-06-12 19:14:03 -04:00
OpenHands Bot 82ea2b609a feat: save hosted MCP credentials as secrets (#1331) 2026-06-12 20:03:46 +00:00
Rohit Malhotra c7c8862c11 Remove visual snapshot tests and bump Docker E2E timeout (#1332)
* Remove visual snapshot tests

Co-authored-by: openhands <openhands@all-hands.dev>

* Bump Docker E2E timeout

Co-authored-by: openhands <openhands@all-hands.dev>

* Align Docker E2E timeout caps

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-12 13:03:58 -04:00
Rohit Malhotra 270ef6a876 Remove obsolete OpenHands proxy base URL handling (#1321)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
2026-06-12 00:40:21 +00:00
Tim O'Farrell 910b19ae76 chore: bump agent-server → 1.28.1, automation → 1.0.0a9, extensions → 0.4.1 (#1319)
* chore: bump agent-server → 1.28.1, automation → 1.0.0a9, extensions → 0.4.1

Co-authored-by: openhands <openhands@all-hands.dev>

* Test fixes

* fix: inject proxy base_url for litellm_proxy/* when server omits it (agent-server ≥1.28)

Agent-server ≥1.28 may return base_url:null when fetching a litellm_proxy/*
profile config, even when the profile was saved with the All-Hands proxy URL.
This caused the Basic-tab re-save flow in LlmSettingsLocalView.handleSave to
call isOpenHandsProxyModel(model, null) → false, hitting the else-branch that
deletes base_url and stranding the profile (issue #1146).

Fix: add a secondary check — litellm_proxy/* with a missing base_url is treated
the same as litellm_proxy/* with the proxy URL already set, and
OPENHANDS_LLM_PROXY_BASE_URL is injected before the save request is sent.

Also updates the mock-LLM E2E test to accept both storage representations:
- litellm_proxy/* + proxyBaseUrl  (pre-1.28, guards issue #1146 regression)
- openhands/*     + null          (1.28+, server-managed routing)

And adds a unit test exercising the base_url:null path.

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-11 19:16:03 -04:00
Tim O'Farrell 8071edf72a Revert "chore: bump agent-server → 1.28.1, automation → 1.0.0a9, extensions → 0.4.1 (#1315)" (#1318)
This reverts commit 1917b5d39fbf09dc51213b4b484698fe394314c7.

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-11 21:28:04 +00:00