Heuristic:AIScientists Dev WorldSeed Terminal Actions End Wake
| Knowledge Sources | |
|---|---|
| Domains | Agent_Systems, Design_Patterns |
| Last Updated | 2026-10-26 19:00 GMT |
Overview
Classify agent actions as terminal or non-terminal: terminal actions end the agent's wake (commit GPU, public artifact), while non-terminal actions chain within a single wake for multi-step planning.
Description
The autoresearch agent runtime defines a `TERMINAL_ACTIONS` frozenset: `{"run_experiment", "write_paper", "review_paper"}`. When an agent submits one of these actions, the wake ends — the agent must wait for the next wake to continue. Actions not in this set (like `propose_hypothesis`) chain within the same wake, allowing multi-step planning like propose → perceive → run_experiment in a single activation.
This distinction matters because terminal actions have side effects that change the world state: `run_experiment` claims a GPU, `write_paper` commits to a public claim, `review_paper` affects consensus. Letting an agent chain these would risk double-submission or conflicting state.
Usage
Use this pattern in any agent loop where actions have different commitment levels. Terminal actions should be those that consume resources, commit to public state, or require the world to advance before the agent can see results.
The Insight (Rule of Thumb)
- Action: Define `TERMINAL_ACTIONS = frozenset({"run_experiment", "write_paper", "review_paper"})`. Check after each action; if terminal, end the wake.
- Value: `propose_hypothesis` is deliberately NOT terminal — it's private planning with no side effects beyond the agent's own data.
- Trade-off: Agents cannot submit multiple terminal actions in one wake. This limits throughput but prevents resource over-commitment.
- Compatibility: Enforced in `src/worldseed/autoresearch/agent.py`. The `MAX_TOOL_CALLS` limit (default 15) bounds total calls per wake regardless of terminal status.
Reasoning
Allowing an agent to call `run_experiment` twice in one wake would claim two GPUs before either result is available — the agent has no information to decide if the second experiment is worth running. By making it terminal, the agent sees the result of the first experiment in the next wake's perception and can make an informed decision.
`propose_hypothesis` is non-terminal because it only writes to the agent's private state. Chaining it with `perceive` and `run_experiment` in one wake enables efficient research planning: the agent forms a hypothesis, checks the world state, and immediately dispatches an experiment to test it.
The `MAX_TOOL_CALLS=15` limit is a safety net — even with chaining, an agent cannot loop indefinitely within a single wake.
Related Pages
- Implementation:AIScientists_Dev_WorldSeed_AutoresearchWorker
- Implementation:AIScientists_Dev_WorldSeed_run_experiment_handle
- Implementation:AIScientists_Dev_WorldSeed_write_paper_handle
- Principle:AIScientists_Dev_WorldSeed_Hypothesis_Management
- Principle:AIScientists_Dev_WorldSeed_Experiment_Execution