Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/autoresearch/role_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ def build_harness(
the ephemeral boundary (CI). The tokenless split keeps credentials out of
the session either way."""
if backend == "codex":
# the web: codex's native web_search tool, on when the spec grants it
web = ("--search",) if "WebSearch" in spec.tools else ()
# the web, when the spec grants it: the config override, because
# `codex exec` does not accept `--search`
web = ("-c", "tools.web_search=true") if "WebSearch" in spec.tools else ()
return CodexHarness(
api_key=api_key,
binary=binary or "codex",
Expand Down
7 changes: 6 additions & 1 deletion tests/test_attempt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,12 @@ def test_editor_harness_codex_backend_is_contained() -> None:
assert harness.model == "gpt-5.6-terra"
assert harness.timeout_s == 300
# host codex config, then the web (the author spec grants WebSearch)
assert harness.extra_args == ("-c", "use_legacy_landlock=true", "--search")
assert harness.extra_args == (
"-c",
"use_legacy_landlock=true",
"-c",
"tools.web_search=true",
)
assert harness.supports_resume is True # codex exec resume, validated on 0.130.0
with pytest.raises(ValueError, match="unknown backend"):
build_harness("sk-o", spec, backend="bogus", container_image="img.sif")
Expand Down
5 changes: 4 additions & 1 deletion tests/test_role_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ def test_build_harness_codex_is_uniform_for_all_roles() -> None:
assert isinstance(judge, CodexHarness) and isinstance(editor, CodexHarness)
assert judge.sandbox == editor.sandbox == "danger-full-access"
assert judge.container_image == "" and editor.container_image == "img.sif"
assert "--search" in judge.extra_args and "--search" in editor.extra_args # the web
# the web: the exec-compatible config override, never `--search` (which
# `codex exec` rejects — it killed every fleet attempt on 2026-08-29)
for h in (judge, editor):
assert "tools.web_search=true" in h.extra_args and "--search" not in h.extra_args


def test_build_harness_hermes_toolsets_follow_the_spec(tmp_path: Path) -> None:
Expand Down
Loading