OpenHands/agent-canvas

Clarify home-page error when active LLM profile is missing API key

已关闭

#1,344 创建于 2026年6月12日

 (1 条评论) (0 个反应) (0 位负责人)TypeScript (26 个派生)github user discovery
good first issue

仓库指标

星标
 (43 个星标)
PR 合并指标
 (平均合并 2天 10小时) (30 天内合并 106 个 PR)

描述

Problem

A user can get into a confusing blocked state on the main splash/home page when an LLM profile exists and appears selected, but the profile no longer has a usable API key (api_key_set: false).

In this state:

  • The model/profile dropdown can still show the configured profile/model.
  • The home-page banner says the user needs to set up an LLM profile.
  • The prompt/send button is disabled.
  • If execution is attempted or a previous conversation resumes, the agent-server can fail with a LiteLLM/OpenAI auth error similar to:
litellm.AuthenticationError: AuthenticationError: OpenAIException - {
  "error": {
    "message": "Incorrect API key provided: None. You can find your API key at https://platform.openai.com/account/api-keys.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

Why the current UX is misleading

The user has already set up an LLM profile, and the UI may visibly show that profile/model. The actual problem is more specific: the active profile exists but is unusable because its API key is missing/cleared/unreadable (api_key_set: false).

The current message points users toward creating/configuring an LLM profile from scratch, which makes the app feel internally inconsistent because the dropdown still shows a configured model.

Suggested UX improvement

When the active local LLM profile exists but has api_key_set: false, show a more specific recovery message, for example:

Your active LLM profile appears to be missing its API key. Edit the profile and re-enter the key before starting a conversation.

The CTA should take the user directly to the LLM profile editor or otherwise clearly indicate which profile needs repair.

Detection criteria

For local agent-server mode, this can likely be detected from GET /api/profiles:

  • active_profile is non-null
  • A matching profile exists in profiles[]
  • That matching profile has api_key_set: false

This should be distinct from the genuinely unconfigured state where there are no profiles or no active profile.

Notes

This can happen if a profile was previously valid but later lost its key, for example after a save flow overwrites the profile without preserving api_key, or after encrypted profile secrets become unreadable due to an agent-server OH_SECRET_KEY/state-dir mismatch and the profile is saved again.

This issue was created by an AI agent (OpenHands) on behalf of the user.

贡献者指南