Summary
Start new conversations using backend-stored settings instead of having the browser build and send the full runnable Agent payload.
This is the GUI counterpart to the remaining settings-backed conversation creation work in OpenHands/software-agent-sdk#3034.
Current behavior
src/api/conversation-service/v1-conversation-service.api.ts currently:
- calls
SettingsService.getSettings();
- calls
buildStartConversationRequest({ settings, ... }) from src/api/agent-server-adapter.ts;
- posts a full payload to
/api/conversations containing agent, workspace, confirmation_policy, security_analyzer, max_iterations, plugins, etc.
Once settings are backend-owned, this can drift from SDK behavior and can require browser access to secret-bearing configuration.
Dependencies
Requires an agent-server API/capability that can start conversations from persisted settings, as specified in the remaining work on OpenHands/software-agent-sdk#3034.
Keep compatibility fallback for older agent-server versions until the minimum supported version is raised.
Desired request behavior
On supported backends, V1ConversationService.createConversation() sends only runtime inputs and explicit per-run overrides, for example:
{
"use_stored_settings": true,
"workspace": { "kind": "LocalWorkspace", "working_dir": "workspace/project" },
"initial_message": {
"role": "user",
"content": [{ "type": "text", "text": "..." }]
},
"plugins": [],
"agent_settings_diff": {},
"conversation_settings_diff": {}
}
The exact field names should match the SDK API that lands. The invariant is:
- the browser does not send
agent.llm.api_key;
- the browser does not send a full
agent object in the default settings-backed path;
- the server constructs the runnable agent from persisted settings.
Implementation requirements
- Add capability detection for settings-backed conversation creation.
- Prefer explicit server capability metadata if available.
- Otherwise gate by the agent-server version where the SDK feature lands.
- Update
V1ConversationService.createConversation() to use the settings-backed request on supported servers.
- Keep legacy fallback to
buildStartConversationRequest() for unsupported servers.
- Preserve runtime-only values:
- initial user message;
- conversation instructions;
- selected working directory;
- plugins;
- plan/subconversation metadata if applicable;
- explicit one-off settings overrides, if a UI flow supplies them.
- Remove
SettingsService.getSettings() from the normal conversation-start path on supported servers.
- Keep conversation response adaptation unchanged unless the backend response contract changes.
Acceptance criteria
Suggested tests
__tests__/api/v1-conversation-service.test.ts
- supported backend: payload has
use_stored_settings or canonical equivalent and no agent;
- fallback backend: existing payload builder still used;
- payload includes workspace, initial message, and plugins;
- no raw secret fields are sent.
__tests__/api/agent-server-adapter.test.ts
- legacy builder tests remain but are scoped to fallback behavior.
Non-goals
Related prior work
Closed GUI issue #37 aligned conversation startup with nested SDK settings on the client side. This issue is different: it moves default runnable agent construction to the backend once backend-persisted settings exist.
This issue was created by an AI agent (OpenHands) on behalf of the user.
Summary
Start new conversations using backend-stored settings instead of having the browser build and send the full runnable
Agentpayload.This is the GUI counterpart to the remaining settings-backed conversation creation work in OpenHands/software-agent-sdk#3034.
Current behavior
src/api/conversation-service/v1-conversation-service.api.tscurrently:SettingsService.getSettings();buildStartConversationRequest({ settings, ... })fromsrc/api/agent-server-adapter.ts;/api/conversationscontainingagent,workspace,confirmation_policy,security_analyzer,max_iterations, plugins, etc.Once settings are backend-owned, this can drift from SDK behavior and can require browser access to secret-bearing configuration.
Dependencies
Requires an agent-server API/capability that can start conversations from persisted settings, as specified in the remaining work on OpenHands/software-agent-sdk#3034.
Keep compatibility fallback for older agent-server versions until the minimum supported version is raised.
Desired request behavior
On supported backends,
V1ConversationService.createConversation()sends only runtime inputs and explicit per-run overrides, for example:{ "use_stored_settings": true, "workspace": { "kind": "LocalWorkspace", "working_dir": "workspace/project" }, "initial_message": { "role": "user", "content": [{ "type": "text", "text": "..." }] }, "plugins": [], "agent_settings_diff": {}, "conversation_settings_diff": {} }The exact field names should match the SDK API that lands. The invariant is:
agent.llm.api_key;agentobject in the default settings-backed path;Implementation requirements
V1ConversationService.createConversation()to use the settings-backed request on supported servers.buildStartConversationRequest()for unsupported servers.SettingsService.getSettings()from the normal conversation-start path on supported servers.Acceptance criteria
SettingsService.getSettings()solely to build a conversation-start request.agentobject.buildStartConversationRequest()is reduced to fallback-only use or clearly marked/tested as legacy behavior.Suggested tests
__tests__/api/v1-conversation-service.test.tsuse_stored_settingsor canonical equivalent and noagent;__tests__/api/agent-server-adapter.test.tsNon-goals
Related prior work
Closed GUI issue #37 aligned conversation startup with nested SDK settings on the client side. This issue is different: it moves default runnable agent construction to the backend once backend-persisted settings exist.
This issue was created by an AI agent (OpenHands) on behalf of the user.