fix(tmux): handle serverUrl throw getter from upstream opencode refactor#2419
Open
guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
Open
fix(tmux): handle serverUrl throw getter from upstream opencode refactor#2419guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
Conversation
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Defensive try-catch fix for an upstream breaking change; safely handles a throwing getter with a fallback and restores functionality without side effects.
b860880 to
309a3e4
Compare
Author
|
recheck |
Collaborator
|
Oh dear |
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
OpenCode upstream commit
89d6f60d(refactor(server): extract createApp function) changedPluginInput.serverUrlfromServer.url()to a throw getter:This causes the entire oh-my-opencode plugin to crash during initialization because
TmuxSessionManagerconstructor accessesctx.serverUrl:Optional chaining (
?.) does not prevent the throw — the getter executes on property access before the nullish check.Impact: All agents, hooks, and tools fail to register. The plugin appears to load but silently crashes.
Fix
Wrap the
serverUrlaccess in a try-catch, falling back tohttp://localhost:{port}:Notes
89d6f60d) is not yet released (current npm is v1.2.17), but affects anyone running from source.serverUrlis available, and gracefully degrades when it's not.Summary by cubic
Prevent tmux subagent crash after upstream
opencodemadePluginInput.serverUrla throwing getter. Guardctx.serverUrlwith try/catch and default tohttp://localhost:${OPENCODE_PORT || 4096}so agents, hooks, and tools register.Written for commit 309a3e4. Summary will update on new commits.