Repository navigation
fix(opencode): skip V2 setup when the context has no checkout directory - #4879
Merged
Merged
Conversation
OpenCode 1.18.35 also calls the plugin's setup() with a host registry that carries no `location`. setupV2 defaulted the directory to "" there, logged the loading banner, created the core and registered every hook, so each worker write went out without a cwd and was rejected with "Missing cwd when ingesting observation". Resolve the directory from `location.directory`, falling back to a top-level `directory`. When neither is a non-empty string, warn once and return a no-op cleanup before the banner and createCore. Fixes thedotmack#4878
This comment has been minimized.
This comment has been minimized.
Contributor
[Medium impact] The PR appears safe to merge; no blocking issues were found. Summary
Reviews (2) · Last reviewed commit: "test(opencode): cover an empty location...." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QoXpv5Y2qGRFQEAnhQCi4N
Owner
|
Merged, thank you @drakeo338! When OpenCode calls the plugin's What I pushed:
It's on main and ships in the next release. |
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.
Fixes #4878.
OpenCode 1.18.35 also calls the plugin's
setup()with a host registry that has nolocationordirectory.setupV2defaulted the directory to an empty string there, logged the loading banner, and registered every hook, so each worker write went out without a cwd and was rejected with "Missing cwd when ingesting observation". It now resolves the directory fromlocation.directory(falling back to a top-leveldirectory) and, when neither is a non-empty string, warns once and returns a no-op cleanup before creating the core.The contract test that expected an empty-string fallback is updated; a new test covers the host-registry shape. The opencode contract tests pass on this commit (34 passed, 0 failed).
I used an AI coding assistant for this change and reviewed and tested it myself.