SShortSingh.
Back to feed

Developer Flags Codex CLI Polling Loop That Wasted 10M Tokens in One Overnight Build

0
·1 views

A developer has filed a feature request with Codex CLI on 17 September 2026, highlighting a structural inefficiency in how parent agents monitor the completion of delegated sub-agents. Currently, the parent must repeatedly call a wait function with a fixed timeout to check if a worker has finished, with each check triggering a full model activation that re-reads the entire conversation history. Measurements from a single overnight build revealed 89 such polling waits consuming over 10 million tokens, accounting for 12.7% of the run's total cost despite delivering no new information 74% of the time. The request asks that a sub-agent's completion automatically wake an idle parent agent, eliminating the polling loop entirely — a mechanism the developer notes is already implemented in Claude Code. The author argues this is a harness gap rather than a model error, and that its cost scales directly with longer autonomous runs where a parent has fully delegated its workload.

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 ·

Two-Artifact Freeze Method Keeps AI Patch Reviews Scoped to Real Bugs

Open-source maintainers risk unintended API expansions when coding models generate overreaching diffs in response to bug reports. A proposed workflow requires freezing two artifacts before any model session begins: a git bisect SHA identifying the first bad commit, and a snapshot of existing public API names. These two files act as hard merge gates, restricting model edits strictly to files changed in the offending commit. The bisect must confirm a reproducible test failure before any chat session starts, and a flaky test halts the entire process. The method aims to prevent silent surface-area growth and keep code review focused on the actual defect rather than model-suggested additions.

0
ProgrammingDEV Community ·

AI Agents Excel at Exploratory Testing but Fall Short for Regression Suites

AI agents have proven effective for exploratory testing by dynamically navigating interfaces, reacting to unexpected states, and investigating bugs without fully predefined steps. However, regression testing demands repeatable, documented action sequences and consistent checks so that results across multiple runs can be meaningfully compared. When an agent adaptively chooses alternate paths or accepts different signals as proof of success, it undermines the comparability that regression testing requires. Experts argue teams should use AI agents for ambiguous, one-off, or investigative tasks while investing in structured test assets for workflows that must be verified before every release. The key question for testing teams is not whether to use agents or automation, but which work benefits from flexibility and which requires repeatability.

0
ProgrammingDEV Community ·

How Postgres Advisory Locks Prevent Double-Counted Bids in Pay-to-Rank Apps

A developer behind Steal the Spot, a pay-to-rank leaderboard where every bid is real money, shared a concurrency-safe payment pattern built on Supabase Postgres and Dodo webhooks. The core problem addressed is duplicate webhook deliveries and simultaneous bids causing incorrect rankings or double-applied payments. The solution uses pg_advisory_xact_lock to serialize bids per season, an idempotency check that detects already-processed payment IDs, and a FOR UPDATE row lock to prevent interleaved rank calculations. The advisory lock's transaction-scoped variant ensures a crashed worker cannot permanently block the system. Access to the underlying database function is restricted to the service role, preventing clients from manipulating their own rank directly.

0
ProgrammingDEV Community ·

Developer Learns Hard Lessons Adding Chinese to an AI-Powered Codenames Game

A developer who built an AI-powered Codenames web game added Simplified Chinese word sets after a reader requested multi-language support. AI tools generated candidate translations quickly, but evaluating whether they were natural or appropriately ambiguous still required human judgment. An automated validator that flagged substring overlaps as hard errors initially pushed translations toward unnatural single-character fragments and awkward abbreviations. Relaxing the rule so overlaps triggered review rather than build failures allowed more natural Chinese words to be used. The key insight was that automated validators can catch structural errors like duplicates, but product decisions about word meaning and naturalness require human oversight.

Developer Flags Codex CLI Polling Loop That Wasted 10M Tokens in One Overnight Build · ShortSingh