Skip to content

fix: swarm JSON fences, RSS Windows paths, debate role prompts (reimpl of #1073) - #1094

Merged
AmitoVrito merged 4 commits into
mainfrom
fix/agent-logic-bugs
Nov 4, 2026
Merged

AmitoVrito merged 4 commits into
mainfrom
fix/agent-logic-bugs

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Reimplements the salvageable fixes from #1073 (closed) on current main, with regression tests and the stale/duplicate/scratch content dropped.

Changes

  • fix(swarm): strip Markdown code fences before json.loads in _score_complexity/_decompose (shared _strip_code_fence helper) so fenced LLM JSON no longer breaks scoring/decomposition.
  • fix(rss): treat a Windows drive-letter path (C:\feeds.xml) as a local file in the SSRF guard, via an explicit ^[A-Za-z]:[\\/] match rather than blanking all single-character schemes; file:///ftp:///internal HTTP stay rejected or validated.
  • feat(debate): prefix every turn's prompt with You are {name}, acting as: {role}.

Why not merge #1073 directly

It was 61 commits behind main and would have regressed it: reverting #1067's llm: BaseLLM typing back to Any, deleting #1072's amnesia regression test, and re-adding committed scratch files (fake_audit.jsonl, scratch.py, ...). The two genuinely-new fixes shipped without tests. See the closing comment on #1073.

Testing

  • New mock-free regression tests for all three (real BaseLLM fakes; _validate SSRF cases). 31 targeted tests pass; full agents+loaders suite green (1433 passed).
  • ruff, ruff-format, mypy, async-blocking gate all clean.

Co-authored-by: Ashish Maurya [email protected]

AmitoVrito and others added 4 commits November 4, 2026 16:06
_score_complexity and _decompose ran json.loads on the raw LLM response, so a
model wrapping output in ```json ... ``` raised JSONDecodeError — scoring fell
back to 0.5 and decomposition collapsed the task into one subtask. A shared
_strip_code_fence helper now removes a surrounding fence before parsing.
Regression tests use a real BaseLLM fake.

Co-authored-by: Ashish Maurya <[email protected]>
A local path like C:\feeds.xml parses with a single-letter urlparse "scheme"
(the drive letter), so _validate rejected it as a disallowed URL scheme. It now
matches a drive-letter path explicitly (^[A-Za-z]:[\\/]) and treats it as a
local file, instead of blanking all single-character schemes (which would have
broadened the guard). file://, ftp:// and internal HTTP targets stay rejected
or validated. Regression tests cover both.

Co-authored-by: Ashish Maurya <[email protected]>
Each opening/rebuttal/defense/judge prompt is now prefixed with
"You are {name}, acting as: {role}.", so a debater's persona reaches the model
on every turn (the executors' ReActAgent wipes its scratchpad between turns).
Complements the transcript re-injection already in #1072.

Co-authored-by: Ashish Maurya <[email protected]>
@AmitoVrito
AmitoVrito merged commit 8873259 into main Nov 4, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant