Repository navigation
Fix OpenCode skill command refresh - #80
Conversation
|
Here is my review of the PR. Confidence Score: 4/5 Issues1. State inconsistency if server restart fails — All connections are torn down and project registries cleared before stopping/starting the server. If async function refreshLocalOpenCodeAfterSkillsChange() {
for (const state of windowStates.values()) {
for (const conn of state.projectRegistry.values()) conn.teardown();
state.projectRegistry.clear();
}
const stopped = await stopLocalOpenCodeServer();
if (!stopped.success) return stopped; // ← connections already destroyed
return await startLocalOpenCodeServer();
}Consider moving destructive work (teardown/clear) to only after confirming the restart succeeds, or adding recovery logic. 2. Unhandled throw in teardown loop ( If any single for (const conn of state.projectRegistry.values()) conn.teardown();Wrap each call in a try-catch or use 3. Misleading variable name ( const stopped = await stopLocalOpenCodeServer();
if (!stopped.success) return stopped;
4. Silent catch swallowing errors across all frontend changes In try {
await action();
await fetchInstalled();
await refreshProviders();
} catch {}If SummaryThe PR correctly solves the described problem — including OpenCode skills as slash commands and refreshing state after skill operations. The backend restart and frontend provider refresh are well-coordinated. No correctness bugs found. The issues above are robustness/observability concerns rather than logic errors. |

Summary
Testing