-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hi @zenobi-us,
I've been using the opencode-background plugin and ran into an issue with the currently published npm version.
Findings
-
The latest version on npm is v0.1.0-alpha.2 (published about a month ago).
-
This version has bugs that prevent it from working correctly in my setup (tools are callable but throw validation errors when used).
-
I cloned the repository, checked out the main branch (which appears to be at or beyond v0.2.0-alpha.2), installed it locally (
~/.config/opencode/plugin/), and tested it with OpenCode 1.1.1. -
The main branch version works perfectly — no errors, and background process management functions as expected.
Specific Error
With v0.1.0-alpha.2, attempting to use tools like createBackgroundProcess results in the following validation error:
[
{
"code": "invalid_union",
"errors": [
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"state",
"output"
],
"message": "Invalid input: expected string, received object"
}
],
[
{
"expected": "object",
"code": "invalid_type",
"path": [
"part"
],
"message": "Invalid input: expected object, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"delta"
],
"message": "Invalid input: expected string, received undefined"
}
],
[
{
"expected": "object",
"code": "invalid_type",
"path": [
"part"
],
"message": "Invalid input: expected object, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"delta"
],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [],
"message": "Invalid input"
}
]
This appears to be caused by the plugin returning JSON strings instead of native JavaScript objects/arrays, which breaks OpenCode's tool schema validation.
Request
Could you please publish the latest changes (ideally v0.2.0-alpha.2 or the current main branch) to npm as a new version (e.g., v0.2.0-alpha.2 or higher)?
The v0.2.0-alpha.2 release notes mention an OIDC-based npm publishing setup, so it might just need a small trigger or fix to get the automated publish working again.
This would make the fixed version easily accessible via the standard opencode.json plugin entry without requiring local clones for everyone.
Thanks for the plugin — it's super useful when it works! Let me know if you need more details about the errors or my setup.
Best,
MBanucu