Source-linked AI summary
TreeFlex: Agents Navigating Their Own Search Trees
Dongzhuo Li, Fangzhou Cheng, Weiwei Li, Kevin Han, Haixu Ma, Zhongchang Sun, Ruiyi Li, Serena Li, Xiangjun Fan, Lizhu Zhang, Yuandong Tian
TL;DR
Long-horizon agents can accumulate off-path history in a single context, while tree-search approaches still need a way to decide which branch to pursue. TreeFlex lets one model choose saved states and act from restored paths, training these roles jointly; it reports higher task success than the compared baselines in deep research and SWE.
Problem
Long-horizon agents may carry abandoned attempts and off-path observations in one linear context, while a tree alone does not determine which branch to work on next.
Source: §1 · pp. 1–2Method
TreeFlex saves intermediate states as tree nodes and trains one model to select a node and instruction in Reflection, then act from the restored path in Execution.
Source: §1 · p. 2, §2.2 · p. 4Results
TreeFlex reports higher task success than the compared baselines in deep research and SWE; on SWE it resolves 54.9% of tasks versus 43.3% for FoldAgent and 45.2% for its step-wise variant.
Source: §1 · p. 3Takeaways & Limitations
Across the two evaluated domains, TreeFlex solves more tasks than baselines trained from the same starting model.
Source: §7 · p. 12The experiments are small in scale, each training configuration is run once, and TreeFlex uses more inference-time computation while its sequential segments add latency.
Source: §6 · p. 12
Abstract
from arXiv · showhide
A ReAct-style agent accumulates observations, intermediate results, and failed attempts in a single context. As this context grows, stale and off-path information consumes its limited capacity and obscures relevant evidence, making focused reasoning increasingly difficult. We introduce TreeFlex, a framework in which the agent's own policy decides where to search. The agent records each intermediate state, with a short summary, as a node in a search tree maintained by the harness. The policy is a single language model that acts in two roles. In the Reflection role, it has a global view of the tree through these summaries and picks a node to resume, together with an instruction. In the Execution role, the harness restores the path that led to that node, and the model carries out the instruction with the usual task tools until it saves a new node or proposes a solution, which Reflection then approves or sends back to another node. Through these choices, the policy decides whether to deepen the current line, branch from or revisit an earlier state, verify a proposal, or stop, without a fixed traversal order or a score for each node. We train navigation, task actions, checkpointing, and proposal review jointly with a tree-aware adaptation of GRPO, using task-level outcome rewards augmented by process rewards. After small-scale RL of a 4B model, with the same active-context limit for all methods, TreeFlex reaches 48.8% accuracy on a challenging deep-research benchmark, versus 41.5% for flat ReAct and 42.8% for FoldAgent, and its Pass@8 is about ten points higher than either. On SWE-bench Verified, with all three systems trained with RL from the same 9B model, TreeFlex resolves 54.9% of tasks, versus 43.3% for FoldAgent and 45.2% for its step-wise variant.
1 Introduction
TreeFlex addresses the limits of a single linear context by letting the model choose which saved state to resume and what to do there. It trains these search decisions alongside task actions, and reports higher task success than the compared baselines in deep research and SWE.
1 Introduction
- TreeFlex keeps intermediate states available for revisiting, avoiding the permanent loss of information that can result from compressing a long history.A linear ReAct context carries abandoned attempts and off-path observations into later calls, while undoing an attempt may also require undoing its environmental effects.Source: §1 · p. 1
- Existing tree-search methods leave branch selection to a fixed controller or isolated node scores, while useful decisions often pair a node with a plan for what to do there.The paper asks whether the task-performing model can make that choice using what the search has found so far.Source: §1 · pp. 1–2
- TreeFlex saves intermediate states as tree nodes and uses one model in Reflection to select a node and instruction, then in Execution to act along the restored path.Reflection approves or rejects proposed solutions; a rejected proposal can lead the search back to a selected node.Source: §1 · p. 2
- Each Execution segment sees one path rather than every explored branch, while Reflection’s record grows by only one short card per node.Saved nodes also preserve environment state, allowing the agent to deepen a line, branch, revisit earlier work, or verify a proposal.Source: §1 · p. 2, Figure 1 · p. 2
- TreeFlex adapts GRPO by treating each complete search as one rollout and training every model output on the exact context from which it was generated.Task rewards are combined with process penalties on the actions that caused them.Source: §1 · pp. 2–3
- 48.8% accuracy versus 41.5% for flat ReAct and 42.8% for FoldAgent on BrowseComp-Plus; on SWE, TreeFlex resolves 54.9% of tasks versus 43.3% for FoldAgent and 45.2% for its step-wise variant.On BrowseComp-Plus, TreeFlex also reaches 66.0% Pass@8, versus 56.0% for flat ReAct and 55.3% for FoldAgent.Source: §1 · p. 3
2 TreeFlex
TreeFlex stores each segment of work as a resumable node, separates global search decisions from path-specific execution, and adapts GRPO to train the resulting multi-context search.
2.1 Agent Design
- Each non-root node records a segment started from a parent node and stores the information needed to resume that work.A node is saved at the end of an Execution segment, by checkpoint or commit; its stored state includes a model-authored card, context state, and environment state such as a repository snapshot.Source: §2.1 · p. 3
- Reflection sees the task and a global record of node identifiers, parents, and cards, while Execution sees the restored path, selected node’s environment state, and new instruction.Deep research restores cards along the path; SWE restores raw context because error traces and diffs are difficult to summarize faithfully.Source: §2.1 · p. 3
- Execution does the work and proposes solutions using detailed evidence from one path; Reflection chooses where to work and checks proposals using cards from all branches.Reflection cannot edit a proposal because it lacks the raw evidence.Source: §2.1 · p. 3
- Deep research uses commit with an answer and explanation, whereas SWE exposes OpenHands’ finish(message) to propose the current repository state..Source: Table 1 · p. 4
Search procedure.
- Resuming the latest node deepens a line, an earlier node starts a sibling branch, and the root starts a new line, letting Reflection vary search order without a fixed rule.Segments run one at a time, without parallel model calls.Source: Search procedure · p. 4
2.2 RL Training
- Each complete search is one rollout and one GRPO group member; its task reward applies across its outputs, while a process penalty applies only to the turn it concerns.Each output is trained on the exact context from which it was generated, and the loss applies only to newly generated tokens.Source: §2.2 · p. 4
- The loss mask trains each instruction in Reflection and each card in its Execution segment, not when the other role later reads it.The search receives a terminal task reward, with process penalties for specified failures or out-of-scope work; there is no separate reward for checkpointing, node choice, or tree shape.Source: §2.2 · pp. 4–5
- Rollout mean gives each rollout equal total weight regardless of length or block count, while a role mean can balance Reflection against Execution’s larger token volume.TreeFlex uses rollout mean with λ = 0 in both domains.Source: §2.2 · p. 6
3 Experimental Setup
The experiments evaluate deep research and agentic software engineering using task-specific datasets and comparison protocols. Methods are compared under matched active-context limits, with separate training and evaluation procedures for each domain.
3.1 Tasks and Datasets
- BrowseComp-Plus uses 680 training and 150 test questions, with 64 training questions held out for validation and 616 remaining for training.Its compositional questions require finding and synthesizing evidence across documents in a frozen corpus.Source: §3.1 · p. 6
- The SWE setup draws 600 Python repository tasks across ten repositories, split into 500 training and 100 validation tasks; evaluation uses all 500 SWE-bench Verified tasks.FoldAgent trains on 217 mixed-outcome tasks, while TreeFlex trains on 250 tasks where either method had mixed outcomes.Source: §3.1 · pp. 6–7
3.2 Comparison Protocol
- FoldAgent and TreeFlex comparisons use a 32,768-token active-context limit, with at most ten branches for FoldAgent and ten navigations for TreeFlex.Each method retains its own context layout, prompts, state management, and tool interfaces.Source: §3.2 · p. 7
- BrowseComp-Plus compares flat ReAct, FoldAgent, and TreeFlex with the same base model, retriever, and retrieval limits, including training all three from the 4B model.The study also evaluates released 4B and 30B models without task-specific RL.Source: §3.2 · p. 7
- SWE-bench Verified compares FoldAgent and TreeFlex trained from the same Qwen3.5-9B model, matching repository images, evaluation limits, sampling parameters, and grader.Both train for 25 steps with 32 tasks per step and eight rollouts per task; TreeFlex permits at most two children per node, and three test rollouts are graded per task.Source: §3.2 · p. 7
4 Results
TreeFlex leads the reported deep-research and SWE comparisons, while experiments show that repeated flat sampling does not close the deep-research gap. Ablations also find that performance depends on the training objective and that branching behavior alone does not predict accuracy.
4.1 Deep Research
- After RL, TreeFlex reaches 48.8% Mean@8 and 66.0% Pass@8, significantly outperforming flat ReAct by 7.3 and 10.0 points and FoldAgent by 6.0 and 10.7 points, respectively.Table 2 aggregates eight samples for each of 150 questions under matched context limits.Source: §4.1 · p. 7, Table 2 · p. 8
- At eight samples, TreeFlex reaches 66.0% Pass@8 versus flat ReAct’s 56.0% and FoldAgent’s 55.3%; repeated flat sampling also reads only 34% of annotated evidence documents.TreeFlex solves 20 questions missed by all eight flat ReAct samples, while flat ReAct solves only five missed by all eight TreeFlex samples.Source: §4.1 · p. 8, Figure 3 · p. 9
- 13.4% hard-question accuracy for TreeFlex exceeds flat ReAct’s 3.9% and FoldAgent’s 8.4%; on easy questions, the corresponding values are 92.7%, 90.5%, and 85.1%.The reported improvements over flat ReAct are concentrated on harder questions; Figure 4 shows TreeFlex leading in every difficulty bin.Source: §4.1 · p. 8, Figure 4 · p. 10
4.2 Agentic SWE
- 54.9% of SWE-bench Verified tasks are resolved by TreeFlex after RL, 11.6 points above FoldAgent and 9.7 points above its step-wise variant.Table 3 reports three rollouts for each of 500 tasks under a 32k active-context limit.Source: §4.2 · p. 9, Table 3 · p. 10
4.3 Training Objective Ablations
- 48.8% Mean@8 is the highest result among seven objective variants, all of which outperform flat ReAct at 41.5% and FoldAgent at 42.8%.Each variant is a single training run, so the reported differences are observations about those runs, not established effects of the settings.Source: §4.3 · p. 10
- Branching patterns vary widely across loss aggregations, but their test accuracies finish within 2.1 points, so branching frequency and location do not predict accuracy.The token mean branches and returns to the root more often; the block mean forks more often below the root.Source: §4.3 · p. 10, Table 4 · p. 11
- The role weight and finalization penalty show no consistent accuracy pattern, and the penalty lowers token-mean accuracy at both tested role weights.Each ablation variant is a single training run, so these comparisons are observations rather than established effects.Source: §4.3 · p. 10
- 54.9% resolve rate follows from the rollout-mean objective on SWE, while the token mean reaches 52.1%, close to the base model’s 51.1%.The two RL runs use the same data, λ = 0, and checkpoint-selection procedure.Source: §4.3 · p. 10
5 Related Work
Prior agents generally follow linear histories or fixed search procedures; TreeFlex instead lets its policy choose among saved states and resume work there.
Reasoning and acting
- ReAct and Reflexion keep a single linear history, whereas TreeFlex saves intermediate states in a tree that the policy can revisit.ReAct interleaves reasoning with environment actions [Yao et al., 2023b], while Reflexion adds persistent verbal feedback across attempts [Shinn et al., 2023].Source: §5 · p. 11
Tree search with learned models
- TreeFlex differs from fixed-procedure language-model tree search by letting its own policy choose which saved node to resume and what to do there.Prior approaches include breadth- or depth-first search, MCTS, and user-specified operation graphs.Source: §5 · p. 11
- Unlike serialized search-trace methods, which rewrite earlier nodes when revisiting them, TreeFlex restores saved context and environment state.Stream of Search, Searchformer, Dualformer, and ASTRO serialize search traces [Gandhi et al., 2024; Lehnert et al., 2024; Su et al., 2025; Kim et al., 2025].Source: §5 · p. 11
Learning information-seeking behavior
- Search-R1, R1-Searcher, DeepResearcher, WebDancer, and WebSailor train information-seeking behavior over one linear trajectory.These systems train language models to search or fine-tune ReAct-style agents before RL [Jin et al., 2025; Song et al., 2025; Zheng et al., 2025; Wu et al., 2025; Li et al., 2025].Source: §5 · pp. 11–12
Policy optimization over trees
- Tree-GRPO uses tree-structured rollouts for credit assignment but still trains an agent that acts along one trajectory; TreeFlex makes the tree its own search.Each complete TreeFlex search is one GRPO sample [Shao et al., 2024].Source: §5 · p. 12
Learned context management
- Learned context-management methods compress or discard prior work, but retain only the current working history, so discarded work cannot be resumed.Examples include Accordion-Thinking, MEM1, MemPO, AgentFold, LongSeeker, and FoldAgent [Yang et al., 2026; Zhou et al., 2026; Li et al., 2026; Lu et al., 2026].Source: §5 · p. 12
SWE agents
- In software engineering, SWE-Search uses hand-designed node selection and prompted-model scoring, while TreeFlex’s trained policy chooses the repository state to resume.SWE-Search searches repository states in a git-like commit tree [Antoniades et al., 2025].Source: §5 · p. 12
6 Limitations and Future Work
The experiments are small and compare complete systems that differ in prompts and tool interfaces, while TreeFlex also uses more inference-time computation and adds latency. The authors identify larger-scale training and efficiency-aware rewards as directions for testing and improving the approach.
Experimental scope
- Training is limited to 616 deep-research questions and at most 250 SWE tasks, with each configuration run once, so significance tests do not capture variation across training runs.The authors say larger-scale training would test whether results hold for stronger models, more data, and longer training.Source: §6 · p. 12
Comparison and cost
- Comparisons are between complete systems that also differ in prompts and tool interfaces, and TreeFlex uses more inference-time computation than baselines while adding sequential-segment latency.These settings constrain interpretation of system-level comparisons and the inference-time trade-off.Source: §6 · p. 12
Future work
- SWE validation accuracy was still rising at the last saved step, and the authors propose larger-scale training, SFT on successful searches, and direct efficiency rewards as future work.The proposed efficiency rewards would penalize generated tokens or tool calls in successful searches.Source: §6 · p. 12
7 Conclusion
TreeFlex stores progress in a search tree, lets one model select nodes and work to resume, and trains both roles with tree-aware GRPO. The authors report that it solves more tasks than baselines trained from the same starting model across both domains.
7 Conclusion
- TreeFlex saves agent progress as search-tree nodes, lets one model choose a node to resume and the work to perform, and trains both roles end to end with tree-aware GRPO.Source: §7 · p. 12
- Across both domains, TreeFlex solves more tasks than baselines trained from the same starting model.Source: §7 · p. 12
- The conclusion characterizes the framework as combining tree-based progress storage, model-directed resumption, and joint training of both roles.Source: §7 · p. 12
A Method Details
The appendix points to Algorithm 1 for the search loop and describes role-specific contexts assembled by the harness. Reflection sees node cards and chooses work, while Execution resumes saved path state in domain-specific context layouts.
A.1 Search Procedure
- Algorithm 1 gives the search loop described in Section 2.1.Source: §A.1 · p. 15
A.2 Context Layouts
- Reflection runs as a conversation across turns, receives checkpoints with node cards, and navigates by selecting a node and instruction; SWE results also report remaining turns and navigations and whether raw context is saved.Source: §A.2 · pp. 15–16
- Deep-research Execution starts a fresh context containing cards along the selected path and the current instruction, whereas SWE can restore the full raw context saved at the selected node.Source: §A.2 · p. 16
- When SWE context is shortened, the harness retains path cards and a shortened repository diff; the saved repository state at the resumed node is restored for work.Source: §A.2 · p. 16
B Training Details
Training packs each generated segment into causal blocks while preserving the context seen by each token, then builds PPO minibatches at the prompt-group level. Rewards combine task outcomes with process penalties applied under specified domain and success conditions.
B.1 Causal Block Packing
- Restored context fills the prompt portion of each causal block, generated tokens enter the response portion, and overflow context is visible but excluded from loss; long blocks split only between model calls.Thus, each token is trained on the context from which it was generated.Source: §B.1 · pp. 16–17
B.2 Building PPO Minibatches
- All rows from a prompt group share a PPO minibatch, rollout advantages are shared across its rows, and group statistics count each complete rollout once regardless of row count.Token-count weights are computed before GPU and microbatch splitting, so padding rows receive zero weight and splitting does not change the token or rollout mean.Source: §B.2 · p. 17
B.3 Domain Rewards
- BrowseComp-Plus terminal reward is binary answer correctness, while SWE reward comes from official grading and requires a valid candidate state passing all fail-to-pass and pass-to-pass tests.For TreeFlex, the training candidate is the Reflection-approved proposal; a rollout with no approved proposal receives zero.Source: §B.3 · p. 17
- Process penalties apply only to successful rollouts: TreeFlex uses failure and out-of-scope retrieval penalties on BrowseComp-Plus and only the failure penalty on SWE.The finalization penalty is added in BrowseComp-Plus ablations; overlapping penalties use the most negative value, and specified retrieval and instruction cases are exempt.Source: §B.3 · pp. 17–18
C.1 Data Split
Appendix C describes the BrowseComp-Plus validation split, resource limits, reward judging, and the FoldAgent implementation used in the comparison.
C.1 Data Split
- The 64 validation questions are held out from Sun et al.’s 680 BrowseComp-Plus training questions.The comparison uses a 32,768-token active-context limit; each call generates at most 3,072 tokens, and each rollout has at most 100 turns.Source: §C.1 · p. 18, §C.2 · p. 18
C.2 Context Limits
- Flat ReAct keeps all turns in one context, FoldAgent permits up to ten branches, and TreeFlex checkpoints when the next action would exceed its active-context limit.TreeFlex restores a selected node after checkpointing; FoldAgent replaces completed branches with reports in its growing main context.Source: §C.2 · p. 18
C.3 Reward Judges
- A fixed judge scores BrowseComp-Plus answers, with conservative rules and additional checks intended to prevent partial answers from being marked correct.When the judge accepts fewer wrong answers, it also rejects some correct answers.Source: §C.3 · pp. 18–19
Per-action out-of-scope judge.
- A separate judge evaluates each TreeFlex retrieval action for scope and penalizes only actions labeled out of scope, with no penalty when judging fails or returns malformed output.The judge sees the question, selected-node card, instruction, recent instructions, and retrieval-call details, but not the gold answer or reward.Source: Per-action out-of-scope judge · p. 19
C.4 FoldAgent Baseline
- All reported FoldAgent results use the authors’ open-source reimplementation, run in the shared training and evaluation code with common retrieval, answer judging, and training.Its prompts and tool definitions remain unchanged.Source: §C.4 · p. 19
C.5 Hyperparameters
- The reported RL runs use the configurations in Table 6, while Table 4 ablations change only their studied settings except for two finalization-penalty runs.Those two runs use a 40,960-token model window rather than 49,152 tokens, retaining the 32k active-context limit.Source: §C.5 · p. 19
C.6 Training Dynamics
TreeFlex’s validation Mean@3 rises during BrowseComp-Plus training and remains above the three baseline runs at every evaluated step.
C.6 Training Dynamics
- 30.7% to 38.0%: TreeFlex’s validation Mean@3 rises with tree-aware GRPO and leads all three baseline runs at every evaluated step.Figure 5 plots unsmoothed Mean@3 on the fixed 64-question validation split every five steps; stars mark selected test-evaluation steps, but the plot does not show test accuracy.Source: §C.6 · p. 19, Figure 5 · p. 20
- Figure 5 tracks validation Mean@3 on a fixed 64-question split, with evaluations every five training steps.Stars identify the steps selected for test evaluation; the figure itself does not show test accuracy.Source: §C.6 · p. 19, Figure 5 · p. 20
- The figure’s validation curves are unsmoothed, distinguishing the plotted measurements from smoothed training trends.The passage specifies that the figure does not show test accuracy.Source: Figure 5 · p. 20
D.1 Training and Evaluation Tasks
The SWE task data are split and filtered for training and validation, while repository snapshots and shell state are managed separately for saved nodes.
D.1 Training and Evaluation Tasks
- 600 SWE-Gym Python repository tasks are split into 500 training and 100 validation tasks, with validation stratified by repository and reference-solution difficulty.The difficulty score combines changed lines, changed files, and fail-to-pass tests; it is used to select validation tasks and is hidden from the agent.Source: §D.1 · p. 21
- Training subsets retain tasks where earlier rollouts had both successes and failures; FoldAgent uses 217 such tasks and TreeFlex uses the union of tasks with mixed outcomes for either method.The reported counts are 158 tasks in both sets and 250 in at least one; subsets are selected using training tasks and rollouts only.Source: §D.1 · p. 21
D.2 Repository Restoration
- Saving a node records repository changes from the base commit, and restoring it returns the repository to that saved state in a new shell.Shell variables and running processes do not carry over; each rollout has its own writable task-container copy, and the model cannot see the reference patch, test patch, or grader metadata.Source: §D.2 · p. 21
D.3 Comparison with FoldAgent
The comparison specifies method and environment differences, paired evaluation procedures, submission outcomes, and how search diversity and evidence coverage are counted.
D.3 Comparison with FoldAgent
- Both methods use the same post-trained Qwen/Qwen3.5-9B model, context window, container images, tool types, and official SWE-bench grader, but differ in some training settings.TreeFlex uses the rollout mean with λ = 0, while FoldAgent uses FoldGRPO’s token mean; their rewards and training rollout time limits also differ.Source: §D.3 · pp. 21–22
- TreeFlex restores earlier repository states and navigates among saved nodes, while FoldAgent keeps a growing main context and can launch up to ten branches that share one workspace.TreeFlex’s final three rollout turns are restricted to finish; FoldAgent has no corresponding rule, and the two systems also differ in shell and editor interfaces.Source: §D.3 · p. 22
E.1 Paired Comparisons
- BrowseComp-Plus paired differences compare TreeFlex with another system on the same 150 questions, using bootstrap intervals that capture question variation but not training-seed variation.The SWE paired differences use the same paired-bootstrap approach on 500 tasks; Table 7 and Table 8 report the respective comparisons.Source: §E.1 · p. 22, Table 7 · p. 23, Table 8 · p. 23
E.2 SWE Outcomes by Submission
- Most tasks TreeFlex resolves are solutions its policy submitted, whereas most resolved FoldAgent rollouts with its released prompt come from grading a workspace it did not submit.Table 9 distinguishes grading one repository state per rollout from counting a task only when the policy submitted that solution.Source: Table 9 · p. 24, §E.2 · p. 24
E.3 Search Diversity and Evidence Coverage
- Table 10 measures distinct queries, opened documents, and evidence documents across eight samples, with evidence read defined as the share of annotated evidence documents opened.A document counts as read only when opened with get_document or open_page; search snippets do not count, and repeated openings count once.Source: §E.3 · p. 24, Table 10 · p. 24
E.4 Case Study: Evidence-Directed Backtracking
A Figure 6 rollout shows Reflection exploring a new branch, returning to an earlier node, and approving the answer after the remaining date conflict is resolved.
E.4 Case Study: Evidence-Directed Backtracking
- Reflection approves “Porz Goret” after resuming n1 and resolving the date conflict that followed n2’s fruitless rival-song search.The benchmark answer is Yann Tiersen’s “Porz Goret”.Source: §E.4 · p. 24, Figure 6 · p. 25
- The rollout checkpoints an open question, then turns it into a later segment’s instruction.Source: §E.4 · p. 24
- Execution corrects a flawed instruction by rechecking documents, while the harness restores only states Reflection selects.Source: §E.4 · p. 25
F System Prompts
This appendix section presents system prompts that define agent roles, navigation, execution, evidence handling, and proposal review across TreeFlex and comparison systems. It also specifies bounded FoldAgent step-wise delegation, requiring branches to return findings to MAIN rather than resolve the broader issue.
F.1 BrowseComp-Plus Reflection
- Reflection selects a saved node by premise fit, gives Execution one focused evidence-seeking objective, and uses a persistent ledger to track checkpoint paths and navigation handles.Execution sees only the cards on its selected path; instructions are plans, not evidence.Source: §F.1 · p. 25
- Reflection approves a proposal only when it supplies every requested field and agrees with the checkpoint ledger; otherwise it requests a correction cycle or withholds approval.Reflection cannot edit a proposal, and final-execution-only review permits approval or concise rejection.Source: §F.1 · pp. 25–26
F.2 BrowseComp-Plus Execution
- Execution searches and reads documents one tool at a time, saves segment-specific evidence in path checkpoints, and commits only a complete answer supported by decisive evidence.The selected checkpoint restores ordered path cards, while off-path cards remain visible only to Reflection.Source: §F.2 · p. 26
- The research policy deconstructs requested fields, investigates promising documents in full, checkpoints unresolved gaps, and preserves uncertainty rather than treating failed retrieval as disproof.It commits when every requested field is directly supported and no material alternative, contradiction, or weak decisive inference remains.Source: §F.2 · p. 26
F.3 Flat ReAct Baseline
- Flat ReAct follows a verification checklist, investigates at least two independent search angles, reads promising documents in full, and verifies the weakest constraint before committing.It grounds claims in retrieved documents and must not answer from prior knowledge.Source: §F.3 · p. 27
F.4 Per-Action Out-of-Scope Judge
- The action-scope judge distinguishes in-scope work, necessary verification, redundancy, and out-of-scope actions, while separately labeling instructions as focused, broad, redundant, finalization, or uncertain.Failed or unproductive actions may still be in scope, and submission directives count as finalization rather than evidence work.Source: §F.4 · p. 27
F.5 SWE Reflection
- The SWE Reflection navigator chooses a saved repository state that contains needed premises while excluding the patch or assumption under test, and requires each non-final segment to end at an observable result.Its instruction must then hand off literally to checkpointing without further inspection.Source: §F.5 · p. 28
- SWE Reflection opens another segment for an unsupported requirement, conflict, failure, or evidence-backed alternative, and approves only a saved patch addressing the issue with supporting relevant tests and no material conflict.A failed command establishes only what happened in that attempt; Reflection cannot edit a proposal.Source: §F.5 · p. 28
- Reflection is directed to spend its final navigation or limited remaining turns completing, testing, and proposing a repair from the best-supported node.After the last charged navigation, only a finish-only Execution segment remains, which cannot edit or test.Source: §F.5 · p. 28
F.6 SWE Execution
- Execution treats the latest task as its complete assignment, reuses evidence from the restored path, and does not advance into an unassigned repair phase.The OpenHands workflow was rewritten for a single segment and supplemented with navigation and context-management sections.Source: §F.6 · pp. 28–29
- Execution must checkpoint as soon as its assigned objective is resolved or blocked, and finish only when explicitly asked to propose a complete tested solution.Checkpoint reports must include the outcome, changes, tests, evidence-backed alternatives, and the next distinguishing check.Source: §F.6 · p. 30
- Execution is limited to one native tool call per response and is instructed to avoid repository-restoration commands, conserve active context, and run focused tests.Overflowing context forces a checkpoint that replaces raw tool output.Source: §F.6 · p. 30
F.7 FoldAgent Step-Wise Delegation Prompt
- The step-wise variant changes four pieces of FoldAgent’s released prompt while leaving its tools, limits, and grading unchanged.The reproduced subsection focuses on its multi-agent instructions and worked micro-branch workflow.Source: §F.7 · pp. 30–31
- FoldAgent MAIN plans and verifies while BRANCH handles only its named deliverable, returns when obtained or blocked, and cannot finish.The prompt prohibits combining adjacent phases in one branch, such as searching, diagnosing, editing, and verifying.Source: §F.7 · p. 30
- FoldAgent MAIN is instructed to sequence small branches with observable stopping conditions and to wait for implementation and independent verification before finishing.Branch descriptions must name a specific 3–5-word deliverable ending in “Only” and exclude adjacent work.Source: §F.7 · p. 32
- A branch’s deliverable is the first non-test source match’s path and line; it must return these immediately without further searching or inspecting the file.The prompt explicitly forbids locating tests, diagnosis, reproduction, editing, or testing in that branch.Source: §F.7 · p. 32
- The prompt signals the role change with “MODE: BRANCH” and states that the branch inherits MAIN’s full context and understanding.The assignment is shown above the branch instructions.Source: §F.7 · p. 32
- Branches must treat the assigned deliverable as a hard scope boundary and avoid adjacent phases, which MAIN can handle in new branches.An incomplete broader issue is expected and is not a reason to continue.Source: §F.7 · p. 32
- Branches should use only the minimum actions needed and return as soon as the deliverable is obtained or clearly unobtainable.The prompt directs branches to call return at that point.Source: §F.7 · p. 32
- A branch must not call finish; once its task is complete, it returns control to MAIN with a message.The prompt marks the broader issue’s incompleteness as expected.Source: §F.7 · p. 32
- The branch’s final response should be clear and compact while reporting its outcome, system changes, relevant insights, assumptions, unresolved issues, and notes for MAIN.It should include any files modified, created, or deleted, as well as commands or environment changes that affected the system.Source: §F.7 · p. 32
Related papers
This paper cites
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?2023
- Tree of Thoughts: Deliberate Problem Solving with Large Language Models2023
- SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering2024
- OpenHands: An Open Platform for AI Software Developers as Generalist Agents2024
- Training Software Engineering Agents and Verifiers with SWE-Gym2024