UAT: audit.* configuration keys are missing from ConfigService registry — agents config get/set fails for audit keys #4089

Open
opened 2026-04-06 10:14:30 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/config-service-audit-keys
  • Commit Message: fix(config): register audit.* keys in ConfigService registry
  • Milestone: (backlog — non-critical)
  • Parent Epic: (config/settings epic)

Bug Report

What was tested: ConfigService._REGISTRY completeness vs specification for audit.* keys

Expected behavior (from spec, section "Global Configuration Keys", audit.*):

The spec defines three audit configuration keys:

Key Env Variable Default
audit.retention-days CLEVERAGENTS_AUDIT_RETENTION_DAYS 0
audit.async CLEVERAGENTS_AUDIT_ASYNC true
audit.queue-maxsize CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE 10000

These keys should be accessible via agents config get audit.retention-days, agents config set audit.async false, and agents config list audit.*.

Actual behavior:

In src/cleveragents/application/services/config_service.py, the _build_catalog() function registers keys for core.*, server.*, actor.*, plan.*, sandbox.*, index.*, context.*, provider.*, and skills.* — but completely omits the audit.* section.

Searching the file for "audit" in the registry context returns zero matches for any _register() call with an audit section.

As a result:

  1. agents config get audit.retention-days fails with "Unknown configuration key: 'audit.retention-days'"
  2. agents config set audit.async false fails with "Unknown configuration key: 'audit.async'"
  3. agents config list audit.* returns no results

Note: The Settings class (src/cleveragents/config/settings.py) does correctly implement these fields:

  • audit_retention_days (CLEVERAGENTS_AUDIT_RETENTION_DAYS, default=0)
  • audit_async (CLEVERAGENTS_AUDIT_ASYNC, default=True)
  • audit_queue_maxsize (CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE, default=10_000)

But the ConfigService registry — which powers the agents config CLI commands — is missing these entries entirely.

Steps to reproduce:

  1. Run agents config get audit.retention-days
  2. Observe: "Unknown configuration key: 'audit.retention-days'"

Code location: src/cleveragents/application/services/config_service.py, _build_catalog() function

Fix: Add the following three _register() calls to _build_catalog():

# ── audit.* (3 keys) ────────────────────────────────────────────────
_register(
    "audit",
    "retention-days",
    int,
    0,
    project_scopable=False,
    env_var="CLEVERAGENTS_AUDIT_RETENTION_DAYS",
    description="Days to retain audit log entries. 0 = keep indefinitely.",
)
_register(
    "audit",
    "async",
    bool,
    True,
    project_scopable=False,
    env_var="CLEVERAGENTS_AUDIT_ASYNC",
    description="Write audit entries asynchronously via write-behind queue.",
)
_register(
    "audit",
    "queue-maxsize",
    int,
    10000,
    project_scopable=False,
    env_var="CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE",
    description="Max pending audit entries in the write-behind queue.",
)

Subtasks

  • Add audit.retention-days _register() call to _build_catalog() in config_service.py
  • Add audit.async _register() call to _build_catalog() in config_service.py
  • Add audit.queue-maxsize _register() call to _build_catalog() in config_service.py
  • Tests (Behave): Add scenarios verifying agents config get/set/list for all three audit.* keys
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

  • All three audit.* keys are registered in ConfigService._REGISTRY
  • agents config get audit.retention-days returns 0
  • agents config set audit.async false succeeds without error
  • agents config list audit.* returns all three keys
  • Behave scenarios added and passing for all three keys
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone (active). It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/config-service-audit-keys` - **Commit Message**: `fix(config): register audit.* keys in ConfigService registry` - **Milestone**: (backlog — non-critical) - **Parent Epic**: (config/settings epic) ## Bug Report **What was tested:** `ConfigService._REGISTRY` completeness vs specification for `audit.*` keys **Expected behavior (from spec, section "Global Configuration Keys", `audit.*`):** The spec defines three audit configuration keys: | Key | Env Variable | Default | |-----|-------------|---------| | `audit.retention-days` | `CLEVERAGENTS_AUDIT_RETENTION_DAYS` | `0` | | `audit.async` | `CLEVERAGENTS_AUDIT_ASYNC` | `true` | | `audit.queue-maxsize` | `CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE` | `10000` | These keys should be accessible via `agents config get audit.retention-days`, `agents config set audit.async false`, and `agents config list audit.*`. **Actual behavior:** In `src/cleveragents/application/services/config_service.py`, the `_build_catalog()` function registers keys for `core.*`, `server.*`, `actor.*`, `plan.*`, `sandbox.*`, `index.*`, `context.*`, `provider.*`, and `skills.*` — but **completely omits the `audit.*` section**. Searching the file for "audit" in the registry context returns zero matches for any `_register()` call with an `audit` section. As a result: 1. `agents config get audit.retention-days` fails with "Unknown configuration key: 'audit.retention-days'" 2. `agents config set audit.async false` fails with "Unknown configuration key: 'audit.async'" 3. `agents config list audit.*` returns no results **Note:** The `Settings` class (`src/cleveragents/config/settings.py`) does correctly implement these fields: - `audit_retention_days` (CLEVERAGENTS_AUDIT_RETENTION_DAYS, default=0) - `audit_async` (CLEVERAGENTS_AUDIT_ASYNC, default=True) - `audit_queue_maxsize` (CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE, default=10_000) But the `ConfigService` registry — which powers the `agents config` CLI commands — is missing these entries entirely. **Steps to reproduce:** 1. Run `agents config get audit.retention-days` 2. Observe: "Unknown configuration key: 'audit.retention-days'" **Code location:** `src/cleveragents/application/services/config_service.py`, `_build_catalog()` function **Fix:** Add the following three `_register()` calls to `_build_catalog()`: ```python # ── audit.* (3 keys) ──────────────────────────────────────────────── _register( "audit", "retention-days", int, 0, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_RETENTION_DAYS", description="Days to retain audit log entries. 0 = keep indefinitely.", ) _register( "audit", "async", bool, True, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_ASYNC", description="Write audit entries asynchronously via write-behind queue.", ) _register( "audit", "queue-maxsize", int, 10000, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE", description="Max pending audit entries in the write-behind queue.", ) ``` ## Subtasks - [ ] Add `audit.retention-days` `_register()` call to `_build_catalog()` in `config_service.py` - [ ] Add `audit.async` `_register()` call to `_build_catalog()` in `config_service.py` - [ ] Add `audit.queue-maxsize` `_register()` call to `_build_catalog()` in `config_service.py` - [ ] Tests (Behave): Add scenarios verifying `agents config get/set/list` for all three `audit.*` keys - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] All three `audit.*` keys are registered in `ConfigService._REGISTRY` - [ ] `agents config get audit.retention-days` returns `0` - [ ] `agents config set audit.async false` succeeds without error - [ ] `agents config list audit.*` returns all three keys - [ ] Behave scenarios added and passing for all three keys - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone (active). It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:14 +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.

Blocks
Reference
cleveragents/cleveragents-core#4089
No description provided.