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
opencode run: OTel spans lost because AppRuntime is not disposed before process.exit() #30087
opencode run never emits OTel spans to an OTLP collector because process.exit() in the finally block of index.ts kills the process before the BatchSpanProcessor can flush its buffer.
The AppRuntime wraps a ManagedRuntime whose Observability.layer initializes the OTel NodeSdk with a BatchSpanProcessor. Disposing the runtime would trigger the SDK's shutdown() → forceFlush() chain, but AppRuntime.dispose() is never called.
Root cause
In packages/opencode/src/index.ts:
}finally{process.exit()// kills pending async ops including span export}
Fix
Call await AppRuntime.dispose() before process.exit():
Activity
github-actions commentedon May 31, 2026
This issue might be a duplicate of existing issues. Please check:
opencode rundoes not emit OTel spans to an OTLP collector, even with the relevant env vars set. Your root cause analysis (missingAppRuntime.dispose()beforeprocess.exit()) may explain that issue as well.If this is the same underlying problem, consider contributing the fix to the existing issue or linking them.
astefanutti commentedon May 31, 2026
Yes, this is the root cause of #13438. The fix is in #30089 — one-line change to dispose the runtime before
process.exit().github-actions commentedon Jul 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.