Trellis: Bringing Compiler-Guided Repair into Agentic Code Generation

Du, Alexander, Ou, Jianjun, Zhuo, Danyang, Lentz, Matthew

–arXiv.org Artificial Intelligence 

Alexander Du 1 Jianjun Ou 1 Danyang Zhuo 1 Matthew Lentz 1 ABSTRACT Coding agents regularly generate programs that do not compile and require substantial tokens to repair. Yet most repairs are small and local to the edit that caused them. We present Trellis, a system that integrates incremental compiler feedback into code generation to improve code correctness while controlling repair costs. Trellis uses rollback-based search for targeted repair and asynchronous checking and checkpointing for efficient execution. We adapt Clang and tscto Trellis's checker interface and integrate Trellis transparently into OpenCode. On C/C++ and TypeScript software engineering tasks, Trellis improves compilation rate by up to 13% and test pass rate by up to 11% with comparable token consumption to baseline OpenCode. 1 INTRODUCTION Coding agents, such as Codex (OpenAI, 2026), Claude Code (Anthropic, 2026), OpenCode (OpenCode, 2026), and OpenHands (Wang et al., 2025b), are rapidly changing how developers write, test, and review software. With access to compilers, tests, and other tools, agents can check and revise generated code over successive interaction turns (Chen et al., 2024; Yang et al., 2024; Wang et al., 2025b). Tool access, however, does not ensure prompt error detection Figure1.Agent-directed compiler-error repair requires additionalor efficient repair. Unchecked errors can affect subsequentturns to request checks and revise code. Trellis overlaps com-generation or remain unresolved when an agent considerspilation with generation and initiates localized repair within ageneration turn.a Repeated 2025) demonstrates the promise of checking and repairing cycles of reasoning, checking, and revision consume timecode during standalone LLM code generation. Our goal is to improve models, compiler-error repair accounts for as much as 27% the correctness of generated code with comparable token of token use and elapsed time across attempts involvingconsumption. Trellis intercepts file-writing tool calls and repair. Prior work on constrained semantic decoding (Poesia et al., 2022; Mundler et al., 2025; Li et al., 2025a; Nagy streams the generated code to a compiler, overlapping checking with generation (Figure 1).