Repository navigation
Conversation
…loop - Defer client.status() check in lib/v2/tui.tsx from setup() to open(). In OpenCode v2, plugins initialize concurrently while the server defers handling RPC requests until activation completes (awaitActivation). Invoking RPC during setup() causes a circular startup wait that triggers watchdog stalls. - Make default prompt file initialization idempotent in lib/prompts/store.ts by checking directory existence before writing defaults, preventing recursive inotify events when watching configuration paths.
|
Confirming this on DCP 3.2.0 + OpenCode 2.2.5 (Linux). Exact symptom: The 503 is collateral, not the cause: in the same ~10 ms window the server also returned 503 for Applying the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses two issues affecting OpenCode v2 (
opencode v2):Eliminate 5000ms TUI setup watchdog stall (
role=cli)In
lib/v2/tui.tsx,setup(ctx)previously calledawait client.status({}, options())directly during plugin initialization.In OpenCode v2, plugins initialize concurrently while the server defers handling incoming RPC requests until plugin activation completes (
awaitActivation). Making an RPC call duringsetup()creates a circular wait that causes OpenCode's client watchdog timeout to fire after 5000ms:By moving the
client.statuscheck intoopen()(prior to requesting the snapshot),setup(ctx)returns immediately and plugin registration completes in <1ms without stalling CLI startup.Prevent inotify directory watcher loop during prompt defaults initialization
In
lib/prompts/store.ts,ensureDefaultFiles()previously executed directory creation on every startup without guarding on directory existence. When OpenCode watches configuration directories (such as~/.config/opencode), touching directories on startup can trigger recursive inotify events and plugin reconciliation cycles. CheckingexistsSync(this.paths.defaultsDir)ensures prompt directory creation is idempotent and avoids redundant inotify events.Testing & Verification
npm test: all 119 DCP tests + 8 request logger tests pass.npm run typecheck: clean (0 errors).npm run check:package: package tarball builds and verification passes./dcpdialog opens and operates as expected.