chore: trim verbose comments/docstrings, add AUTHOR_MAP entry

- Replace 18-line comment block with 3-line invariant statement
- Trim test docstrings from multi-paragraph to single-line summaries
- Trim assertion messages from 4-line to 2-line mismatch reports
- Replace 5-line WHAT comments in stubs with 1-line WHY comments
- Add ziliangdotme@gmail.com -> ziliangpeng to AUTHOR_MAP
This commit is contained in:
alt-glitch
2026-05-21 07:17:06 +00:00
committed by Siddharth Balyan
parent c3a09f7835
commit 87d9239009
4 changed files with 16 additions and 80 deletions

View File

@@ -390,24 +390,9 @@ def _run_review_in_thread(
# parent below so memory(action="add") writes from
# the review still land on disk; the review just
# has zero side effects on external providers.
# Inherit the parent's toolset configuration so the review
# fork's outbound request body has byte-identical ``tools[]``
# with the parent's last main-turn request. Without this,
# ``enabled_toolsets=None`` defaults to "all registered tools"
# and the fork transmits every tool descriptor (including any
# the user has disabled via ``hermes tools disable``), while
# the parent transmits only its narrower configured set —
# making the two requests diverge in ``tools[]`` even though
# they share ``messages[0..N]`` and ``system`` byte-for-byte.
# Anthropic's prompt-cache key includes ``tools[]``, so any
# divergence forks the cache lineage and forces a full
# prefix rewrite (~100-200K tokens per turn for long convs).
# The post-construction whitelist (``set_thread_tool_whitelist``
# below) still restricts which tools the model is allowed
# to dispatch — this change only aligns what the request
# body transmits, not what the review is allowed to do.
# This extends the byte-stability invariant established by
# PR #17276 (which fixed ``system``) to ``tools[]``.
# Match parent's toolset config so ``tools[]`` is byte-identical
# in the request body — Anthropic's cache key includes it.
# (The runtime whitelist below still restricts dispatch.)
review_agent = AIAgent(
model=agent.model,
max_iterations=16,