SShortSingh.
Back to feed

How a Missing Token Cap Turned a 40-Line Fix Into a 2,000-Line Diff

0
·1 views

A software engineer assigned a coding agent to add a rate limiter to a small Python service, expecting roughly 40 lines of changes, but returned three hours later to find a 2,000-line diff. Investigation of the agent's logs revealed it had edited the same file 14 times, oscillating between two competing designs without ever settling on one. Neither prompt ambiguity nor model quality was the root cause; the agent simply lacked a hard termination criterion and kept chasing marginal improvements indefinitely. The engineer resolved the issue by building a 40-line Python harness that enforces a token budget cap and flags oscillation when edits per file exceed a set threshold. The incident highlights the need to treat token budgets as explicit, enforceable constraints rather than generous allowances in agentic coding workflows.

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 ·

Open-Source Script Uses Free AI Tokens to Automate C++ Test Coverage

A developer has published an open-source Python script called MonkeyCode that uses free AI model access to automatically generate C++ unit tests and iteratively improve code coverage. The tool sends a C++ header file to an AI model, compiles and runs the resulting tests, then measures coverage using gcov. Any uncovered lines are fed back to the model as a hint, and the loop repeats until coverage plateaus or hits a target threshold. In a sample run, the script pushed coverage from 42% to 91% across four iterations by progressively catching edge cases like empty strings and null-byte handling. The author cautions that AI-generated tests should not be trusted for safety-critical code, describing the tool as a feedback-driven test generator rather than a replacement for a human test engineer.

0
ProgrammingDEV Community ·

ToolNest launches as a free, client-side developer toolkit with no signups or uploads

A developer named Shaikh Ayaan has launched ToolNest, a free suite of online tools designed for developers and general users. The platform runs entirely client-side, meaning all data such as images, JSON files, and text is processed within the browser and never sent to a remote server. ToolNest offers tools across three categories: developer utilities like JSON formatting and UUID generation, image tools including compression and format conversion, and text and math utilities such as a password generator and color converter. The project was created in response to existing online tools that are often cluttered with popups or require mandatory account registration. ToolNest is accessible at toolnest.shaikhayaan.com, and the developer is actively seeking user feedback.

0
ProgrammingDEV Community ·

Developer builds offline, open-source period tracker to keep health data off the cloud

A developer has released Mooneva Cycle, a free and open-source period and cycle tracking app built with React 19, TypeScript, and Capacitor 8, designed to run entirely without cloud servers or user accounts. All health data is stored locally on the user's device using localStorage or Capacitor's Secure Storage, eliminating the risk of remote data breaches or corporate data sales. The app uses standard Web Crypto APIs — specifically PBKDF2 key derivation and AES-GCM 256-bit encryption — to secure offline backups without any third-party cryptographic libraries. Additional privacy features include a disguise mode that masks the app's icon, biometric and PIN lock support, and on-device notifications that bypass cloud messaging services entirely. Released under the GPL-3.0 license, Mooneva Cycle supports web, iOS, and Android, offers 12 languages with RTL layout, and includes Persian Jalaali calendar support alongside the Gregorian calendar.

0
ProgrammingDEV Community ·

Third-Party Scripts, Not Hosting, Are the Real Cause of Poor INP Scores

Poor Core Web Vitals scores, specifically Interaction to Next Paint (INP), are frequently misattributed to hosting infrastructure, leading businesses to spend on unnecessary server upgrades. Research by adPerf found that ads alone account for over 15% of page load burden in browsers, with roughly 88% of that burden coming from JavaScript. Unlike LCP, which is largely a network and asset issue, INP measures browser responsiveness to user interactions and is almost entirely affected by JavaScript architecture on the client side. Common culprits include tag manager containers loaded with redundant marketing pixels, synchronously loaded chat widgets, and remarketing scripts from long-ended campaigns that were never removed. Auditing and managing third-party scripts is described as the highest cost-to-benefit optimization task in Core Web Vitals improvement, often fixable within a single development sprint without any server migration.