mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(compress): type-pin the lock-skip signal check at every consumer
The bare truthiness test on _compression_skipped_due_to_lock is fooled by MagicMock auto-attributes on test-double agents (skill pitfall: MagicMock defeats hasattr/truthiness duck-typing) — the type-ahead CLI test's MagicMock agent took the lock-skip branch and skipped the transcript commit. Real values are None/True/holder-string; pin the check to 'is True or isinstance(str)' at all three consumer sites.
This commit is contained in:
parent
eb7be2edde
commit
4cb85fb7fc
3 changed files with 12 additions and 3 deletions
9
cli.py
9
cli.py
|
|
@ -10183,7 +10183,14 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin, CLIBillingMixin):
|
|||
# "No changes from compression" no-op text. The wording
|
||||
# distinguishes a confirmed holder from an unconfirmed
|
||||
# acquisition failure (describe_compression_lock_skip).
|
||||
if getattr(self.agent, "_compression_skipped_due_to_lock", None):
|
||||
# Type-pinned check (is True / str): the flag's only real
|
||||
# values are None/True/holder-string, and a bare getattr
|
||||
# truthiness test is fooled by MagicMock auto-attributes on
|
||||
# test-double agents (skill pitfall: MagicMock vs hasattr).
|
||||
_lock_skip_signal = getattr(
|
||||
self.agent, "_compression_skipped_due_to_lock", None
|
||||
)
|
||||
if _lock_skip_signal is True or isinstance(_lock_skip_signal, str):
|
||||
from agent.manual_compression_feedback import (
|
||||
describe_compression_lock_skip,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue