SShortSingh.
Back to feed

Rewriting AI agent histories to save context can erode facts over long runs

0
·2 views

A DEV Community article defines context degradation as the loss of facts an agent once knew, caused by summarising, compacting or truncating its history to keep prompts small. The author argues this loss is irreversible and compounds with each rewrite, and distinguishes it from context rot, which concerns model performance on longer prompts. In a simulated 12-hour bakery operations benchmark with 663 graded questions, five agent stacks were compared under the same seed and model. The stack that kept the most history scored highest, while the cheapest run scored lower, though the Claude Agent SDK's default compaction did not measurably hurt its score over the first eight hours. The author stresses that the findings are narrow, drawn from one seed and one shift, and that longer runs remain untested.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

ContHunt MCP Server Lets Claude Code and Cursor Query Short-Form Video Data

A developer guide explains how to connect ContHunt's hosted Model Context Protocol server to Claude Code and Cursor. The server gives AI coding agents access to public TikTok, Instagram Reels, and YouTube Shorts performance data. Setup involves a single command or config file entry, followed by OAuth sign-in through a browser. The article describes tools for checking credits, running SQL queries on saved searches, performing keyword searches, and fetching creator profiles. It also cites a 2026 benchmark of 1,500 videos showing highly skewed view distributions across the three platforms.

0
ProgrammingDEV Community ·

Ternary Bonsai 2.5 27B needs far more GPU memory for its context than its file size suggests

The 27-billion-parameter Ternary Bonsai 2.5 model stores its weights at about 1.76 bits, so its roughly 5.5 GiB of weights look small enough for an 8 GB card. At the full 262,144-token context, however, llama.cpp consumed about 26.2 GiB on an H200, mostly for a key-value cache reserved at start-up. Researchers measured how memory scales with context length, cache precision of 16, 8, and 4 bits, and concurrent requests. Quantizing the cache to lower bits substantially reduces the footprint, and each extra request adds roughly 0.6 GiB. The model also outperformed Qwen3.8-27B FP8 on AppWorld agent tasks in completion count and cost, though it ran more slowly.

0
ProgrammingDEV Community ·

PVS-Studio Static Analysis Uncovers Memory and Logic Errors in Scilab Source Code

Developers examined the open-source mathematical software Scilab using the PVS-Studio static analyzer to identify potential defects. The review highlighted several intriguing issues, including mismatched memory allocation and deallocation that can trigger undefined behavior. Another finding involved a pointer being dereferenced before its null check, caused by a typo in the verification logic. The authors argue that static analysis complements testing and code reviews by catching bugs early, saving time for feature development. The analysis was performed on the project at a specific commit using PVS-Studio version 8.00.

0
ProgrammingDEV Community ·

Data contracts must encode meaning, not just structure, to guard against silent agent-driven changes

A data contract is a written, verified agreement between dataset owners and the people and agents who use it. Standard checks for type, nullability and freshness validate structure, but costly errors often alter a field's meaning while leaving its structure untouched. The author illustrates this with an online shop's 'is_active_customer' flag, which doubled after a coding agent changed its time window from 90 to 365 days without any test failing. Andrew Jones has made a similar point using an amount field that switched from including tax to excluding it. The author argues that AI agents on both producing and consuming sides make unwritten definitions riskier, and a small test on a made-up repository found a contract with named owners reduced unapproved changes. The proposed fix is a short written block of meaning for each key field, placed where agents work.