HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
aider: an answer line that starts with a shell's name is kept, not read as a fence (#488)
Rudy Mizrahi Celekli8fbe3cde0b76
diff --git a/runner/aider_driver.py b/runner/aider_driver.pyindex 59ab13d6..a9cbabea 100644--- a/runner/aider_driver.py+++ b/runner/aider_driver.py@@ -78,7 +78,9 @@ def _strip_shell_blocks(text: str) -> str:out, lines, i = [], (text or "").splitlines(), 0while i < len(lines):line = lines[i]- opener = "```" + line.strip().lstrip("`") # a fence of any length, read as three+ # a fence of any length, read as three; a line that does not start with one is prose, even+ # when it starts with a shell's name ("bash build.sh" in an answer is not a block)+ opener = ("```" + line.strip().lstrip("`")) if line.strip().startswith("```") else ""if opener.strip() in _SHELL_FENCES or any(opener.startswith(f + " ") for f in _SHELL_FENCES):i += 1while i < len(lines) and not lines[i].strip().startswith("```"):diff --git a/runner/tests/test_aider_driver.py b/runner/tests/test_aider_driver.pyindex 3c89775d..82614bc2 100644--- a/runner/tests/test_aider_driver.py+++ b/runner/tests/test_aider_driver.py@@ -933,3 +933,14 @@ def test_the_models_reasoning_is_not_rendered_as_its_answer():assert texts == ["M1-grok-4.20"], textsassert "THINKING" not in texts[0]++def test_a_prose_line_that_starts_with_a_shells_name_is_kept():+ """Every line was read as if a fence opened it, so an answer line such as "bash build.sh" or a+ lone "sh" opened a shell block and everything after it, usually the rest of the answer, was+ cut from the reply."""+ for text in ("I created build.sh. Run it with:\nbash build.sh\nIt writes report.pdf.",+ "Which shell do you use? I recommend\nbash\nbecause it is everywhere.",+ "Two options:\nsh run.sh\nzsh run.sh\nEither works."):+ assert aider_driver.strip_edit_blocks(text) == text+ # a real fence is still a block, prose around it kept+ assert aider_driver.strip_edit_blocks("Run:\nbash build.sh\n```bash\nls\n```\nDone.") == "Run:\nbash build.sh\nDone."