fix: sidebar_opencode stuck at 0% loading after failed server startup - #900
fix: sidebar_opencode stuck at 0% loading after failed server startup#900Lemonjuice321 wants to merge 4 commits into
Conversation
…ter failed server startup
…vious failed attempts
…ter failed server startup
…vious failed attempts
About this PRThis PR was co-authored by an AI assistant (Operit's built-in AI agent, running as a "Cyber Beagle" assistant persona) under the guidance of its user @Lemonjuice321. How this bug was foundThe user was setting up OpenCode CLI on their Android device running Operit (proot Ubuntu 24.04, aarch64). They installed the OpenCode binary, configured the API provider, and set up plugins - all through the AI agent's terminal access. When they tried to open the OpenCode sidebar panel, it was permanently stuck at 0%. The AI agent:
Environment
Happy to make any adjustments if needed. |
1 similar comment
About this PRThis PR was co-authored by an AI assistant (Operit's built-in AI agent, running as a "Cyber Beagle" assistant persona) under the guidance of its user @Lemonjuice321. How this bug was foundThe user was setting up OpenCode CLI on their Android device running Operit (proot Ubuntu 24.04, aarch64). They installed the OpenCode binary, configured the API provider, and set up plugins - all through the AI agent's terminal access. When they tried to open the OpenCode sidebar panel, it was permanently stuck at 0%. The AI agent:
Environment
Happy to make any adjustments if needed. |
|
The overall direction makes sense, and I verified the analysis against the current upstream code. I see 1 P1 and 2 P2; I'd suggest addressing the P1 before merging. P1 —
|
AAswordman
left a comment
There was a problem hiding this comment.
Request changes. Setting keepAlive to false recovers from one startup failure by changing the normal lifecycle of the OpenCode sidebar: every ordinary switch away and back destroys and recreates the WebView, losing browser-local UI state such as draft input, scroll position, and open overlays. The added serverUrl condition does not make root onLoad run again for a keep-alive route. Preserve the existing keepAlive lifecycle and add an explicit retry path for ensureServer() in the failure UI instead.
|
感谢你定位并验证 OpenCode 侧栏启动失败后的卡死问题,也感谢你提供了复现过程和修复思路。\n\n我们确认当前改动可以让失败后重新进入页面时重新初始化,但将 keepAlive 设为 alse 会改变侧栏的正常生命周期:用户每次切换离开再回来时,WebView 都会重建,可能丢失输入草稿、滚动位置和页面内状态。因此这个 PR 当前形态我们不会合并。\n\n更合适的方向是保留 keepAlive: true,在启动失败的界面增加明确的 Retry 操作,直接重新调用 �nsureServer(),这样可以修复失败后的恢复问题,同时保留正常使用时的页面状态。感谢你的贡献和理解。 |
Bug: Sidebar OpenCode panel permanently stuck at 0% after failed startup
Problem
The plugin has two issues that cause the OpenCode sidebar panel to become permanently stuck at 0% loading:
Reproduction
Fix
Two changes:
Testing
Tested manually on Operit (Android, proot Ubuntu 24.04 aarch64):