[Bug]: Studio Agent Evolution status control fails with 403 in dev mode
Issue Origin
Observed or reproduced in a real environment
Bug Description
In a local single-user OpenViking deployment, Studio's Agent Experience page advertises the Agent Evolution switch and settings even when the server is running in dev auth mode without root_api_key. The frontend then calls an account-specific admin API that the server intentionally rejects in this mode. As a result, the UI repeatedly reports 开关状态读取失败 (Failed to read switch status) rather than explaining that this action is unsupported in the deployment or showing the effective configuration-controlled status.
The server reports healthy, and its configuration has server.agent_evolution.enabled: true. Thus the generic read failure makes an active feature look broken even though the immediate failure is an admin-authorization mismatch.
Source inspection of the current frontend and server main branch shows the mismatch:
use-app-connection.tsxresolvesdevmode as therootrole without probing.evolution-settings-popover.tsxpermits management foradmin/root, queries the status, and maps any query error to the generic load-failed text.agent-experience/-lib/api.tstargets/api/v1/admin/accounts/${accountId}/settingsfor GET and PATCH.server/auth/__init__.pyrejects admin-role requests when no API key manager is configured, regardless of the resolved role.
The server restriction appears intentional. The defect is that Studio advertises and offers a management action that predictably cannot work in dev mode, and presents the resulting 403 as a generic status-loading failure.
Steps to Reproduce
- Run OpenViking
0.5.0locally on127.0.0.1:1933withserver.auth_mode: "dev",server.agent_evolution.enabled: true, and noroot_api_keyconfigured. - Verify that the server is healthy through
/health. - Open Web Studio and go to Agent Experience.
- Observe
启用 Agent 进化(Enable Agent Evolution) and open经验设置(Experience settings). 开关状态读取失败(Failed to read switch status) appears both beside the button and inside the popover.- Independently of the browser session, request the exact account-settings endpoint used by the installed frontend without an API key; it reproducibly returns
403 PERMISSION_DENIED.
Expected Behavior
Studio should not present an unexplained generic load failure for an active, server-configured feature in dev mode.
Acceptable behavior would be either:
- expose the effective Agent Evolution status through an appropriately scoped, read-only route supported in
devmode; or - explicitly identify this deployment as using configuration-controlled Agent Evolution and hide or disable unsupported management actions, with a clear explanation.
The account-specific admin API should retain its existing API-key/root-key authorization policy.
Actual Behavior
The server remains healthy, but the settings UI cannot read the switch state. The installed frontend requests:
GET http://127.0.0.1:1933/api/v1/admin/accounts/default/settings
With no API key present, that request returns HTTP 403 with PERMISSION_DENIED. The UI maps this to 开关状态读取失败 (Failed to read switch status) in both locations and offers only a refresh action.
Minimal Reproducible Example
Use the same server configuration as above, then run:
curl -i http://127.0.0.1:1933/health
curl -i http://127.0.0.1:1933/api/v1/admin/accounts/default/settings
The first request succeeds; the second reproduces the 403 response below. No provider credentials are involved because the failure occurs before provider authorization.
Error Logs
GET /health returns HTTP 200:
{"status":"ok","healthy":true,"version":"0.5.0","auth_mode":"dev"}
GET /api/v1/admin/accounts/default/settings returns HTTP 403:
{"status":"error","result":null,"error":{"code":"PERMISSION_DENIED","message":"Admin API requires api_key mode with root_api_key configured. Development mode does not support account or user management. You should set server.auth_mode = \"api_key\" in ov.conf","details":{}},"telemetry":null,"profile":null}
OpenViking Version
0.5.0
Python Version
3.12.14
Operating System
macOS
Model Backend
DeepSeek through an OpenAI-compatible API. The failure occurs before provider authorization, so the provider is not relevant to this issue.
Additional Context
The legacy /api/v1/admin/agent-evolution endpoint also returns the same 403, but the installed frontend does not use that endpoint. This report concerns the newer account-specific settings endpoint introduced after issue #4834 and PR #4835. Unlike #4834, this occurs with the single default account in dev mode.
Other existing data APIs and memory reads returned HTTP 200. Reading a committed session archive through the content API returned .meta.json containing {"agent_evolution":{"enabled":true,"skip_reason":null}}, confirming that the generation switch was active for that commit; it does not establish successful end-to-end Experience extraction. This report is specifically about status UI/control compatibility, not failed memory extraction.
AI-assistance disclosure: the UI observation came from a human; an agent reproduced the HTTP failure and inspected the installed package and upstream source; GLM drafted this issue from the verified evidence.