UAT: agents diagnostics --format json check objects use "name" field instead of spec-required "check" field; OpenAI provider check label uses "Openai key" instead of env var "OPENAI_API_KEY" #6845

Open
opened 2026-04-10 03:08:09 +00:00 by HAL9000 · 0 comments
Owner

What Was Tested

Code analysis of src/cleveragents/cli/commands/system.py _check_providers() function and build_diagnostics_data() output compared against the agents diagnostics JSON spec.

Expected Behavior (from spec)

The spec (docs/specification.md, around line 943-953) defines the agents diagnostics --format json output as:

{
  "data": {
    "checks": [
      { "check": "Config file", "status": "ok", "details": "readable" },
      { "check": "Database", "status": "ok", "details": "writable" },
      { "check": "OPENAI_API_KEY", "status": "warn", "details": "missing" },
      { "check": "Anthropic key", "status": "ok", "details": "configured" },
      ...
    ]
  }
}

Key spec requirements:

  1. Each check object must use "check" as the field name (not "name")
  2. For the OpenAI provider, the check label must be the env var name "OPENAI_API_KEY" (not "Openai key")

Actual Behavior

The _check_providers() function (line 265) generates:

{
    "name": f"{provider_name.capitalize()} key",  # "Openai key" not "OPENAI_API_KEY"
    "status": ...,
    "details": ...,
}

When serialised to JSON via format_output(), this produces:

{ "name": "Openai key", "status": "warn", "details": "missing" }

Violation 1: Field key is "name" instead of spec-required "check"

Violation 2: Provider check label for OpenAI is "Openai key" instead of the spec-required "OPENAI_API_KEY" (env var format)

Note: The same "name" vs "check" key inconsistency applies to ALL checks in the diagnostics output (Config file, Database, Disk space, Git, File permissions, etc.), not just provider checks.

Steps to Reproduce

agents diagnostics --format json

Inspect the data.checks array in the JSON output — each item will have "name" instead of "check", and the OpenAI check will show "Openai key" instead of "OPENAI_API_KEY".

Root Cause

src/cleveragents/cli/commands/system.py line 265:

"name": f"{provider_name.capitalize()} key",  # should be "check": env_var

All other _check_* functions also use "name" not "check" as the field name.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## What Was Tested Code analysis of `src/cleveragents/cli/commands/system.py` `_check_providers()` function and `build_diagnostics_data()` output compared against the `agents diagnostics` JSON spec. ## Expected Behavior (from spec) The spec (`docs/specification.md`, around line 943-953) defines the `agents diagnostics --format json` output as: ```json { "data": { "checks": [ { "check": "Config file", "status": "ok", "details": "readable" }, { "check": "Database", "status": "ok", "details": "writable" }, { "check": "OPENAI_API_KEY", "status": "warn", "details": "missing" }, { "check": "Anthropic key", "status": "ok", "details": "configured" }, ... ] } } ``` Key spec requirements: 1. Each check object must use `"check"` as the field name (not `"name"`) 2. For the OpenAI provider, the check label must be the env var name `"OPENAI_API_KEY"` (not `"Openai key"`) ## Actual Behavior The `_check_providers()` function (line 265) generates: ```python { "name": f"{provider_name.capitalize()} key", # "Openai key" not "OPENAI_API_KEY" "status": ..., "details": ..., } ``` When serialised to JSON via `format_output()`, this produces: ```json { "name": "Openai key", "status": "warn", "details": "missing" } ``` **Violation 1**: Field key is `"name"` instead of spec-required `"check"` **Violation 2**: Provider check label for OpenAI is `"Openai key"` instead of the spec-required `"OPENAI_API_KEY"` (env var format) Note: The same `"name"` vs `"check"` key inconsistency applies to ALL checks in the diagnostics output (Config file, Database, Disk space, Git, File permissions, etc.), not just provider checks. ## Steps to Reproduce ```bash agents diagnostics --format json ``` Inspect the `data.checks` array in the JSON output — each item will have `"name"` instead of `"check"`, and the OpenAI check will show `"Openai key"` instead of `"OPENAI_API_KEY"`. ## Root Cause `src/cleveragents/cli/commands/system.py` line 265: ```python "name": f"{provider_name.capitalize()} key", # should be "check": env_var ``` All other `_check_*` functions also use `"name"` not `"check"` as the field name. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 03:08:09 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6845
No description provided.