Skip to content

fix(opencode): keep service restart available in troubleshooting - #844

Merged
pascalandr merged 2 commits into
devfrom
fix/opencode-restart-troubleshooting
Oct 4, 2026
Merged

pascalandr merged 2 commits into
devfrom
fix/opencode-restart-troubleshooting

Conversation

@pascalandr

@pascalandr pascalandr commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

I added a permanent Restart OpenCode service control under Settings → OpenCode → Troubleshooting, shared with startup recovery. It confirms interruption of active work across connected clients and does not delete session history. The existing post-update shortcut remains available.

I enabled authenticated same-version restarts through the existing host/WSL lifecycle while retaining downgrade/unknown-version fences, mutation serialization and no automatic retry. Configuration reload remains a separate action that does not replace the daemon process. This is a troubleshooting tool, not a fix for the memory behavior reported in #833.

Validation

  • Final commit 84b4c743e447a7bb68b81e2a276389f94d4dcbaf: 23 service/reconnect tests and 29 real Solid/Chromium setup tests passed.
  • UI and server typechecks passed; production UI build passed.
  • Browser captures inspected, including French settings at 390px.
  • Native desktop packaging/live installed-application validation was not performed; no shared daemon was restarted.

The ten touched packages/ui/src/lib/i18n/messages/*/settings.ts translation files remain approximately 692–706 lines. No unrelated refactor.

Independent gatekeeper reviews are published below: pass 1 identified one P2 (superseded confirmation could lock the runtime controls); I fixed it and added a browser regression. Pass 2 reviewed the complete final diff and returned zero actionable findings.

Keep an explicit Restart OpenCode service action in the shared settings and recovery Troubleshooting disclosure even when no update is pending. Confirm all-client interruption, preserve session history, fence changed selection and disposed views, and retain the separate inline post-update activation shortcut.

Admit authenticated same-version daemon replacement through the existing host/WSL lifecycle without allowing downgrades, unknown-version replacement, missing restart capability or automatic retry. Configuration reload remains a distinct process-preserving action, and troubleshooting never resumes a pending workspace-open continuation.

Add all ten locale translations and document the lifecycle distinction. Validate with 23 service/reconnect regressions, 28 real Solid/Chromium setup regressions, server/UI typechecks and a production UI build; native desktop packaging was not performed.

@pascalandr pascalandr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatekeeper review — pass 1

I commissioned an independent review of 50ea617955493798c123a971f8f580fd21958b20. It identified one actionable P2 finding:

Superseded restart confirmation leaves runtime controls disabled (packages/ui/src/components/settings/opencode-setup-panel.tsx:20–25). If a session execution error replaces the pending global confirmation, its promise is never settled. After dismissing the error, restart, reload and status controls remain disabled until the panel remounts. The reviewer reproduced this in the real browser fixture with zero service mutations.

I will settle superseded confirmations as cancelled, add a regression and request another independent review. No other actionable findings were identified. The reviewer ran 50 isolated server/lifecycle tests, 28 browser tests and both typechecks successfully. Native desktop/shared-daemon mutation validation was not performed.

Settle a replaced singleton confirmation as false and a replaced prompt as null without invoking action callbacks. Asynchronous session-error alerts can otherwise strand the troubleshooting restart confirmation and leave the runtime controls disabled until remount.

Add a real-browser regression covering restart confirmation replacement by alert, confirmation and prompt, restored maintenance controls, prompt cancellation and no service mutations. This addresses the P2 finding from gatekeeper review pass 1 on PR #844.

@pascalandr pascalandr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatekeeper review — pass 2: zero actionable findings

I commissioned a second independent review of 84b4c743e447a7bb68b81e2a276389f94d4dcbaf. The reviewer confirmed that the P2 from pass 1 is resolved and found zero actionable findings in the complete PR diff.

Replaced confirmations now resolve as cancelled and replaced prompts as null, releasing pending controls without granting consent or invoking action callbacks. The reviewer also checked replacement ownership and callback suppression independently.

I validated the final commit with 23 service/reconnect tests + 29 real Solid/Chromium tests, UI/server typechecks and a successful production UI build. The added regression covers replacement by alerts, confirmations and prompts, restored controls and zero service mutations. Native desktop packaging/live daemon restart validation remains unperformed.

@pascalandr
pascalandr merged commit 69d33b4 into dev Oct 4, 2026
21 of 28 checks passed
@pascalandr
pascalandr deleted the fix/opencode-restart-troubleshooting branch October 4, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant