II · Planning & Control FlowEmerging

Standing State Injection

also known as Current-State Recitation, Per-Turn State Snapshot, Standing Goal Block

Recompute a compact task-state snapshot each turn and inject it as a fresh system block before the model reasons, so a long tool-call loop stays oriented on the goal.

Context

An agent runs a task that stretches across dozens or hundreds of tool-call turns, such as a multi-step research sweep or a long build-and-fix loop. Every turn the prior reasoning, tool calls, and observations pile up in the running history, and the original goal slides toward the middle of a window that the model attends to less and less. The harness still controls prompt assembly on each turn, so it can place a small block wherever attention is strongest.

Problem

A goal stated once at the start of a long trajectory drifts as the history grows: the model loses track of what it set out to do, what is already done, and what comes next, and it may ask a question it already answered or declare the task finished early. Relying on the buried opening instruction is brittle, while re-reading the whole history each turn is expensive and still leaves the goal lost in the middle. The agent needs its current state restated where it will actually be read, every turn.

Forces

  • Long histories push the original goal into the low-attention middle of the window, so a one-time goal statement decays even though it is still present.
  • Recomputing a snapshot every turn costs tokens and a small derivation step, but a stale or absent state block costs a drifted or abandoned task.
  • A snapshot that is too terse omits the next step the model needs, while one that copies the whole plan reintroduces the bloat the loop was meant to avoid.
  • Deriving the snapshot from live execution keeps it honest, whereas trusting the model to self-summarise its own state invites quiet drift between the snapshot and reality.

Example

An agent is asked to triage forty open bug reports and file a summary for each. Twenty turns in, the original instruction sits far up the history and the model starts re-asking which repository to look in. With standing state injection, every turn begins with a small block — goal: triage 40 bugs; done: 23 filed; next: report #24 in the payments repo — so the agent keeps moving through the queue instead of losing the thread.

Diagram

Solution

Therefore:

Before each model turn, the harness builds a compact state snapshot from the live execution: the standing goal, a one-line status of what is done, and the immediate next step or open question. It renders this as a short structured block and injects it as a system message placed near the top of the assembled prompt, where the model attends most. The block is recomputed every turn from the current run rather than copied from the previous turn, so it tracks progress as the agent works. The full history may still be present or offloaded elsewhere, but the standing block guarantees the goal and next step are always restated in a low-cost, high-salience position, independent of any durable plan file.

What this pattern forbids. The injected state block must be recomputed from the live run on every prompt assembly; the agent cannot reuse a snapshot carried over from a previous turn, and a turn assembled without a current-state block is a harness bug.

And the patterns that stand alongside it, or against it —

  • complementsNow-Anchoring·Ground the agent's reasoning in the current absolute time without requiring tool calls, so every reply is implicitly time-aware.
  • alternative-toTodo-List-Driven Autonomous AgentHave the agent author a plan file (e.g. todo.md) early in the run, tick items as it completes them, and re-inject the remaining plan into context; the file is durable plan and working memory.
  • complementsAttentive Reasoning QueriesReplace free-form chain-of-thought with a domain-tailored sequence of structured queries that re-anchor the model's attention to the critical instructions and prior decisions at the exact generation steps where adherence tends to slip.
  • complementsContext CompactionWhen the context window nears its limit, replace the older conversation span with a model-written digest that preserves decisions, commitments, and active constraints while discarding noise, so the agent keeps running without losing the thread.
  • complementsTool-Result ReinforcementAppend a goal reminder, current task status, and failure or next-step hints to each tool return so the agent is re-grounded through the action channel it already reads.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.