SDSignal Desk

Context Engineering Inside the Harness: 4 Mechanisms That Beat Context Overflow and Goal Loss on Long-Horizon Tasks

Sep 12, 2026, 10:56 PM · MarkTechPost

Image: MarkTechPost

Long-horizon agents don’t fail for lack of a bigger window—they fail when the harness doesn’t budget context, compact carefully, recite goals, and remember across sessions.

Why it matters

An agent is an LLM calling tools in a loop. That works for short jobs. Stretch it to an hour and hundreds of tool calls and it breaks in familiar ways: context overflow, goal loss, and no durable state. AWS’s design guidance for autonomous cloud coding agents names those failure modes directly—and puts the fix in the harness, not the model.

A MarkTechPost deep dive opens that layer: context budgeting and offloading, compaction, todo-state recitation, and cross-session memory—with the thresholds LangChain Deep Agents, Claude Code, Manus, OpenAI Codex, and Amazon Bedrock AgentCore actually ship.

From the desk

We’re filing this under engineering truth, not model mystique.

Bigger windows don’t save you. Chroma’s Context Rot work across 18 models found reliability degrading as inputs grow, even on simple retrieval. Anthropic’s own guidance treats attention as a finite budget with n² pairwise cost. Manus reports typical tasks near 50 tool calls with extreme input-to-output ratios—so observations pile up, instructions drift to the middle, and goal loss becomes the expected outcome of unmanaged context.

Budgeting first is the move we endorse. Deep Agents offloads tool responses over 20,000 tokens to disk and truncates old edits once session context crosses 85% of the window. Claude Code caps auto memory, defers MCP schemas, and returns fat re-reads as path references after compaction. Subagents that burn tokens exploring and return a short distilled summary are architecture-level budgeting—AWS’s AgentCore walkthrough spawns parallel browser microVMs and feeds an analyst only structured findings.

Compaction is where goal loss hides. Claude Code preserves architectural decisions and unresolved bugs, then re-reads recent files and reloads rules. Deep Agents made session intent, artifacts, and next steps structured fields after evals showed it helped—and keeps the full transcript on disk so summarized facts can be recovered. OpenAI and Anthropic both expose API-level compaction hooks; the prompt is now an engineering artifact.

Todo recitation—Manus rewriting todo.md so the plan stays at the end of context—is elegant. It’s also not free: Deep Agents made TodoListMiddleware opt-in after evals showed slightly better reward and lower cost with todos off on some task sets, while still recommending them for long multi-step work. Memory across sessions helps continuity and taxes attention; ETH Zurich work found repository context files raising inference cost without reliable success gains.

We’re for harnesses that make useful long-running agents possible. The downside if teams skip forced-compaction tests is shipping agents that look fine until the first summary—and then cheerfully declare victory or ask what the task was.

I’m watching whether vendors publish compaction evals the way they publish model benches.

Context

The piece synthesizes published thresholds and docs from Deep Agents, Claude Code, Manus, OpenAI’s Responses API compaction, Anthropic’s compact_20260112 edit, and AgentCore Memory/Evaluations. LangChain’s advice: if you haven’t forced compaction in a test, you don’t know what your summary drops.

Who feels it

Agent platform builders
Harness features—offload, compact, todo, memory—are product requirements, not optional polish.
Application developers
Assume unmanaged long loops will lose the goal; design for filesystem offload and recoverable transcripts.
Evaluators and QA
Forced mid-task summarization and needle recovery tests matter more than demo-length happy paths.

What to watch

  1. Whether compaction prompts and thresholds become shared open standards or stay vendor folklore.
  2. More public evals that trigger summarization at low percentages of the window to study goal drift.
  3. Cost/quality tradeoffs as persistent memory files proliferate in repos.

Read the original

Continue at the source.

MarkTechPost

Companies: OpenAI, Anthropic