Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix: accept CRLF in UltraWiki answer protocol

Ruben Lütke33a2aa2bf294
diff --git a/jarvis/ultrawiki/answer.py b/jarvis/ultrawiki/answer.py
index 20a62c8a26..e692f81d98 100644
--- a/jarvis/ultrawiki/answer.py
+++ b/jarvis/ultrawiki/answer.py
@@ -117,7 +117,9 @@ def _parse_provider_answer(
text: str, evidence_count: int
) -> tuple[str, Literal["answered", "insufficient_evidence"], tuple[int, ...]]:
"""Validate and remove the model-facing insufficiency protocol marker."""
- normalized = _normalize_citations(text.strip())
+ normalized = _normalize_citations(
+ text.strip().replace("\r\n", "\n").replace("\r", "\n")
+ )
first_line, separator, remainder = normalized.partition("\n")
if first_line == _INSUFFICIENT_PREFIX:
explanation = remainder.strip() if separator else ""
diff --git a/tests/unit/ultrawiki/test_answer.py b/tests/unit/ultrawiki/test_answer.py
index e1db29f32d..8872a79ec9 100644
--- a/tests/unit/ultrawiki/test_answer.py
+++ b/tests/unit/ultrawiki/test_answer.py
@@ -133,7 +133,7 @@ async def test_answer_marks_insufficient_evidence_without_false_citations(
async def fake_complete(**kwargs):
aggregated = SimpleNamespace(
text=(
- "[[ULTRAWIKI_INSUFFICIENT]]\n"
+ "[[ULTRAWIKI_INSUFFICIENT]]\r\n"
"The evidence does not contain the ferry schedule."
)
)