agents init --yes dumps Alembic migration INFO lines to stdout without verbose flag #4098

Open
opened 2026-04-06 10:20:58 +00:00 by hurui200320 · 1 comment
Member

Metadata

  • Commit Message: fix(init): suppress Alembic migration INFO logs when verbose flag is not set
  • Branch: fix/init-suppress-alembic-migration-logs

Description

Background

agents init --yes emits 40+ Alembic migration INFO log lines directly to
stdout even when no -v / --verbose flag is passed. This was discovered by
running:

agents init --yes 2>&1 | head -5

which produces output like:

INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 001_initial_schema, Initial database schema...
INFO  [alembic.runtime.migration] Running upgrade 001_initial_schema -> 4b518923afb2, add_debug_attempts...
INFO  [alembic.runtime.migration] Running upgrade 4b518923afb2 -> c3d9b3d0cf3e, Add actors table...

(40+ lines total, before the expected Initialized panel appears.)

The related issue #4083 (Settings.log_level default is 'INFO' but spec
requires 'FATAL') may be a contributing factor, but this bug specifically
identifies the Alembic logger (alembic.runtime.migration) as the source of
the leaked output.

Current Behavior

Running agents init --yes without any -v flag prints 40+ Alembic migration
INFO messages to stdout before the Initialized panel. These lines appear
even when output is redirected or piped.

Expected Behavior

Per the spec (Global Options, -v flag description): "By default (no -v),
only normal command output is shown on stdout; logging output is suppressed
except on fatal errors."
The agents init --yes spec example shows clean
output consisting solely of the Initialized panel with no migration log lines.

Acceptance Criteria

  • Running agents init --yes (no -v) produces no INFO log lines on
    stdout; only the Initialized panel is printed.
  • Running agents init --yes -v still shows the Alembic migration INFO lines
    (verbose mode is unaffected).
  • Piping agents init --yes output to a JSON/YAML parser does not fail due to
    spurious log lines.

Subtasks

  • Identify where the Alembic logger is configured (or not configured) during
    agents init execution
  • Add or correct logger configuration so that alembic.runtime.migration
    (and any other Alembic loggers) are set to WARNING or higher by default
    when -v is not passed
  • Verify the fix does not suppress Alembic output when -v is active
  • Tests (Behave): add scenario asserting no INFO lines appear in stdout
    for agents init --yes without -v
  • Tests (Robot): add/update integration test for agents init --yes clean
    output
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message
    matches the Commit Message in Metadata exactly, followed by a blank line,
    then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in
    Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and
    merged before this issue is marked done.
  • All nox default sessions pass.
  • Coverage >= 97%.
## Metadata - **Commit Message**: `fix(init): suppress Alembic migration INFO logs when verbose flag is not set` - **Branch**: `fix/init-suppress-alembic-migration-logs` ## Description ### Background `agents init --yes` emits 40+ Alembic migration `INFO` log lines directly to stdout even when no `-v` / `--verbose` flag is passed. This was discovered by running: ``` agents init --yes 2>&1 | head -5 ``` which produces output like: ``` INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade -> 001_initial_schema, Initial database schema... INFO [alembic.runtime.migration] Running upgrade 001_initial_schema -> 4b518923afb2, add_debug_attempts... INFO [alembic.runtime.migration] Running upgrade 4b518923afb2 -> c3d9b3d0cf3e, Add actors table... ``` (40+ lines total, before the expected `Initialized` panel appears.) The related issue #4083 (`Settings.log_level` default is `'INFO'` but spec requires `'FATAL'`) may be a contributing factor, but this bug specifically identifies the Alembic logger (`alembic.runtime.migration`) as the source of the leaked output. ### Current Behavior Running `agents init --yes` without any `-v` flag prints 40+ Alembic migration `INFO` messages to stdout before the `Initialized` panel. These lines appear even when output is redirected or piped. ### Expected Behavior Per the spec (Global Options, `-v` flag description): *"By default (no `-v`), only normal command output is shown on stdout; logging output is suppressed except on fatal errors."* The `agents init --yes` spec example shows clean output consisting solely of the `Initialized` panel with no migration log lines. ### Acceptance Criteria - Running `agents init --yes` (no `-v`) produces **no** `INFO` log lines on stdout; only the `Initialized` panel is printed. - Running `agents init --yes -v` still shows the Alembic migration `INFO` lines (verbose mode is unaffected). - Piping `agents init --yes` output to a JSON/YAML parser does not fail due to spurious log lines. ## Subtasks - [ ] Identify where the Alembic logger is configured (or not configured) during `agents init` execution - [ ] Add or correct logger configuration so that `alembic.runtime.migration` (and any other Alembic loggers) are set to `WARNING` or higher by default when `-v` is not passed - [ ] Verify the fix does not suppress Alembic output when `-v` is active - [ ] Tests (Behave): add scenario asserting no `INFO` lines appear in stdout for `agents init --yes` without `-v` - [ ] Tests (Robot): add/update integration test for `agents init --yes` clean output - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All `nox` default sessions pass. - Coverage >= 97%.
HAL9000 self-assigned this 2026-04-08 18:51:51 +00:00
HAL9000 added this to the v3.8.0 milestone 2026-04-08 18:51:51 +00:00
Owner

Issue assigned to @HAL9000 and milestone set to v3.8.0.

Milestone Rationale: This is a MoSCoW/Could Have cosmetic issue — Alembic migration INFO logs appearing without verbose flag. Not blocking any functionality. Assigned to v3.8.0 as a polish item.

Assignment Rationale: Default assignment to HAL9000 to maintain velocity.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue assigned to @HAL9000 and milestone set to **v3.8.0**. **Milestone Rationale**: This is a MoSCoW/Could Have cosmetic issue — Alembic migration INFO logs appearing without verbose flag. Not blocking any functionality. Assigned to v3.8.0 as a polish item. **Assignment Rationale**: Default assignment to HAL9000 to maintain velocity. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#4098
No description provided.