bug: Settings.log_level default is INFO instead of spec-required FATAL — runtime log level diverges from config system default #3655

Open
opened 2026-04-05 21:09:21 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/settings-log-level-default-fatal
  • Commit Message: fix(config): change Settings.log_level default from INFO to FATAL per spec
  • Milestone: (none — backlog)
  • Parent Epic: #397

Background

The specification (docs/specification.md, section "Global Configuration Keys", core.log.level) states:

core.log.level | string | FATAL | CLEVERAGENTS_LOG_LEVEL | Base logging verbosity level. The default FATAL means only fatal errors (where the application exits) produce log output; all other log messages are suppressed.

Expected behavior: When no CLEVERAGENTS_LOG_LEVEL env var is set and no config file entry exists, the effective log level should be FATAL (suppress all non-fatal log output).

Actual behavior: The Settings class in src/cleveragents/config/settings.py (line 121) has:

log_level: str = Field(
    default="INFO",
    validation_alias=AliasChoices("CLEVERAGENTS_LOG_LEVEL"),
)

The default is "INFO", not "FATAL". This means:

  1. When no env var is set, the runtime Settings object uses INFO log level
  2. The ConfigService registry correctly defaults core.log.level to "FATAL" (line 179 in config_service.py)
  3. These two defaults are inconsistent — the Settings class (used by the runtime) and the ConfigService registry (used by agents config) disagree on the default

Code location: src/cleveragents/config/settings.py, line 121 — default="INFO" should be default="FATAL".

Impact: The application produces INFO-level log output by default when no configuration is set, contrary to the spec's requirement that only fatal errors produce output by default. This can result in unexpected log noise in production deployments.

Steps to reproduce:

  1. Unset CLEVERAGENTS_LOG_LEVEL env var
  2. Instantiate Settings()
  3. Check settings.log_level — it returns "INFO" instead of "FATAL"

Subtasks

  • Change default="INFO" to default="FATAL" for log_level field in src/cleveragents/config/settings.py (line 121)
  • Also check debug_log_level field (line 125) — its default of "INFO" may be intentional for debug mode, but verify against spec
  • Update any Behave unit tests that assert log_level default is "INFO"
  • Verify nox -e typecheck passes
  • Verify nox -e unit_tests passes with coverage >= 97%

Definition of Done

  • Settings().log_level returns "FATAL" when CLEVERAGENTS_LOG_LEVEL is not set
  • Settings default matches ConfigService registry default for core.log.level
  • Behave unit tests updated to reflect the correct default
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. 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/settings-log-level-default-fatal` - **Commit Message**: `fix(config): change Settings.log_level default from INFO to FATAL per spec` - **Milestone**: *(none — backlog)* - **Parent Epic**: #397 ## Background The specification (`docs/specification.md`, section "Global Configuration Keys", `core.log.level`) states: > `core.log.level` | string | **`FATAL`** | `CLEVERAGENTS_LOG_LEVEL` | Base logging verbosity level. The default `FATAL` means only fatal errors (where the application exits) produce log output; all other log messages are suppressed. **Expected behavior**: When no `CLEVERAGENTS_LOG_LEVEL` env var is set and no config file entry exists, the effective log level should be `FATAL` (suppress all non-fatal log output). **Actual behavior**: The `Settings` class in `src/cleveragents/config/settings.py` (line 121) has: ```python log_level: str = Field( default="INFO", validation_alias=AliasChoices("CLEVERAGENTS_LOG_LEVEL"), ) ``` The default is `"INFO"`, not `"FATAL"`. This means: 1. When no env var is set, the runtime `Settings` object uses `INFO` log level 2. The `ConfigService` registry correctly defaults `core.log.level` to `"FATAL"` (line 179 in `config_service.py`) 3. These two defaults are inconsistent — the `Settings` class (used by the runtime) and the `ConfigService` registry (used by `agents config`) disagree on the default **Code location**: `src/cleveragents/config/settings.py`, line 121 — `default="INFO"` should be `default="FATAL"`. **Impact**: The application produces `INFO`-level log output by default when no configuration is set, contrary to the spec's requirement that only fatal errors produce output by default. This can result in unexpected log noise in production deployments. **Steps to reproduce**: 1. Unset `CLEVERAGENTS_LOG_LEVEL` env var 2. Instantiate `Settings()` 3. Check `settings.log_level` — it returns `"INFO"` instead of `"FATAL"` ## Subtasks - [ ] Change `default="INFO"` to `default="FATAL"` for `log_level` field in `src/cleveragents/config/settings.py` (line 121) - [ ] Also check `debug_log_level` field (line 125) — its default of `"INFO"` may be intentional for debug mode, but verify against spec - [ ] Update any Behave unit tests that assert `log_level` default is `"INFO"` - [ ] Verify `nox -e typecheck` passes - [ ] Verify `nox -e unit_tests` passes with coverage >= 97% ## Definition of Done - [ ] `Settings().log_level` returns `"FATAL"` when `CLEVERAGENTS_LOG_LEVEL` is not set - [ ] `Settings` default matches `ConfigService` registry default for `core.log.level` - [ ] Behave unit tests updated to reflect the correct default - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. 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
freemo added this to the v3.7.0 milestone 2026-04-05 21:13:15 +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
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3655
No description provided.