refactor(agent/conversation_compression): compact docstrings — summary line hugs its prose body (text unchanged)
This commit is contained in:
@@ -18,7 +18,6 @@ logger = logging.getLogger("run_agent")
|
||||
|
||||
def _timeout_fallback_prompt(agent, system_message: str) -> str:
|
||||
"""Cached prompt, else a fresh build, else the raw ``system_message`` (never raises).
|
||||
|
||||
Resolved lazily by the timeout wrapper: an eager rebuild would raise before compress_context runs when
|
||||
``_cached_system_prompt`` is unset and the builder fails."""
|
||||
if cached := getattr(agent, "_cached_system_prompt", None):
|
||||
@@ -93,7 +92,6 @@ def _warn_commit_overrun(agent, waited: float, ceiling: float) -> None:
|
||||
|
||||
def _sync_persisted_markers(target_messages, source_messages) -> None:
|
||||
"""Mirror ``_DB_PERSISTED_MARKER`` stamps from the worker's snapshot onto a live list.
|
||||
|
||||
Matched by scoped identity; timestamp-less repeated content is ambiguous, so every scoped match is
|
||||
stamped. Imported UNCONDITIONALLY: a silent fallback literal would split the stamping key from the flush's
|
||||
and resurrect the duplicate-row bug."""
|
||||
@@ -110,7 +108,6 @@ def _run_under_progress_timeout(
|
||||
agent, run, messages, system_message, *, active_fence, fence_registration_lock, idle_timeout, total_ceiling
|
||||
):
|
||||
"""Run ``run(fence, target_messages=snapshot)`` on the pool under the progress-aware timeout.
|
||||
|
||||
The pooled worker must NEVER share the caller's live transcript — a late engine after a host timeout could
|
||||
rewrite it. It deep-snapshots on the worker and publishes only via an ADMITTED commit; a no-op/abort
|
||||
returns the snapshot unchanged, so the ORIGINAL list is handed back to keep identity semantics."""
|
||||
@@ -165,7 +162,6 @@ def _mirror_result_onto_live_lists(agent, result, messages, *, direct_path: bool
|
||||
|
||||
def _rebind_caller_session_context(agent) -> None:
|
||||
"""Propagate a rotated session id to the CALLER's thread/ContextVar (idempotent otherwise).
|
||||
|
||||
The worker thread rotated hermes_logging's thread-local id; post-compression tools must resolve
|
||||
HERMES_SESSION_ID to the child id."""
|
||||
with contextlib.suppress(Exception):
|
||||
|
||||
Reference in New Issue
Block a user