You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: client.app is undefined when passed to plugins, causing crashes in plugin logging #5793
When a plugin attempts to use client.app.log() to write to server logs, it crashes with TypeError: undefined is not an object because client.app is undefined, even though the SDK types declare it as a required (non-optional) property.
Environment
Component
Version
OpenCode
1.0.167
@opencode-ai/plugin
^1.0.169
@opencode-ai/sdk
^1.0.169
OS
Linux (glibc)
Runtime
Bun 1.3.4
Error
TypeError: undefined is not an object (evaluating '_client.app.log')
at log (logger.ts:64:15)
at prepareAntigravityRequest (request.ts:329:9)
at tryEndpointFallbacks (fetch-wrapper.ts:522:83)
Analysis
SDK Type Declaration
In @opencode-ai/sdk, the OpencodeClient class declares app as a required property:
Activity
github-actions commentedon Dec 19, 2025
This issue might be a duplicate of existing issues. Please check:
client.session.summarizehangs forever in Plugin #5449:client.session.summarizehangs forever in Plugin - indicates plugin client methods may not be properly initializedFeel free to ignore if this doesn't address your specific case.
fix(logger): handle undefined client.app with optional chaining
fix(logger): handle undefined client.app with optional chaining
fix(logger): handle undefined client.app with optional chaining