arXiv:2611.02017cs.CLNov 2026

Manuscript Offprint

arXiv:2611.02017

Switch-SWE: Do Coding Agents Hold Focus When Switching Between Unfinished Tasks?

Shuochen Chang, Qianli Ma, Yibo Miao, Qingyang Liu, Bingjie Gao, Haonan Zhao, Siyu Sun, Yulin Sun, Han Zhao, Jiangtong Li

ABSTRACT

Software development sessions often involve several unfinished tasks rather than one issue carried through to completion. As coding agents take on repository-level development, they need to recover an earlier task's requirements and partial progress after intervening work. Existing repository-level benchmarks typically score one issue-to-patch episode and do not directly measure whether an agent can resume a task after advancing other unfinished work in the same repository. We introduce Switch-SWE, a benchmark for focus-task resumption in sessions that interleave unfinished tasks drawn from the same source repository, with a persistent checkout for each task. Each focus task is evaluated in matched uninterrupted and switched sessions with identical focus requirements and executable verifiers. The switched session interleaves ordered stages from other unfinished tasks in the same repository, while only the final focus patch is scored. Switch-SWE contains 200 focus tasks from 19 Python repositories, reconstructed from issue, pull-request, and review histories and rendered as 400 matched session specifications. Across 7 coding agents, interleaved unfinished work produces an average focus-task resolution gap of 11.5 percentage points, ranging from 6.0 to 15.0 percentage points. Trajectory analysis identifies cross-task requirement confusion and loss of task state as recurrent resumption behaviors. We introduce a plug-in context-management module that selects task-relevant history and maintains concise task-state summaries. On OpenCode, the module improves focus-task completion under same-repository task switching by 5.5 to 15.5 percentage points across the evaluated models. Code is available at github.com/Miraclecsc/Switch-SWE.

1 INTRODUCTION

Coding agents are expanding the scope of automated software development, combining code generation with repository exploration, code editing, and test execution to address increasingly complex tasks (Yang et al., 2024a; Zhang et al., 2024; Wang et al., 2025; Xia et al., 2024; Chang et al., 2026b). As agents take on broader development work, users can maintain several requests within one continuous session. A feature request may remain unfinished while the agent handles a separate bug or review request before returning to the earlier work. Reliable collaboration then requires the agent to recover the earlier task's requirements and partial progress while keeping them separate from intervening work. Recent advances in coding benchmarks make this capability amenable to systematic evaluation (Chen et al., 2021; Chang et al., 2026a; Jimenez et al., 2024; Zan et al., 2026; Yang et al., 2024b; Liu et al., 2024b).

Existing benchmarks have expanded coding-agent evaluation in complementary directions. SWE-bench evaluates repository-level issue resolution (Jimenez et al., 2024). SWE-Touch evaluates adaptation to user code edits within a coding task (Tan et al., 2026). SWE-ContextBench evaluates the reuse of context from related tasks (Zhu et al., 2026). InterruptBench examines adaptation to changing user goals in web navigation Zou et al. (2026). Their settings do not directly isolate whether a coding agent can recover and complete an unfinished repository-level task after advancing other

Figure

(a) Cost vs. Resolution

(b) Failure Breakdown

DeepSeek-V4.1-Flash Z GLM-5.3 Kimi K3 GPT-5.6-Terra (Medium) GPT-5.6-Sol (Medium) Claude Opus 5 (Medium) Gemini 3.7 Flash

Figure 1: Task switching increases cost while reducing completion. (a) Moving from uninterrupted to switched execution lowers focus-task resolution and raises cost across all seven configurations. (b) Failures span implementation, submission, and incomplete execution.

unfinished tasks in the same continuous session. This raises a central question: can a coding agent reliably resume and complete an unfinished task after working on other unfinished tasks?

To answer this question, we introduce Switch-SWE, a benchmark for session-level resumption after an agent advances other unfinished tasks from the same source repository. Each focus task is evaluated in matched sessions. The uninterrupted control presents the focus task's substantive stages in order. The switched session inserts ordered stages from other unfinished tasks in that repository before the focus task is submitted. Each task retains its own persistent checkout, preserving its partial work while keeping the comparison focused on session-level task recovery rather than on-disk conflicts. The focus requirements and executable verifier are identical across the matched pair, and only the final focus patch is scored. This paired design measures how interleaved unfinished work affects an agent's ability to resume and complete the focus task.

Switch-SWE contains 200 focus tasks from 19 Python repositories, each forming a matched uninterrupted control and switched session, for 400 session specifications. Each focus task contains substantive stages reconstructed from real issue, pull-request, and review histories. Every switched session interleaves the focus task with four unfinished tasks from the same repository. We assign interruptions to the same source subsystem as the focus task or a different subsystem, enabling analysis of how source locality relates to task resumption. Alongside executable focus-task verification, Switch-SWE records recovery costs and cross-task errors to characterize task-resumption behavior.

We evaluate 7 coding agents on Switch-SWE. Across these agents, interleaved unfinished work yields an average focus-task resolution gap of 11.5 percentage points relative to matched uninterrupted sessions. The gap ranges from 6.0 to 15.0 percentage points across agents, revealing a substantial task-resumption challenge despite identical focus requirements, executable verifiers, and task-specific workspaces in every matched pair. Figure 1(a) shows that lower resolution accompanies higher execution cost, while Figure 1(b) breaks down failures into implementation, submission, and incomplete execution. Trajectory analysis identifies cross-task requirement confusion and loss of task state as recurrent resumption behaviors.

These trace-level patterns point to two context-recovery needs: isolating the history relevant to the active task and recovering its accumulated state. We introduce a plug-in context-management module that addresses these needs through task-relevant history selection and concise task-state summaries. The module leaves the agent's native execution workflow and persistent per-task checkouts unchanged. On OpenCode, the module improves focus-task completion under same-repository task switching by 5.5 to 15.5 percentage points across the evaluated models. Our contributions are:

  • Setting. We formulate same-repository task resumption as an evaluation setting with matched uninterrupted and interleaved sessions.

  • Benchmark. We construct Switch-SWE from executable multi-stage repair tasks and real issue, pull-request, and review histories.

  • Evaluation. We provide paired measures of focus-task resolution, source locality, and resumption behavior.

  • Method. We introduce a plug-in context manager for task-relevant history and task-state recovery, and show improved task completion on OpenCode.

References (75)