Skip to content

test(config): fix all 9 stale failures in the config suite (#12774) - #12821

Merged
mrveiss merged 2 commits into
Dev_new_guifrom
issue-12774
Jul 27, 2026
Merged

mrveiss merged 2 commits into
Dev_new_guifrom
issue-12774

Conversation

@mrveiss

@mrveiss mrveiss commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Thinking Path

config/ was 9 failed, 93 passed. Every one turned out to be a test asserting an API, module or value that no longer exists — the same class as #12668 (stale attributes) and #12673 (environment-dependent assertions) — not product bugs. So the work was verifying what each subject actually does now, then retargeting the test at that, rather than "making it pass".

The recurring trap: ConfigManager.get() and .set() are flat dict operations (config/sync_ops.py). They resolve neither dotted paths nor env vars. Six of the nine failures trace back to tests assuming otherwise.

What Changed

validation_test (2) — GH#9232 removed backend.server_host from the required set; _REQUIRED_CONFIG_KEYS is now literally empty because it defaults to 0.0.0.0. The tests asserted it was required.

Rather than delete the coverage, I kept the invariant the class exists for. Its docstring is "Ensure is None (not truthiness) is used for required-key checks" — so that distinction is now exercised against memory.redis.host, which is still conditionally required and is still gated on if value is None. The falsy-but-present side ('0') was already covered.

timeout_configuration_test (1) — assigned config.llm_timeout = "999.0" then asserted "AUTOBOT_LLM_TIMEOUT" in os.environ. Assignment to the proxy doesn't write the environment; the test's own comment conceded it only "test[ed] the mechanism exists".

The real mechanism is pydantic-settings reading env at construction, and the module-level proxy is built once and cached. Verified directly before rewriting:

fresh AutoBotConfig().llm_timeout with env set:  999
fresh without env:                                30

config_migration_integration_test (6) — each verified against the live objects:

Assumption Reality
cm.get("a.b.c") flat lookup — needs get_nested()
cm.set("a.b.c", v) flat write — needs set_nested(); this is why the processor read 0.7 not the 0.9 the test "set"
get_section() renamed get_config_section()
from utils.config_manager import config module removed
from config import config yields SSOT _ConfigProxy — has neither .get nor .config; the legacy wrapper is config.compat.Config
"llm" top-level section LLM config lives under backend.llm
llm.orchestrator_llm / llm.ollama.port do not exist anywhere — the old equality assertion compared None to None and was vacuous
redis.host in ["localhost","127.0.0.1"] an SSOT deployment value — pinned assertion fails on any real deployment

Verification

before (unmodified tree):   9 failed, 93 passed
after:                    102 passed

Two of these were fixed by making the assertion stronger, not weaker: the backward-compat check now compares a key that actually exists (the previous one was vacuously true), and the required-key test now targets a key that is genuinely still required.

Model Used

Claude Opus 5 (1M context)

Closes #12774

config/ went 9 failed, 93 passed -> 102 passed. Every failure was a test
asserting an API, module or value that no longer exists — the same class as
#12668 (stale attrs) and #12673 (environment-dependent assertions), not product
bugs. Each was verified against the real implementation before rewriting.

validation_test (2): GH#9232 removed backend.server_host from the required set —
_REQUIRED_CONFIG_KEYS is now literally empty because it defaults to 0.0.0.0. The
tests asserted it WAS required. Rather than delete the coverage, the is-None-vs-
falsy invariant the class exists for is now exercised against memory.redis.host,
which IS still conditionally required and IS still gated on `if value is None`.

timeout_configuration_test (1): assigned `config.llm_timeout = "999.0"` then
asserted `"AUTOBOT_LLM_TIMEOUT" in os.environ`. Assignment to the proxy does not
write the environment; the test's own comment conceded it only "test[ed] the
mechanism exists". The real mechanism is pydantic-settings reading env at
construction, and the module-level proxy is cached — so the override is now
observed on a fresh AutoBotConfig(), confirmed 999 with the env var and the
default without it.

config_migration_integration_test (6), all verified against the live objects:
  - ConfigManager.get() is a FLAT dict lookup (config/sync_ops.py) — it resolves
    neither dotted paths nor env vars. Dotted lookups now use get_nested().
  - get_section() -> get_config_section() (renamed).
  - set() is likewise flat, so nested writes now use set_nested() — this is why
    the multimodal processor read 0.7 instead of the 0.9 the test had "set".
  - `utils.config_manager` no longer exists; `from config import config` yields
    the SSOT _ConfigProxy which has neither .get nor .config. The legacy wrapper
    is config.compat.Config.
  - "llm" is not a top-level section (LLM config lives under backend.llm), and
    llm.orchestrator_llm / llm.ollama.port do not exist anywhere — the old
    equality assertion compared None to None and was vacuous. Replaced with keys
    that exist.
  - redis.host was pinned to ["localhost","127.0.0.1"]; it is an SSOT
    deployment value, so that failed on any real deployment. Now asserted to be
    a non-empty string.

Closes #12774
@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant