Init Commands: Guardrails from the Start
How to update your init files
Episode 4
How to update your init files
The developer encountered a bug in the beta version of their Solo desktop app where the application hung when a user opened multiple instances of OpenCode. The issue stemmed from improper handling of back pressure caused by the high frequency of updates from OpenCode's TUI overwhelming the main thread. The developer fixed the bug by decoupling acknowledgement from rendering and addressing Zustand store performance bottlenecks. To prevent future regressions, the developer used a command (update_init_tari) to update their "Tari rules" (a set of guidelines or best practices) with the lessons learned from the bug fix. The process involved using the AI (likely Claude) to analyze the conversation and extract key insights like the need for back pressure in high-frequency Rust front-end streaming, avoiding O(N) operations in the Zustand store, and never disabling back pressure. The AI then proposed adding these learnings to the Tari init file, which the developer approved. Finally, the developer updated both a global initializer file and a project-specific copy of the rules to ensure the lessons are applied across projects, with a plan to update other projects as well.