当我们把 OC 迁移到 sqlite 时我犯的最大设计错误:使用同步数据库访问。当它只是一个在 Slack 或 iMessage 上向你汇报的代理时……

·

观点分析 · 2026/09/26

作者回顾将 OC 迁移到 SQLite 时犯下的最大设计错误:使用了同步数据库访问。当时 OC 只是一个通过 Slack 或 iMessage 向用户汇报的代理,同步访问尚可接受;如今单个代理可能并行运行 50 个会话,且整个团队都在使用它,同步访问已成为瓶颈。作者与 Astra 设定了一个目标,目前已提交 575 个 PR,将所有内容迁移到异步工作线程,并在取得进展时逐步发布这些改进。作者感叹,即便是大规模重构也不再令人畏惧。

这篇短文以亲身经历点出同步数据库访问在代理并行化与团队协作场景下的瓶颈,并展示了通过持续小步提交完成大规模异步化重构的可行路径,对面临类似架构演进的技术团队有参考价值。

The biggest design mistake I made when we moved OC to sqlite: using sync db access. When it was just an agent that reports to you on Slack or iMessage this was fine; now that one agent might do 50 sessions in parallel and the whole team works on it, it is limiting.

I have a /goal with Astra that so far landed 575 PRs to move everything to to async workers. We ship these improvements as we make progress. Pretty insane how even huge refactors are no longer scary.

阅读原文

参与讨论