InstructFlow: Adaptive Symbolic Constraint-Guided Code Generation for Long-Horizon Planning

Hechang Chen (Jilin University) · Yi Chang (Jilin University) · Ivor Tsang (A*STAR) · Haotian Chi (Jilin University) · Zeyu Feng (A*STAR) · Yueming LYU (CFAR, IHPC. Agency for Science, Technology and Research (A*STAR)) · Chengqi Zheng (Nanyang Technological University) · Linbo Luo (Xidian University) · Yew Soon Ong (Nanyang Technological University) · Haiyan Yin (A*STAR Centre for Frontier AI Research (A*STAR CFAR))
adaptive failure recoverycode generationconstraint generatorconstraint satisfactioncontrol programsexecutable code snippetsfailure-resilient planningfeedback-driven flowinstruction graphlong-horizon planningmulti-agent frameworkrobotic manipulationsymbolic goalstargeted code refinementtask decomposition

Long-horizon planning in robotic manipulation tasks requires translating underspecified, symbolic goals into executable control programs satisfying spatial, temporal, and physical constraints. However, language model-based planners often struggle with long-horizon task decomposition, robust constraint satisfaction, and adaptive failure recovery. We introduce InstructFlow, a multi-agent framework that establishes a symbolic, feedback-driven flow of information for code generation in robotic manipulation tasks. InstructFlow employs a InstructFlow Planner to construct and traverse a hierarchical instruction graph that decomposes goals into semantically meaningful subtasks, while a Code Generator generates executable code snippets conditioned on this graph. Crucially, when execution failures occur, a Constraint Generator analyzes feedback and induces symbolic constraints, which are propagated back into the instruction graph to guide targeted code refinement without regenerating from scratch. This dynamic, graph-guided flow enables structured, interpretable, and failure-resilient planning, significantly improving task success rates and robustness across diverse manipulation benchmarks, especially in constraint-sensitive and long-horizon scenarios.