一年吃掉一块固态硬盘,Codex日志bug被骂“劣质软件”

marsbitPublished on 2026-07-02Last updated on 2026-07-02

Abstract

OpenAI的编程工具Codex被曝存在严重日志Bug,其默认的TRACE级别日志记录导致在用户本地SQLite数据库中疯狂执行“插入后立即删除”操作。该问题在21天内产生了37TB的写入量,推算一年可达640TB,足以快速耗尽一块消费级固态硬盘(SSD)的写入寿命。 问题的核心在于,尽管最终数据库文件大小仅约1GB,但SSD的损耗取决于总写入数据量。Codex的日志系统无视用户通过RUST_LOG环境变量进行的配置,将大量无用的调试信息和遥测数据(占总写入量的96%)持续写入硬盘。类似“日志无限增长”的问题在Codex中至少被报告过9次。 在问题被提交至GitHub并引发社区广泛讨论后,OpenAI合并了修复代码,据称可减少约85%的日志写入量,但仍未彻底解决。此事引发了开发者对AI编程工具资源管理不当的批评,将其称为“劣质软件”,并指出同类工具Claude Code也存在类似问题。评论认为,现代软件过度依赖硬件性能来掩盖其低效和缺陷,形成了一个“软件越写越烂,硬件越造越猛”的荒诞循环。

一年「吃掉」一块1TB的固态硬盘?

OpenAI的旗舰编程工具Codex,正在以一年640TB的写入量,烧穿你的固态硬盘。

前段时间,一位开发者在GitHub上提交了一个issue。这个如今标着「Closed」、编号#28224的GitHub issue,标题写着:

Codex的SQLite反馈日志一年能写640TB,迅速耗尽固态硬盘寿命。

据这位报告者实测,他的主固态硬盘连续开机21天被写掉37TB,照此推算一年约640TB,足够报废一块总写入量(TBW)为600TB的消费级硬盘。

为佐证,他贴出了两张表。

在证据1里,这个日志库始终只有1.2GB,表面像什么都没发生;可它的自增行ID已经冲到55亿,真正留存的行不过50万出头,两者差了整整一万倍。

关键在于,硬盘损耗只算一共写过多少、不管此刻还剩多少:这55亿行全都落过盘,删掉也退不回已经付出的写入。所以你查文件永远只看到那50万行,硬盘却早已扛下55亿行的写入量。

证据2暴露了这55亿行的分布:九成多是连开发者自己都不会回头看的调试噪声,光把每条WebSocket数据包整包抄下来这一项,就占了一半。

罪魁祸首,是一行Level::TRACE默认配置,它把你硬盘的写入寿命,当成了免费的草稿纸。

Hacker News上一条高赞评论,直接为这事定了性:

这是「劣质软件」(slopware)最臭名昭著的例子之一。

这位网友还无奈地甩出一句:

这真是个悲剧。这个世界,需要有人来和Anthropic竞争。

更尴尬的是,这个问题不是没人报。

从今年4月起就有零星反馈,前后拖了两个多月,非要等用户自己测算、写报告、把它顶上Hacker News头条,才算被正经对待。即便如此,这一轮也只砍掉了约85%的日志写入。

还有人想自己动手,却发现无从下手:这些工具的桌面端是闭源的。

评论区还有一句神评论:审查流程怎么没拦住这么明显的错误?哦对了......@codex 审查一下这个。

640TB,到底是怎么写出来的

640TB是什么概念。

主流消费级固态硬盘,标称写入寿命大概150到600 TBW,够普通用户用上十几二十年。

而Codex这个「记录自己干了点什么」的日志功能,一年就能写满。

事情要从这位用户清点硬盘说起。他的机器连续开机21天,主固态硬盘被写掉了37TB。

照这速度,一年约640TB。

更离谱的是写入方式。

Codex在本地维护着一个SQLite数据库logs_2.sqlite,专门记录反馈日志。这位用户抓了15秒——数据库被插入36211行,而保留的总行数,从头到尾都是681774,一个没多。

每插进一行,就有一行被删掉。行数始终不变,磁盘却被来回擦写几万次。

这套机制有个外号,叫insert-and-prune:插入,然后立刻删除。

更荒诞的是它记的东西:一堆文件系统的inotify事件。

ld.so.cache被记了128764次,locale.alias37982次,passwd23843次。

同一个文件,被同一个程序,反反复复记上十几万遍。

日志里的自增ID已经超过55亿,而真正留存的行只有约50万。

两者差了一万倍。

这不是bug,简直就像是一个AI编程工具在对着自己的硬盘反复念经。

文件才1GB,写入却是640TB

一边写一边删,留下的logs_2.sqlite能多大?大约1GB。

这就引出整件事最反常识的一点:固态硬盘的寿命看的是「写入量」,而非「文件大小」。一个1GB的文件被反复擦写640次,对硬盘就等于写了640TB。

SQLite用的是WAL机制,每次改动先写进-wal文件,攒够再checkpoint回主库。Codex每15秒做三万多次插入加删除,每一次都要经过WAL、索引更新、checkpoint,同一块存储区,被擦了又擦。

打个比方:一本1GB的笔记本,你每天擦掉重写1750遍,连写一年。笔记本还是那本,纸已经磨穿了。

这也是这个bug能潜伏这么久的原因:它不占空间,只烧寿命。

查可用磁盘看不出异常,文件大小一直很安静,只有去读硬盘自己的SMART健康计数,才能看到写入量在悄悄累积。

根因,一行被无视的RUST_LOG

为什么会记这么多日志?

答案在Codex源码的一行配置里:SQLite反馈日志的sink,初始化时用的是Targets::new().with_default(Level::TRACE)。

一句话,日志默认开到TRACE级别,最高、最啰嗦、什么都记的那一档。

Codex的日志框架是Rust生态的tracing,标准做法是读RUST_LOG环境变量。用户当然试过,把RUST_LOG调成info、warn,甚至直接关掉。

没用。

with_default(Level::TRACE)把全局默认硬钉死在TRACE,RUST_LOG在这条路径上根本不生效。你以为自己关掉了日志,它照写不误。

这种bug最坑人的地方在于,并非「你忘了配置」,而是「你配置了,它假装没听见」。

更刺眼的是一个比例。

把保留的日志按类别拆开,TRACE占了70.7%,约732.5 MB。再加上codex_otel那两路镜像遥测日志(log_only和trace_safe),又占了25.3%。

七成写入是TRACE噪声,加上镜像遥测,96%全是没人会看的废话。

只有4%,才是真正有意义的内容。

这不是第一个,至少是第九个

报告者翻了Codex仓库,发现这类「日志无界增长」的Issue,至少有9个。

#17320,流式响应期间WAL狂写,根因和这次一模一样,都是TRACE无视RUST_LOG。

#24275,桌面版logs_2.sqlite疯涨。

#22444,WAL无限增长还占着空间不释放。

#26374,一天写0.75GB,没轮转。

#27911,一个4KB的goals_1.sqlite,被写成11MB/s。

#20563,进程闲着也狂写盘。

#27020,Windows上磁盘活跃100%。

最早的源头能追到#12969,正是这个PR把SQLite反馈日志的sink按TRACE级别接了进来。

一个4KB的数据库被写成每秒11MB,单独拎出来都够写一篇。而它和640TB那个,是同一个产品、同一套遥测体系的症状。

这说明Codex的日志和遥测系统,从一开始就没有「资源预算」这个概念。

整个赛道都在卷token预算、卷上下文长度、卷模型能力。

但几乎没人问:一个常驻用户机器、7×24小时跑的Agent,它的磁盘、内存、CPU预算,谁来管?

修了,但修得很OpenAI

6月14日报上GitHub,6月23日,报告者更新了一条:三个PR已合并,据他自己的Codex反馈能减少约85%日志,于是宣布关闭。

先说这个85%——不是100%,而且还没全落地。

三个修复里,#29432、#29457已随0.142.0发布,砍掉逐条WebSocket日志和噪声目标;第三个#29599停掉另一类被桥接进来的冗余日志,要等0.143.0才上线。

即便三个全到位,剩下约15%、一年仍要写约96TB,不过是从「一年烧穿硬盘」降到「六年烧穿硬盘」。

也有人替它辩护:trace日志是按设计存下来调试的,不算bug,对OpenAI也确实方便追查边缘case。

但问题恰恰在这儿:拿付费用户的SSD寿命,给厂商的debug做免费存储,这事,用户同意过吗?

编程战场,烧穿的不只是SSD

有意思的是,被点名的并不只有Codex。

评论区马上有人补刀:Claude Code也往本地猛写调试日志,有人只好把日志目录软链到内存盘(tmpfs),给SSD续命。

两家旗舰,犯的是同一类毛病。

社区里的评论,很快从一个bug,放大到整个AI编程工具的质量问题。

有人吐槽这些智能体GPU常年跑满、内存动辄70GB,有人干脆给这代软件起了名字:劣质软件。

那位开发者的建议本来极简:给应用设条线,别超过3GB。就这一条线,Codex拖了9个Issue、好几个月才肯画下来。

问题是一个时刻把「AGI」挂在嘴边的公司,为什么会栽在实习工程师都能看出来的问题上?

为什么这毛病能藏这么久,有条评论也说到了点子上。

放十年前,日志开到TRACE,程序当场卡死,当天就被修掉;如今CPU够快、内存够大、磁盘够猛,这点毛病被硬件性能悄悄消化,程序照跑、界面照常、用户无感,直到某天SSD提前报废。

这两年,软件被AI生成的代码塞满,功能越堆越多、抽象层越叠越厚、资源消耗一路狂飙,全靠硬件厂商每年用更快的芯片硬兜。

于是有了一个荒诞循环:软件越写越烂,硬件越造越猛。用户揣着「好像没变慢」的错觉掏钱换新机,其实只是新机器勉强撑住了更烂的软件。

一个小bug当然无法压垮OpenAI。但Codex和Claude Code的竞争已经从模型能力,蔓延到了开发者工作流的入口。

在这条战线上,快速作出改变,响应开发者需求从来不是加分项,只是入场券。

参考资料:

https://github.com/openai/codex/issues/28224

https://news.ycombinator.com/item?id=48626930

本文来自微信公众号“新智元”,作者:ASI启示录

Trending Cryptos

Related Questions

Q根据文章,Codex工具的日志bug每年会写入多少数据,导致什么问题?

ACodex工具的日志bug每年会写入约640TB数据。这远超主流消费级固态硬盘(标称写入寿命约150到600 TBW)的承受能力,足以在一年内烧穿(报废)一块总写入量为600TB的硬盘。

Q文章中提到的Codex日志问题,其根本技术原因是什么?

A根本技术原因在于Codex源码中,SQLite反馈日志的sink在初始化时被硬编码配置为最高、最详细的TRACE级别(Targets::new().with_default(Level::TRACE))。这使得日志系统会记录大量冗余的调试信息,且无视用户通过RUST_LOG环境变量调整日志级别的设置,导致写入失控。

Q为什么这个严重消耗SSD寿命的bug难以被用户察觉?

A这个bug难以察觉主要有两个原因:第一,日志文件本身的大小始终保持在大约1GB左右,不会异常膨胀占用磁盘空间,因此通过查看磁盘可用空间无法发现问题。第二,其对硬盘的损耗体现在“总写入量”上,这部分数据需要查看硬盘的SMART健康计数才能发现,日常使用中用户通常不会监控这个指标。

Q文章中提到OpenAI是如何修复这个问题的,修复效果如何?

AOpenAI通过合并三个相关的PR进行了修复。其中两个已随版本0.142.0发布,砍掉了逐条WebSocket日志和一些噪声目标;第三个修复则需要等待版本0.143.0。根据报告者实测,修复后大约能减少85%的日志写入量。这意味着写入量从每年约640TB降至约96TB,从“一年烧穿硬盘”变为“六年烧穿硬盘”,问题得到缓解但未完全根除。

Q文章将Codex这类AI编程工具的普遍性问题称为什么?并简述其背后的行业现象。

A文章将这类问题称为“劣质软件”。其背后的行业现象是,在激烈的AI竞赛中,开发者过度专注于提升模型能力(如token预算、上下文长度),而忽略了作为常驻用户设备的客户端软件的资源管理(如磁盘、内存、CPU预算)。同时,现代硬件性能的强大掩盖了软件的低效和缺陷,导致一个“软件越写越烂,硬件越造越猛”的荒诞循环,用户最终为更差的软件体验买单升级硬件。

Related Reads

Trump, the President Who Knows Best How to 'Trade Stocks'

Former US President Donald Trump reported a record-breaking $2.2 billion in personal income for 2025, the highest annual income ever disclosed by a sitting president. This figure, from a 927-page government ethics filing, represented a 3.5-fold increase from his $600 million income in 2024 and boosted his net worth to $6.5 billion. The primary drivers were cryptocurrency (64% of income, approximately $1.4 billion) and real estate (26%, approximately $575 million). His crypto earnings stemmed largely from the launch of his personal meme coin, $TRUMP, generating over $600 million in licensing fees, and substantial profits from the WLFI token and its parent company. Despite a sluggish property market, his Mar-a-Lago resort and associated golf clubs saw revenue surges of 50% and 27%, respectively, attributed to their use as venues for presidential events. Trump's financial disclosure also revealed an unprecedented level of stock market activity, with over 22,000 trades executed in 2025, averaging 87 trades per market day. Media analyses noted several instances where significant trading coincided with major policy announcements, such as proposed tariffs, raising questions about potential conflicts of interest. While the White House stated these trades were handled by a family-managed trust fund and not Trump directly, critics highlighted this as a departure from the blind trusts traditionally used by presidents post-Watergate. The report has intensified debate over the commercialization of the presidency. Supporters view it as a success story of a businessman-president, while critics argue it demonstrates an unprecedented conversion of public influence into private wealth, with policy decisions potentially linked to personal financial gains. The controversy centers on whether Trump's earnings represent innovative entrepreneurship or a fundamental conflict of interest, sparking renewed calls for stricter ethics reforms in US governance.

marsbit9m ago

Trump, the President Who Knows Best How to 'Trade Stocks'

marsbit9m ago

Countdown to Q-Day: Will Quantum Computing End Cryptocurrencies?

The article explores the existential threat quantum computing poses to cryptocurrencies and the urgent need for "post-quantum" migration. It outlines that quantum computers, through Shor's algorithm, could break the elliptic-curve cryptography (ECC) underlying blockchain security, potentially allowing private keys to be derived from public keys. The core challenge is not a lack of post-quantum cryptography (PQC) standards—like NIST's ML-KEM and ML-DSA—but the immense complexity of upgrading entire ecosystems before "Q-Day" (when quantum computers become capable of such attacks, estimated around 2035-2045). Key points include: * **Bitcoin's** risk is concentrated in legacy UTXOs with exposed public keys (e.g., early P2PK outputs). Migration faces massive hurdles: PQC signatures are much larger, increasing transaction size and cost, and the governance dilemma of handling un-migrated assets threatens its "code is law" ethos. * **Ethereum's** strategy focuses on "cryptographic agility," using Account Abstraction for user accounts and developing compressed hash-based signatures (like leanXMSS with SNARK aggregation) for consensus. Its migration is a complex, full-stack overhaul of execution, consensus, and data layers. * The "security debt" is enormous. The comfortable engineering window for a coordinated, ecosystem-wide upgrade is only 5-8 years. High-value infrastructure (exchanges, bridges) may face pressure before mainnet protocols. In conclusion, quantum computing is not an instant "doomsday" event but a forcing function for systemic change. Bitcoin's ultimate test is social consensus and property rights governance, while Ethereum's is technical complexity. Failure to migrate in time could lead to a fundamental re-pricing of crypto assets.

链捕手13m ago

Countdown to Q-Day: Will Quantum Computing End Cryptocurrencies?

链捕手13m ago

Losing $55 Million to Sell Bitcoin, MicroStrategy's Faith Reaches Its Interest Payment Day

On July 6th, Michael Saylor's MicroStrategy announced the sale of 3,588 BTC for approximately $216 million, incurring a realized loss of around $55.45 million compared to its average cost basis. This move, contradicting Saylor's long-standing "never sell" Bitcoin philosophy, was executed to pay dividends on its digital credit securities. The article traces this shift from a small "desensitization test" sale of 32 BTC in late May to the board's authorization on June 30th to sell up to $1.25 billion in Bitcoin for corporate purposes like dividends and buybacks. Analysis reveals that MicroStrategy's previous growth "flywheel"—using stock premiums to fund more Bitcoin purchases—has stalled. With its stock trading near a critical threshold (1.22x its Bitcoin NAV), issuing new shares would dilute value. Simultaneously, its financing channels (preferred stock, common stock ATM, convertible notes) are constrained while facing rigid annual dividend/interest obligations of roughly $1.76 billion. Consequently, selling Bitcoin became the calculated "optimal solution" under its own financial model. This transforms MicroStrategy from crypto's most prominent steady buyer into a predictable seller, creating a potential overhead of ~2,400 BTC in monthly selling pressure if obligations are fully covered by sales. This shift challenges the valuation models of the entire Digital Asset Treasury (DAT) sector that emulated MicroStrategy. The company's path forward now hinges on Bitcoin's price recovery, which would allow its preferred stock to trade at par and reopen its financing flywheel, creating a cyclical dependency between the firm's financial model and the asset it holds.

链捕手42m ago

Losing $55 Million to Sell Bitcoin, MicroStrategy's Faith Reaches Its Interest Payment Day

链捕手42m ago

OUSD Fake Partnership Controversy? Stablecoins and the Credit Game of Giant Endorsements

Author: Chloe, ChainCatcher Last week, Open Standard launched the dollar stablecoin OpenUSD (OUSD) with a list of over 140 supposedly supporting companies, including major names like Visa, Mastercard, Stripe, American Express, BlackRock, BNY, Standard Chartered, Google, Shopify, Samsung, Coinbase, Solana, and Ripple. The announcement initially impacted Circle's stock price, but doubts about the list quickly emerged. Several Korean firms named, including Samsung Electronics, Shinhan Financial Group, Dunamu (Upbit's parent), and K Bank, clarified they had not formally agreed to join the alliance. Some stated they were only approached for potential interest or learned of their inclusion from news reports, expressing surprise. Similar concerns were raised by U.S. entities, suggesting the list may be misleading. OUSD, led by Zach Abrams of Bridge (acquired by Stripe in 2024), promotes zero-fee minting/redemption, no transaction limits, and sharing reserve asset yields with partners instead of keeping profits. However, this model makes listed partnership imply economic benefits, turning it into a serious credibility issue. This incident reflects a common crypto marketing tactic of leveraging big names. A Chainstory analysis found over 62% of crypto press releases in late 2025 were high-risk or scams. The situation recalls Facebook's Libra (later Diem), which collapsed in 2022 after initial heavyweight backers like Visa and PayPal withdrew under regulatory pressure. Circle CEO Jeremy Allaire welcomed the competition but highlighted the challenges. He argued stablecoin success relies on network effects and real usage, not just alliances. He criticized OUSD's "free" model and full revenue sharing as potentially starving infrastructure development. Noting the dominance of USDT (~$1.84T) and USDC (~$730B) in the ~$2.91T stablecoin market, he suggested many new entrants lack real utility despite inflated circulation from incentives. In conclusion, while OUSD has genuine backing and a distinct model, its future depends on actual adoption in B2B payments, settlements, and cross-border transactions, not just a prestigious partner list. The market will determine if it is a credible challenger or merely another marketing promise.

链捕手44m ago

OUSD Fake Partnership Controversy? Stablecoins and the Credit Game of Giant Endorsements

链捕手44m ago

Trading

Spot

Hot Articles

How to Buy T

Welcome to HTX.com! We've made purchasing Threshold Network Token (T) simple and convenient. Follow our step-by-step guide to embark on your crypto journey.Step 1: Create Your HTX AccountUse your email or phone number to sign up for a free account on HTX. Experience a hassle-free registration journey and unlock all features.Get My AccountStep 2: Go to Buy Crypto and Choose Your Payment MethodCredit/Debit Card: Use your Visa or Mastercard to buy Threshold Network Token (T) instantly.Balance: Use funds from your HTX account balance to trade seamlessly.Third Parties: We've added popular payment methods such as Google Pay and Apple Pay to enhance convenience.P2P: Trade directly with other users on HTX.Over-the-Counter (OTC): We offer tailor-made services and competitive exchange rates for traders.Step 3: Store Your Threshold Network Token (T)After purchasing your Threshold Network Token (T), store it in your HTX account. Alternatively, you can send it elsewhere via blockchain transfer or use it to trade other cryptocurrencies.Step 4: Trade Threshold Network Token (T)Easily trade Threshold Network Token (T) on HTX's spot market. Simply access your account, select your trading pair, execute your trades, and monitor in real-time. We offer a user-friendly experience for both beginners and seasoned traders.

12.3k Total ViewsPublished 2024.03.29Updated 2026.06.02

How to Buy T

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of T (T) are presented below.

活动图片