refactor(agent/review_engine,side_question,thinking_timeout_guidance): reflow prompt literals to 118 cols (bytes identical)

This commit is contained in:
Teknium
2026-09-02 19:04:35 -07:00
parent c1ae5349ba
commit 2ccf295128
3 changed files with 24 additions and 32 deletions
+8 -12
View File
@@ -26,15 +26,12 @@ DEFAULT_CONTEXT_MESSAGES = 10
_MESSAGE_CHAR_CAP = 12_000
_REVIEW_GOAL = (
"Act as an independent senior reviewer. Thoroughly review the work "
"presented in the conversation excerpt provided in your context: "
"investigate any code, pull request, branch, commit, documentation, "
"design, or other artifact it references (open the PR, read the "
"diff, run the code or tests where feasible) rather than judging "
"from the excerpt alone. Produce a full, structured review: what "
"the work does, whether it is correct and complete, concrete "
"defects or risks found (with file/line references where possible), "
"what was verified vs. only read, and a clear final verdict with recommended next steps."
"Act as an independent senior reviewer. Thoroughly review the work presented in the conversation excerpt "
"provided in your context: investigate any code, pull request, branch, commit, documentation, design, or other "
"artifact it references (open the PR, read the diff, run the code or tests where feasible) rather than judging "
"from the excerpt alone. Produce a full, structured review: what the work does, whether it is correct and "
"complete, concrete defects or risks found (with file/line references where possible), what was verified vs. "
"only read, and a clear final verdict with recommended next steps."
)
@@ -123,9 +120,8 @@ def build_review_task(
) -> tuple:
"""Compose the reviewer subagent's (goal, context) pair."""
lines = [
"You were spawned by the /review command. The following is an "
"excerpt of the most recent conversation between the user and "
"their primary agent. It is your starting evidence — the work to "
"You were spawned by the /review command. The following is an excerpt of the most recent conversation "
"between the user and their primary agent. It is your starting evidence — the work to "
"review is referenced in it.",
"",
"--- Recent conversation (oldest first) ---",
+10 -13
View File
@@ -26,22 +26,19 @@ _PER_MESSAGE_CHAR_CAP = 2000
_TRANSCRIPT_CHAR_BUDGET = 24000
_FORK_PROMPT = (
"The user asked a quick SIDE question with /btw while the main work continues in the original session.\nRules:\n"
"- Answer ONLY the side question, using the conversation above as "
"context. Do not continue, redo, or critique the main task.\n"
"- Do NOT call any tools — they are disabled for this side question. Answer directly in text.\n"
"- If the conversation does not contain enough information to answer, say so plainly instead of guessing.\n"
"- Be concise and direct."
"The user asked a quick SIDE question with /btw while the main work continues in the original "
"session.\nRules:\n- Answer ONLY the side question, using the conversation above as context. Do not continue, "
"redo, or critique the main task.\n- Do NOT call any tools — they are disabled for this side question. Answer "
"directly in text.\n- If the conversation does not contain enough information to answer, say so plainly instead "
"of guessing.\n- Be concise and direct."
)
_ONESHOT_INSTRUCTIONS = (
"You are the same AI assistant that is currently working inside the "
"conversation transcribed below. The user has asked a quick SIDE question "
"with /btw while the main work continues.\nRules:\n"
"- Answer ONLY the side question. Do not continue, redo, or critique the main task.\n"
"- Use the transcript as your primary context; it is a snapshot and may not include the very latest activity.\n"
"- If the transcript does not contain enough information to answer, say so plainly instead of guessing.\n"
"- Be concise and direct."
"You are the same AI assistant that is currently working inside the conversation transcribed below. The user "
"has asked a quick SIDE question with /btw while the main work continues.\nRules:\n- Answer ONLY the side "
"question. Do not continue, redo, or critique the main task.\n- Use the transcript as your primary context; it "
"is a snapshot and may not include the very latest activity.\n- If the transcript does not contain enough "
"information to answer, say so plainly instead of guessing.\n- Be concise and direct."
)
_ROLE_LABELS = {"user": "USER", "assistant": "ASSISTANT", "tool": "TOOL RESULT"}
+6 -7
View File
@@ -42,14 +42,13 @@ def build_thinking_timeout_guidance(
the config snippet so it is copy-pasteable; ``model_label`` is the optional prose name."""
label = model_label or model
return (
"\n\nThe model's thinking phase exceeded the upstream proxy's "
"idle timeout before the first content token arrived. This is a "
"\n\nThe model's thinking phase exceeded the upstream proxy's idle timeout before the first content token "
"arrived. This is a "
f"known issue with reasoning models (like {label}) behind cloud "
"gateways (NVIDIA NIM, OpenAI, Anthropic, DeepSeek). Workarounds in priority order:\n"
f"1. Set `providers.{provider}.models.{model}.stale_timeout_seconds: 900` "
"in `~/.hermes/config.yaml` to extend the per-call timeout. "
"(Hermes's built-in floor is 600s for known reasoning models — "
"if you still see this after raising, the upstream cap is even shorter.)\n"
"2. Lower `reasoning_budget` or set `reasoning_effort: medium` on this model if the provider supports it.\n"
"3. Use a smaller / faster reasoning model if the task doesn't require deep thinking."
"in `~/.hermes/config.yaml` to extend the per-call timeout. (Hermes's built-in floor is 600s for known "
"reasoning models — if you still see this after raising, the upstream cap is even shorter.)\n2. Lower "
"`reasoning_budget` or set `reasoning_effort: medium` on this model if the provider supports it.\n3. Use a "
"smaller / faster reasoning model if the task doesn't require deep thinking."
)