test(config): the unseeded-key rows state their real did-you-mean
The display.tool_progress row passed suggestion=None, but
_validate_config_key("display.tool_progress") returns
(False, "display.tool_progress_command") because only the _command sibling
is seeded in DEFAULT_CONFIG. The `if suggestion:` guard let the row pass
without ever checking the notice, so the misleading "Did you mean" this
real runtime key (cli.py:2568) receives was neither asserted nor visible.
Pin the actual suggestion for that row and assert the notice text exactly
for every row: present with the expected sibling, or absent. Fix the
comment too — only stt.provider comes from da942e4483's list; the rows are
unseeded runtime-read keys at agent/agent_init.py:1324, cli.py:2568 and
tools/transcription_tools.py:241.
Seeding display.tool_progress in config_defaults.py (hermes_cli/AGENTS.md:
"every reader a registry entry") is the proper follow-up that removes the
misleading suggestion; it is out of scope for this salvage.
This commit is contained in:
@@ -526,10 +526,13 @@ class TestSchemaValidation:
|
||||
assert "discord.gateway_restart_notification" in err
|
||||
|
||||
@pytest.mark.parametrize("key,value,expected,suggestion", [
|
||||
# Unseeded runtime-read keys (teknium's list in da942e4483): a stored value is an explicit
|
||||
# user pick, so the schema walk must not refuse them.
|
||||
# Unseeded runtime-read keys (agent/agent_init.py:1324, cli.py:2568,
|
||||
# tools/transcription_tools.py:241; da942e4483 names more): a stored value is an
|
||||
# explicit user pick, so the schema walk must not refuse them.
|
||||
("skills.creation_nudge_interval", "50", 50, None),
|
||||
("display.tool_progress", "all", "all", None),
|
||||
# Honest trade-off: this real runtime key gets a misleading sibling suggestion because
|
||||
# only display.tool_progress_command is seeded. Seeding it is the proper follow-up.
|
||||
("display.tool_progress", "all", "all", "display.tool_progress_command"),
|
||||
("stt.provider", "whisper", "whisper", None),
|
||||
# TRADE-OFF made explicit: a same-section typo is indistinguishable from an unseeded key,
|
||||
# so it is written too — the user gets the sibling suggestion instead of a refusal.
|
||||
@@ -546,7 +549,9 @@ class TestSchemaValidation:
|
||||
assert saved[section][name] == expected
|
||||
out = capsys.readouterr().out
|
||||
assert "not a recognized config key" in out
|
||||
if suggestion:
|
||||
if suggestion is None:
|
||||
assert "Did you mean" not in out
|
||||
else:
|
||||
assert f"Did you mean: {suggestion}" in out
|
||||
|
||||
def test_unknown_top_level_key_still_written_with_notice(self, _isolated_hermes_home, capsys):
|
||||
|
||||
Reference in New Issue
Block a user