deduplicate-config-deprecation

Deduplicate config deprecation diagnostics and stop TUI terminal spam

Metadata

Statusdone
Assignedagent-745
Agent identity02e879681e52e0a384106169be043416c4d946e850ab26b2269c57681b52a6e7
Modelpi:zai:glm-5.2
Created2026-07-13T15:26:29.622609723+00:00
Started2026-07-25T14:18:11.213929190+00:00
Completed2026-07-25T15:23:55.294343872+00:00
Tokens31534005 in / 79749 out

Description

Problem

Users see long deprecation text interleaved with TUI graph rows and content, e.g. deprecated; wg now derives the handler from the model spec.... This is independent of slow/async filesystem work. Config::load and Config::load_merged currently emit diagnostics directly with eprintln! on every load. TUI refreshes, daemon/config consumers, smoke commands, and worker raw streams can therefore repeat the same paragraph and corrupt the terminal presentation. The explicit-execution smoke intentionally loads a legacy config multiple times, making the issue easy to reproduce.

Objective

Make configuration loading side-effect-free with respect to terminal output. Collect structured diagnostics during load and emit them only at appropriate user-facing command boundaries, deduplicated by source/key/value/config fingerprint. TUI and service paths must never print raw migration warnings into the alternate screen or on every refresh/tick.

Required behavior

  • Remove unconditional warning eprintln! calls from reusable config-load paths (Config::load, load_merged, normalization helpers, and equivalents).
  • Return/collect structured diagnostics separately from configuration data, without losing actionable migration information.
  • CLI commands may emit each diagnostic once per invocation where relevant; wg config lint/migration surfaces remain complete and copy-pasteable.
  • Long-running daemon emission is at most once per changed config fingerprint and never once per tick/load; prefer status/health state over log spam.
  • TUI displays at most a compact, deduplicated config-health indicator/toast with details available on demand. Never write raw warning paragraphs directly to the terminal while the alternate screen is active.
  • Worker/smoke tests that intentionally exercise legacy config capture and assert diagnostics instead of leaking them into unrelated agent output.
  • Preserve diagnostics for truly explicit legacy keys; clean configs remain silent.

Validation

  • Repeated config load (100x) produces no direct stderr side effects.
  • Repeated CLI command/config loads emit at most one copy of each diagnostic per invocation.
  • Daemon repeated ticks and hot reload without config changes do not grow warning logs.
  • TUI scripted render with a legacy config contains no warning text interleaved with graph rows; compact health feedback is stable.
  • Config change can surface one new diagnostic and clearing the key clears health state.
  • Explicit execution-selection smoke captures expected migration text and emits no terminal spam.
  • Existing config lint/migrate and handler-first tests pass.
  • cargo fmt --check, clippy, relevant/full tests, and cargo install --path . --locked pass; commit all changes.

Depends on

Required by

Log