Skip to content

fix(opencode): flush embedded server telemetry - #39756

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
otel-server-shutdown
Closed

opencode-agent[bot] wants to merge 1 commit into
devfrom
otel-server-shutdown

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • make the embedded server expose and own its web-handler disposal
  • close the embedded server after local opencode run modes finish
  • dispose AppRuntime at the effectCmd ownership boundary instead of importing it from the CLI entrypoint
  • cover OTLP trace flushing with a subprocess integration test

Fixes #30087. Supersedes the lifecycle placement proposed in #30089.

Checks

  • bun test test/cli/run/run-process.test.ts --timeout 60000 -t "flushes server telemetry before exiting"
  • bun test test/cli/run/run-process.test.ts --timeout 60000 -t "exits 0 and writes the response"
  • bun test test/cli/run/run-process.test.ts --timeout 60000 -t "format json preserves reasoning"
  • bun x prettier --check src/server/server.ts src/cli/effect-cmd.ts src/cli/cmd/run.ts test/cli/run/run-process.test.ts

Requested by: @rekram1-node (Aiden Cline via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode run: OTel spans lost because AppRuntime is not disposed before process.exit()

1 participant