refactor(types): simplify pass on P1 batch

Follow-up to 15ac253b per /simplify review:

- gateway/platforms/discord.py:3638 - move self.resolved = True *after*
  the `if interaction.data is None: return` guard. Previously the view
  was marked resolved before the None-guard, so a None data payload
  silently rejected the user's next click.
- agent/display.py:732 - replace `if self.start_time is None: continue`
  with `assert self.start_time is not None`. start() sets start_time
  before the animate thread starts, so the None branch was dead; the
  `continue` form would have busy-looped (skipping the 0.12s sleep).
- tests/hermes_cli/test_config_shapes.py - drop __total__ dunder
  restatement test (it just echoes the class declaration); trim commit
  narration from module docstring.
- tests/agent/test_credential_pool.py, tests/tools/test_rl_training_tool.py -
  drop "added in commit ..." banners (narrates the change per CLAUDE.md).
This commit is contained in:
alt-glitch 2026-04-21 20:40:12 +05:30
parent 527ca7d238
commit 79a5f03f92
5 changed files with 5 additions and 29 deletions

View file

@ -1,17 +1,11 @@
"""Tests for TypedDict shape definitions added in commit fc00f699.
Verifies that _CamofoxConfig is importable, honours total=False
(all fields optional), and nests correctly inside _BrowserConfig.
"""
"""Runtime smoke tests for `_CamofoxConfig` / `_BrowserConfig` TypedDict shapes."""
from __future__ import annotations
def test_camofox_config_is_partial_typeddict():
"""_CamofoxConfig should accept zero or more keys (total=False)."""
from hermes_cli.config import _CamofoxConfig, _BrowserConfig
from hermes_cli.config import _CamofoxConfig
# total=False: constructing with no keys must succeed at runtime
cfg_empty: _CamofoxConfig = {}
cfg_with_field: _CamofoxConfig = {"managed_persistence": True}
@ -20,8 +14,7 @@ def test_camofox_config_is_partial_typeddict():
def test_camofox_config_nested_in_browser_config():
"""_CamofoxConfig should be accepted in the camofox slot of _BrowserConfig."""
from hermes_cli.config import _CamofoxConfig, _BrowserConfig
from hermes_cli.config import _BrowserConfig
browser: _BrowserConfig = {
"inactivity_timeout": 60,
@ -33,10 +26,3 @@ def test_camofox_config_nested_in_browser_config():
}
assert browser["camofox"].get("managed_persistence") is False
def test_camofox_config_total_false_flag():
"""_CamofoxConfig.__total__ must be False (all fields optional)."""
from hermes_cli.config import _CamofoxConfig
assert _CamofoxConfig.__total__ is False