Spine: Compiling Subtask Trees into Structured Context for Long-Horizon Coding Agents
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Long-horizon coding tasks contain nested subtasks. Typically, agents record interactions sequentially into a growing history, causing context inflation and performance degradation. Compressing or trimming the history without explicit subtask boundaries can discard information needed by unfinished subtasks. Conversely, recursive subagent delegation isolates completed subtasks through child agents by assigning every subtask boundary to delegation, which conflates subtask granularity with executing agent choice, adding execution and coordination overhead. We introduce Spine, an interface and runtime that align model context with subtask nesting and completion. An agent declares explicit subtask boundaries through work scopes, allowing the same agent to execute nested subtasks inline while reserving delegation for independent parallel tasks. The runtime organizes execution in SpineTree, a persistent tree recording subtask relations, local interactions, completion states, and returned results. Before each model call, it compiles the tree into model context just in time, retaining unfinished subtasks' interactions and replacing completed subtasks' details with their results, while preserving prefix-cache reuse. We integrate Spine into Codex to build SpineCodex. With GPT-5.6 Sol, compared with native Codex, SpineCodex improves SWE-Milestone Score by 11.8% while reducing total cost by 32.4%, improves the average ProgramBench test-pass rate by 17.3%, and improves Mean@5 on eight of the ten evaluated FrontierSWE tasks. On SWE-Milestone, it also achieves a comparable Score to Recursive Subagent at 73.7% lower total cost. We also integrate Spine into Pi through a reusable software package: with Gemini 3.8 Flash and Qwen 3.8 27B, it improves SWE-Milestone Score by 9.5-17.5% and the average ProgramBench test-pass rate by 4.3-8.7% compared with native Pi.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 21 of its 49 references that are in the map. Submitted 27 Oct 2026.
Builds on
21 of 49 references.
Closest ancestors · 9
Same direction, newest first
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct
- 2026AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agents8 Sep
- 2026CORVUS: Context Optimization and Reduction Via Underlying Synchronization for LLM Coding Agents20 Jul
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan
- 2026Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks9 Jan
- 2025Context as a Tool: Context Management for Long-Horizon SWE-Agents26 Dec
- 2025KVCOMM: Online Cross-context KV-cache Communication for Efficient LLM-based Multi-agent Systems14 Oct
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
Other references · 12
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 6,685
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,372
- 2025MultiAgentBench: Evaluating the Collaboration and Competition of LLM agentscited by 204
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 180
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 171
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?cited by 81
- 2024THREAD: Thinking Deeper with Recursive Spawningcited by 29
- 2025Sculptor: Empowering LLMs with Cognitive Agency via Active Context Managementcited by 23
- 2026SWE-Milestone: Evaluating AI Agents on Continuous Software Evolutioncited by 17
- 2026Recursive Models for Long-Horizon Reasoningcited by 10
- 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agentscited by 6
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agents
- 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agents
- 2026Interlock: From Local Correctness to Task Completion in Long-Horizon Agents
- 2026CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents
- 2026Subagents vs Agent Skills: Executing Reusable Knowledge for Long-Horizon Agentic Tasks
- 2026Coding Agent Memory Post-Training II: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via On-Policy Distillation
- 2026Interpreting Coding Agents Through Their Behavioral Trajectories
- 2026Beyond Semantic Organization: Memory as Execution State Management for Long-Horizon Agents