{"type":"ScholarlyArticle","title":"CodeDelegator: Mitigating Context Pollution via Role Separation in Code-as-Action Agents","authors":[{"name":"Tianxiang Fei","slug":"tianxiang-fei","given":"Tianxiang","family":"Fei","affiliation":""},{"name":"Cheng Chen","slug":"cheng-chen","given":"Cheng","family":"Chen","affiliation":""},{"name":"Yue Pan","slug":"yue-pan","given":"Yue","family":"Pan","affiliation":""},{"name":"Mao Zheng","slug":"mao-zheng","given":"Mao","family":"Zheng","affiliation":""},{"name":"Mingyang Song","slug":"mingyang-song","given":"Mingyang","family":"Song","affiliation":""}],"abstract":"Recent advances in large language models (LLMs) allow agents to represent actions as executable code, offering greater expressivity than traditional tool-calling. However, real-world tasks often demand both strategic planning and detailed implementation. Using a single agent for both leads to context pollution from debugging traces and intermediate failures, impairing long-horizon performance. We propose CodeDelegator, a multi-agent framework that separates planning from implementation via role specialization. A persistent Delegator maintains strategic oversight by decomposing tasks, writing specifications, and monitoring progress without executing code. For each sub-task, a new Coder agent is instantiated with a clean context containing only its specification, shielding it from prior failures. To coordinate between agents, we introduce Ephemeral-Persistent State Separation (EPSS), which isolates each Coder's execution state while preserving global coherence, preventing debugging traces from polluting the Delegator's context. Experiments on various benchmarks demonstrate the effectiveness of CodeDelegator across diverse scenarios. Code is available at https://github.com/txfei/code-delegator.","doi":"10.24963/ijcai.2026/12","url":"https://ijcai.org/proceedings/2026/12","pdf":"https://ijcai.org/proceedings/2026/0012.pdf","markdown":"https://ijcai.org/proceedings/2026/12.md","bibtex":"https://ijcai.org/proceedings/2026/bibtex/12","volume":{"slug":"2026","title":"Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2026","url":"https://ijcai.org/proceedings/2026/","year":2026,"location":"Bremen, Germany","dates":"15-21 August 2026","editors":"Diego Calvanese","isbn":"978-1-956792-09-6","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2026"},"section":"Agent-based and Multi-agent Systems","track":"Main Track","number":12,"pages":{"first":99,"last":108},"keywords":["Agent-based and Multi-agent Systems: Multi-agent planning","Agent-based and Multi-agent Systems: Applications"],"videos":[],"references":[],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}