Skip to content

Commit d3e39f4

Browse files
AbirAbbasclaude
andcommitted
fix: add Write tool to all schema-constrained harness calls
The harness instructs subprocesses to write structured JSON output to .agentfield_output.json using the Write tool, but 15 of 21 agents had tools lists that didn't include "Write". This caused all schema-constrained agents to fail silently — the subprocess couldn't create the output file. Discovered during manual integration testing of the harness migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 59a8a42 commit d3e39f4

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

swe_af/execution/_replanner_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def invoke_replanner(
4848
provider=provider,
4949
model=config.replan_model,
5050
max_turns=DEFAULT_AGENT_MAX_TURNS,
51-
tools=["Read", "Glob", "Grep", "Bash"],
51+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
5252
permission_mode=None,
5353
system_prompt=SYSTEM_PROMPT,
5454
cwd=dag_state.repo_path or ".",

swe_af/reasoners/execution_agents.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async def run_retry_advisor(
158158
schema=RetryAdvice,
159159
model=model,
160160
provider=provider,
161-
tools=["Read", "Glob", "Grep", "Bash"],
161+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
162162
cwd=repo_path,
163163
max_turns=DEFAULT_AGENT_MAX_TURNS,
164164
permission_mode=permission_mode or None,
@@ -238,7 +238,7 @@ async def run_issue_advisor(
238238
schema=IssueAdvisorDecision,
239239
model=model,
240240
provider=provider,
241-
tools=["Read", "Glob", "Grep", "Bash"],
241+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
242242
cwd=cwd,
243243
max_turns=DEFAULT_AGENT_MAX_TURNS,
244244
permission_mode=permission_mode or None,
@@ -317,7 +317,7 @@ async def run_replanner(
317317
schema=ReplanDecision,
318318
model=replan_model,
319319
provider=provider,
320-
tools=["Read", "Glob", "Grep", "Bash"],
320+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
321321
cwd=state.repo_path or ".",
322322
max_turns=DEFAULT_AGENT_MAX_TURNS,
323323
permission_mode=permission_mode or None,
@@ -492,7 +492,7 @@ async def run_verifier(
492492
schema=VerificationResult,
493493
model=model,
494494
provider=provider,
495-
tools=["Read", "Glob", "Grep", "Bash"],
495+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
496496
cwd=repo_path,
497497
max_turns=DEFAULT_AGENT_MAX_TURNS,
498498
permission_mode=permission_mode or None,
@@ -574,7 +574,7 @@ async def run_git_init(
574574
schema=GitInitResult,
575575
model=model,
576576
provider=provider,
577-
tools=["Bash"],
577+
tools=["Bash", "Write"],
578578
cwd=repo_path,
579579
max_turns=DEFAULT_AGENT_MAX_TURNS,
580580
permission_mode=permission_mode or None,
@@ -647,7 +647,7 @@ class WorkspaceSetupResult(BaseModel):
647647
schema=WorkspaceSetupResult,
648648
model=model,
649649
provider=provider,
650-
tools=["Bash"],
650+
tools=["Bash", "Write"],
651651
cwd=repo_path,
652652
max_turns=DEFAULT_AGENT_MAX_TURNS,
653653
permission_mode=permission_mode or None,
@@ -709,7 +709,7 @@ async def run_merger(
709709
schema=MergeResult,
710710
model=model,
711711
provider=provider,
712-
tools=["Bash", "Read", "Glob", "Grep"],
712+
tools=["Bash", "Read", "Write", "Glob", "Grep"],
713713
cwd=repo_path,
714714
max_turns=DEFAULT_AGENT_MAX_TURNS,
715715
permission_mode=permission_mode or None,
@@ -848,7 +848,7 @@ class WorkspaceCleanupResult(BaseModel):
848848
schema=WorkspaceCleanupResult,
849849
model=model,
850850
provider=provider,
851-
tools=["Bash"],
851+
tools=["Bash", "Write"],
852852
cwd=repo_path,
853853
max_turns=DEFAULT_AGENT_MAX_TURNS,
854854
permission_mode=permission_mode or None,
@@ -1073,7 +1073,7 @@ async def run_code_reviewer(
10731073
schema=CodeReviewResult,
10741074
model=model,
10751075
provider=provider,
1076-
tools=["Read", "Glob", "Grep", "Bash"],
1076+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
10771077
cwd=worktree_path,
10781078
max_turns=DEFAULT_AGENT_MAX_TURNS,
10791079
permission_mode=permission_mode or None,
@@ -1251,7 +1251,7 @@ class FixGeneratorOutput(BaseModel):
12511251
schema=FixGeneratorOutput,
12521252
model=model,
12531253
provider=provider,
1254-
tools=["Read", "Glob", "Grep", "Bash"],
1254+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
12551255
cwd=repo_path,
12561256
max_turns=DEFAULT_AGENT_MAX_TURNS,
12571257
permission_mode=permission_mode or None,
@@ -1315,7 +1315,7 @@ async def run_repo_finalize(
13151315
schema=RepoFinalizeResult,
13161316
model=model,
13171317
provider=provider,
1318-
tools=["Bash", "Read", "Glob", "Grep"],
1318+
tools=["Bash", "Read", "Write", "Glob", "Grep"],
13191319
cwd=repo_path,
13201320
max_turns=DEFAULT_AGENT_MAX_TURNS,
13211321
permission_mode=permission_mode or None,
@@ -1386,7 +1386,7 @@ async def run_github_pr(
13861386
schema=GitHubPRResult,
13871387
model=model,
13881388
provider=provider,
1389-
tools=["Bash"],
1389+
tools=["Bash", "Write"],
13901390
cwd=repo_path,
13911391
max_turns=DEFAULT_AGENT_MAX_TURNS,
13921392
permission_mode=permission_mode or None,

swe_af/reasoners/pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async def run_product_manager(
197197
provider=provider,
198198
model=model,
199199
max_turns=max_turns,
200-
tools=["Read", "Glob", "Grep", "Bash"],
200+
tools=["Read", "Write", "Glob", "Grep", "Bash"],
201201
permission_mode=permission_mode or None,
202202
system_prompt=system_prompt,
203203
cwd=repo_path,
@@ -310,7 +310,7 @@ async def run_tech_lead(
310310
provider=provider,
311311
model=model,
312312
max_turns=max_turns,
313-
tools=["Read", "Glob", "Grep"],
313+
tools=["Read", "Write", "Glob", "Grep"],
314314
permission_mode=permission_mode or None,
315315
system_prompt=system_prompt,
316316
cwd=repo_path,
@@ -386,7 +386,7 @@ class SprintPlanOutput(BaseModel):
386386
provider=provider,
387387
model=model,
388388
max_turns=max_turns,
389-
tools=["Read", "Glob", "Grep"],
389+
tools=["Read", "Write", "Glob", "Grep"],
390390
permission_mode=permission_mode or None,
391391
system_prompt=system_prompt,
392392
cwd=repo_path,

0 commit comments

Comments
 (0)