Problem
Saving a new LLM configuration from Agent Canvas against an OpenHands Cloud backend can break the user's Cloud settings with this backend validation error:
Something went wrong storing settings: 1 validation error for OpenHandsAgentSettings
agent_context
Input should be a valid dictionary or instance of AgentContext [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.12/v/model_type
I did not find an existing agent-canvas issue for this exact agent_context=None failure. #911 tracks accepting invalid LLM values, but this is a backend payload/schema compatibility issue while saving Cloud LLM settings.
Likely area to inspect:
src/api/cloud/settings-service.api.ts::saveCloudSettings() posts nested agent_settings_diff to /api/v1/settings.
- Cloud settings responses may include nested
agent_settings / SDK settings state that contains agent_context: null.
- The Cloud backend validates against
OpenHandsAgentSettings, where agent_context must be a dict / AgentContext, not None.
Expected behavior
Saving a new LLM/profile from Agent Canvas should not leave Cloud settings in an invalid state.
At minimum, Agent Canvas should avoid sending or preserving agent_context: null in any Cloud settings payload that the backend validates as OpenHandsAgentSettings. If Cloud returns agent_context: null, the frontend should normalize it to {} or omit it before round-tripping, depending on the backend contract.
Acceptance criteria
- Reproducing the Cloud LLM save flow no longer produces the
OpenHandsAgentSettings.agent_context validation error.
- Agent Canvas does not send
agent_context: null in Cloud settings save requests.
- Existing settings with
agent_context: null are repaired or safely normalized on next save.
- Regression coverage asserts the Cloud settings save payload for a new LLM config cannot include
agent_context: null.
This issue was created by an AI agent (OpenHands) on behalf of the user.
Problem
Saving a new LLM configuration from Agent Canvas against an OpenHands Cloud backend can break the user's Cloud settings with this backend validation error:
I did not find an existing agent-canvas issue for this exact
agent_context=Nonefailure. #911 tracks accepting invalid LLM values, but this is a backend payload/schema compatibility issue while saving Cloud LLM settings.Likely area to inspect:
src/api/cloud/settings-service.api.ts::saveCloudSettings()posts nestedagent_settings_diffto/api/v1/settings.agent_settings/ SDK settings state that containsagent_context: null.OpenHandsAgentSettings, whereagent_contextmust be a dict /AgentContext, notNone.Expected behavior
Saving a new LLM/profile from Agent Canvas should not leave Cloud settings in an invalid state.
At minimum, Agent Canvas should avoid sending or preserving
agent_context: nullin any Cloud settings payload that the backend validates asOpenHandsAgentSettings. If Cloud returnsagent_context: null, the frontend should normalize it to{}or omit it before round-tripping, depending on the backend contract.Acceptance criteria
OpenHandsAgentSettings.agent_contextvalidation error.agent_context: nullin Cloud settings save requests.agent_context: nullare repaired or safely normalized on next save.agent_context: null.This issue was created by an AI agent (OpenHands) on behalf of the user.