Merge branch 'master' into franksong2702/viewport-scroll-anchor-6414
This commit is contained in:
commit
d482a12345
2 changed files with 13 additions and 5 deletions
|
|
@ -566,8 +566,11 @@ def _is_agent_compression_start_status(kind: str, message: str) -> bool:
|
||||||
auto-compression.
|
auto-compression.
|
||||||
|
|
||||||
Positive markers below match the agent emitters in hermes-agent
|
Positive markers below match the agent emitters in hermes-agent
|
||||||
(``turn_context`` preflight, ``conversation_loop`` pre-API / 413 / too-large,
|
(``conversation_loop`` pre-API / 413 / too-large,
|
||||||
``conversation_compression`` compaction status). Explicitly reject skip /
|
``conversation_compression`` compaction status). Preflight compression
|
||||||
|
(``turn_context``) is intentionally excluded — the later authoritative
|
||||||
|
``Compacting context`` marker is the signal that compression actually
|
||||||
|
proceeded. Explicitly reject skip /
|
||||||
defer notices so "Skipping preflight compression…" never surfaces as a
|
defer notices so "Skipping preflight compression…" never surfaces as a
|
||||||
running compress divider.
|
running compress divider.
|
||||||
"""
|
"""
|
||||||
|
|
@ -587,8 +590,7 @@ def _is_agent_compression_start_status(kind: str, message: str) -> bool:
|
||||||
if 'compressed' in m and 'compressing' not in m and 'compression attempt' not in m:
|
if 'compressed' in m and 'compressing' not in m and 'compression attempt' not in m:
|
||||||
return False
|
return False
|
||||||
return (
|
return (
|
||||||
'preflight compression:' in m
|
'pre-api compression:' in m
|
||||||
or 'pre-api compression:' in m
|
|
||||||
or 'compacting context' in m
|
or 'compacting context' in m
|
||||||
or 'context too large' in m
|
or 'context too large' in m
|
||||||
or '— compressing (' in m
|
or '— compressing (' in m
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,13 @@ def test_agent_status_callback_emits_compressing_and_warning_events():
|
||||||
|
|
||||||
def test_agent_compression_start_status_matches_real_emitters_only():
|
def test_agent_compression_start_status_matches_real_emitters_only():
|
||||||
# Real start notices from hermes-agent emitters
|
# Real start notices from hermes-agent emitters
|
||||||
assert _is_agent_compression_start_status(
|
# Preflight compression is intentionally excluded — the later
|
||||||
|
# authoritative ``Compacting context`` marker from
|
||||||
|
# conversation_compression is the signal that compression
|
||||||
|
# actually proceeded, and the preflight status can fire even
|
||||||
|
# when compression exits before compaction (e.g. durable
|
||||||
|
# guard refresh, Codex-Hermes mode with no active thread).
|
||||||
|
assert not _is_agent_compression_start_status(
|
||||||
"lifecycle",
|
"lifecycle",
|
||||||
"📦 Preflight compression: ~101,000 tokens >= 96,000 threshold. This may take a moment.",
|
"📦 Preflight compression: ~101,000 tokens >= 96,000 threshold. This may take a moment.",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue