# From Agent Loop to Structured Graph: An LLM Agent Execution Framework Based on Scheduling Theory

> This paper characterizes the agent loop paradigm as a single-ready unit scheduler, proposes the Structured Graph Harness (SGH) framework, and elevates control flow from implicit context to an explicit static DAG. Through execution plan immutability, three-layer separation, and a strict escalation recovery protocol, SGH balances controllability, verifiability, and implementability.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-13T12:16:45.000Z
- 最近活动: 2026-04-14T03:25:10.537Z
- 热度: 126.9
- 关键词: 智能体循环, 结构化图, 调度理论, LLM智能体, 可控性, 可验证性, 执行框架, DAG
- 页面链接: https://www.zingnex.cn/en/forum/thread/llm-844be75d
- Canonical: https://www.zingnex.cn/forum/thread/llm-844be75d
- Markdown 来源: floors_fallback

---

## [Introduction] From Agent Loop to SGH Framework: A New Paradigm for LLM Agent Execution Based on Scheduling Theory

This paper focuses on the evolution of LLM agent execution paradigms and points out three structural weaknesses of the current mainstream agent loop: implicit dependencies, unbounded recovery loops, and variable execution history. By introducing a scheduling theory perspective (characterizing the agent loop as a single-ready unit scheduler), it proposes the Structured Graph Harness (SGH) framework, which elevates control flow from implicit context to an explicit static DAG. Through execution plan immutability, three-layer separation, and a strict escalation recovery protocol, SGH balances controllability, verifiability, and implementability, providing a new direction for building more reliable agent systems.

## Background: Dominance of the Agent Loop and Three Structural Weaknesses

The mainstream paradigm of current LLM agent systems is the agent loop, whose core is an iterative cycle: the model reads historical context to decide the next action and repeats until the task is completed. It is widely adopted due to its simplicity and flexibility (e.g., frameworks like ReAct). However, as task complexity increases, its structural weaknesses are exposed:
1. **Implicit Dependencies**: Step dependencies are implicitly transmitted through context, leading to unpredictable behavior, high error rates, and poor maintainability;
2. **Unbounded Recovery Loops**: Error recovery attempts may continue indefinitely, wasting resources and being difficult to intervene;
3. **Variable Execution History**: Dynamically accumulated historical records contain redundant information, making it hard to debug exceptions. These are all structural flaws inherent to the paradigm itself.

## Methodology: Scheduling Theory Perspective and SGH Framework Design

### Scheduling Theory Perspective
The agent loop is characterized as a single-ready unit scheduler in scheduling theory: at any time, there is at most one active unit, execution decisions depend on LLM's implicit reasoning, and there is a lack of explicit control structures. This perspective reveals its connection to graph execution engines and provides theoretical tools for improvement.

### Core Design of SGH Framework
SGH elevates control flow to an explicit static DAG (nodes are execution units, edges are dependencies/control flows) and makes three commitments:
1. **Execution Plan Immutability**: The structure remains unchanged within the plan version, eliminating debugging problems caused by variable history;
2. **Three-Layer Separation**: Planning (creating optimized plans), execution (scheduling nodes), and recovery (handling exceptions) are independent layers;
3. **Strict Escalation Recovery Protocol**: Defines escalation rules for failure handling to prevent unbounded recovery loops.

## Analysis and Theoretical Guarantees: Trade-offs and Formal Specifications

### Trade-off Analysis
SGH sacrifices some expressiveness (e.g., adaptive behavior requires more complex mechanisms) in exchange for improved controllability and verifiability. Analysis of 70 systems shows that existing systems are widely distributed; SGH outperforms the agent loop in controllability/verifiability and is more flexible than fully static workflows.

### Formal Specifications and Theoretical Guarantees
SGH includes strict specifications: defines node state machines (wait/ready/running/success/failure, etc.), state transition rules, and termination conditions. The specification proves that when conditions such as no cyclic dependencies and convergence of the recovery protocol are met, execution will terminate in a finite number of steps and the results are sound.

## Experimental Framework and Future Verification Directions

This is a position paper focusing on theory and design, without providing complete empirical results, but proposes an attributable experimental framework: uses seven design guidelines to guide future verification, covering the evaluation of tasks with different complexities, failure modes, and recovery strategies. The goal is to quantify the advantages and disadvantages of SGH compared to other paradigms, verify the correctness of theoretical analysis, and optimize the framework.

## Conclusion and Outlook: Significance of SGH Framework and Future Work

The SGH framework is an important evolution of the agent execution paradigm. Through the scheduling theory perspective and explicit graph structure, it solves the structural weaknesses of the agent loop and provides a theoretical foundation and practical guide for reliable and maintainable agent systems.

Future work directions:
1. Complete implementation of the SGH framework;
2. Large-scale evaluation in real scenarios;
3. Explore integration with multi-agent coordination, tool learning, memory management, and other technologies. As agent tasks become increasingly critical, frameworks like SGH that provide strict guarantees will become more important.
