mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 17:55:26 -04:00
fix: drop thinking deltas from background agent loops
Skip thinking-only deltas when accumulating background, scheduled-task, and teacher captured reply text.
This commit is contained in:
@@ -55,6 +55,8 @@ async def _drain_agent(sess, messages):
|
|||||||
if "delta" in d:
|
if "delta" in d:
|
||||||
delta = d.get("delta")
|
delta = d.get("delta")
|
||||||
if isinstance(delta, str):
|
if isinstance(delta, str):
|
||||||
|
if d.get("thinking"):
|
||||||
|
continue
|
||||||
full += delta
|
full += delta
|
||||||
elif d.get("type") == "agent_step":
|
elif d.get("type") == "agent_step":
|
||||||
round_num = d.get("round", round_num)
|
round_num = d.get("round", round_num)
|
||||||
|
|||||||
@@ -1649,6 +1649,8 @@ class TaskScheduler:
|
|||||||
data = json.loads(event_str[6:])
|
data = json.loads(event_str[6:])
|
||||||
# Capture text from all event types, not just delta
|
# Capture text from all event types, not just delta
|
||||||
if "delta" in data:
|
if "delta" in data:
|
||||||
|
if data.get("thinking"):
|
||||||
|
continue
|
||||||
full_text += data["delta"]
|
full_text += data["delta"]
|
||||||
elif data.get("type") == "tool_output":
|
elif data.get("type") == "tool_output":
|
||||||
# Tool results — capture summary so we have SOMETHING even
|
# Tool results — capture summary so we have SOMETHING even
|
||||||
|
|||||||
@@ -594,6 +594,8 @@ async def run_teacher_inline(
|
|||||||
"exit_code": payload.get("exit_code"),
|
"exit_code": payload.get("exit_code"),
|
||||||
})
|
})
|
||||||
if "delta" in payload and isinstance(payload["delta"], str):
|
if "delta" in payload and isinstance(payload["delta"], str):
|
||||||
|
if payload.get("thinking"):
|
||||||
|
continue
|
||||||
captured_text_parts.append(payload["delta"])
|
captured_text_parts.append(payload["delta"])
|
||||||
yield 'data: ' + json.dumps(payload) + '\n\n'
|
yield 'data: ' + json.dumps(payload) + '\n\n'
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[1]
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
DOC_JS = (ROOT / "static/js/document.js").read_text()
|
DOC_JS = (ROOT / "static/js/document.js").read_text(encoding="utf-8")
|
||||||
STYLE_CSS = (ROOT / "static/style.css").read_text()
|
STYLE_CSS = (ROOT / "static/style.css").read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
def test_document_textarea_scrollbar_is_visible():
|
def test_document_textarea_scrollbar_is_visible():
|
||||||
|
|||||||
Reference in New Issue
Block a user