fix(core): read stdout and stderr in PackageRegistry.info before waiting for the process to exit#16998
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found one potentially related PR: fix(bun): use direct npm registry fetch for plugin @latest update checks (#16609) This PR appears related because it addresses similar issues around plugin version checking and @latest updates (PR #16998 fixes issue #16608, which this PR addresses). Both PRs are working on the plugin version update mechanism and the isOutdated check functionality. However, the current PR (#16998) is the main fix for the root cause (reading stdout/stderr before process exit), while #16609 may be an alternative or related approach. You may want to review these together to ensure they don't conflict. |
1fc55bd to
59d7896
Compare
|
Confirmed working for me. My plugins that are not pinned are now updating ~/.cache/opencode/package.json to the latest version in the bun registry when restarting Opencode. |
edd2885 to
7c839e2
Compare
…ing for the process to exit The previous implementation waited for the process to exit first, which resulted in empty stdout and stderr. Subsequently, this caused the PackageRegistry.isOutdated check to always return false and log "Failed to resolve latest version, using cached". Fixes anomalyco#16608 Fixes anomalyco#10546 Fixes anomalyco#15673
7c839e2 to
ed4213e
Compare
|
same test failures are occuring in dev currently, don't appear to be related. |
Issue for this PR
Fixes #16608
Fixes #10546
Fixes #15673
Type of change
What does this PR do?
The previous implementation waited for the process to exit first, which resulted in empty
stdoutandstderr. Subsequently, this caused the PackageRegistry.isOutdated check to always return false and logTherefore, plugins that were configured to use
latestas version were never actually updated.To fix this, this change ensures
stdoutandstderrare read while still available. It uses the exact same approach asProcess.run.How did you verify your code works?
I manually tested it with a plugin. I first intentionally installed an older version of the plugin. Then changed it to
@latestin the opencode config. Then we can observe in the logs that the new plugin version is automatically installed when running OpenCode:Checklist