fix(auto-capture): reuse injected opencode client#146
Conversation
|
I tried to merge this PR into the latest
Several structured-output / opencode-provider changes landed in the latest release, which is what this now collides with. Please rebase/merge the latest |
|
i need this because on 2.18.0 the problem still persist |
|
The goal is right: structured auto-capture should reuse OpenCode’s running host context instead of depending on a separately reachable localhost server. I’m going to hold/close this in favor of #161, because this PR routes back through The replacement approach keeps #140’s raw endpoint direction, but uses the host SDK transport (
Closing as superseded by #161, not rejected. |
Summary
ctx.clientinstead of creating a second client fromctx.serverUrl.session.createfailures now include underlying status/error details when available.ctx.serverUrlcan behttp://localhost:4096/even when no REST API is listening there, causingsession.create returned no session idduring auto-capture.Scope
Deployment Targets
opencode-memplugin auto-capture and user-profile structured-output paths that use the shared opencode provider client.ctx.serverUrlclient path.Acceptance Plan
ctx.serverUrlpoints to an unreachable default port; structured-output calls should use the injected client and still passformat,system,model, andpartscorrectly.createStructuredOutputClient()maps v2-style calls onto the injected client without opening a new serverUrl client.Validation
bun test tests/opencode-provider.test.tsbun run format:checkbun run typecheckbun run buildbun test