Skip to content

feat(coding-agents): add OpenCode integration - #1591

Merged
ishanjaincodes merged 2 commits into
openlit:mainfrom
remote-controlled-man:feat/opencode-coding-agent-1331
Oct 13, 2026
Merged

ishanjaincodes merged 2 commits into
openlit:mainfrom
remote-controlled-man:feat/opencode-coding-agent-1331

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Issue number: #1331

Change description:

Closes #1331.

This adds first-class OpenCode support across the coding-agent workflow:

  • install the OpenLIT global plugin at $XDG_CONFIG_HOME/opencode/plugins/openlit.ts, falling back to <user-home>/.config/opencode/plugins/openlit.ts
  • route supported OpenCode session, completed-assistant, and tool lifecycle events into the canonical coding-agent telemetry schema
  • de-duplicate completed assistant turns and tool calls, preserve provider/model/token/cost metadata, and account for each turn exactly once when capture mode changes
  • exclude message and reasoning bodies from the OpenCode event projection
  • treat session.idle and session.deleted as non-terminal boundaries; minimal capture emits delta snapshots without fabricating a completed session or outcome
  • keep hook delivery non-blocking with one in-flight emission and at most 32 queued events; when saturated, a later completion or session event may replace an older tool.execute.before hint, while equally important events retain FIFO order
  • add executable queue regressions for deferred spawning, serial delivery, overload behavior, post-drain recovery, and subprocess failure recovery
  • add OpenCode support to install, uninstall, doctor, launch, vendor discovery, onboarding, icons, and public documentation
  • update the Go and TypeScript semantic-convention mirrors and synchronize the source plugin with the CLI's embedded marketplace copy

Validation completed:

  • focused Go package tests passed, including the complete OpenCode hook package plus OpenCode install, uninstall, doctor, and XDG path coverage
  • go build -trimpath ./... passed for the CLI
  • go vet ./... passed for both cli and sdk/go
  • all 4 executable queue tests passed on Node 22, Node 24.20.0, and Bun 1.4.2; the Node 22 command is wired into CLI CI
  • six relevant client Jest suites passed with 129 tests
  • client lint and type checking passed
  • the source and embedded OpenCode plugins have identical SHA-256 hashes
  • changed JSON files parse successfully and git diff --check passes

Local limitations: go test -race -count=1 ./... could not run on this Windows host because GCC is unavailable. The broader non-race runs retain unrelated failures in untouched Windows path, host-cache, and timing tests; the affected packages, build, vet, lint, and type checks above passed. A post-fix Docker-backed OTLP/ClickHouse rerun is not claimed because the local Docker engine was unavailable.

Checklist

  • PR title follows Conventional Commit format.
  • I have reviewed the contributing guidelines
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

@remote-controlled-man
remote-controlled-man requested a review from a team as a code owner September 16, 2026 00:38
@remote-controlled-man
remote-controlled-man requested review from ishanjaincodes and a lite review from Copilot September 16, 2026 00:38

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @remote-controlled-man, your pull request is larger than the review limit of 150,000 diff characters

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@remote-controlled-man
remote-controlled-man force-pushed the feat/opencode-coding-agent-1331 branch from e1fa9f6 to 733730a Compare October 11, 2026 08:41
@ishanjaincodes
ishanjaincodes merged commit 6b97612 into openlit:main Oct 13, 2026
12 checks passed
@ishanjaincodes

Copy link
Copy Markdown
Contributor

Thanks so much for your contribution! And really sorry for the delay in getting to this one. We've had quite a few PRs coming in lately, and it's been a little challenging to keep up with all of them. Really appreciate your patience and support! 🙌

Also, if there's anything else your team would love to see in OpenLIT, I'd be more than happy to chat! Always excited to hear what you're building and explore how we can help solve any challenges along the way.

Feel free to grab some time with me here: https://cal.com/aman.openlit/30min, or reach out directly at [[email protected]](mailto:[email protected]).

@github-actions

Copy link
Copy Markdown

Merged PR summary

  • Go SDK · Features — Add OpenCode vendor constant and LLM turn kind attribute with prompt, response, and thought values to Go semantic conventions.
  • OpenLIT CLI · Features — Adds OpenCode support: hook adapter, install, uninstall, launch, and doctor coverage, emitting session snapshots while ignoring message bodies.
  • OpenLIT · Features — Adds OpenCode to the UI: onboarding steps, vendor icon and label, coding-agent discovery, and snapshot-aware token and counter aggregation.

Generated from the merged PR description and bounded, component-scoped file evidence. Release preparation reuses this validated summary.

@remote-controlled-man
remote-controlled-man deleted the feat/opencode-coding-agent-1331 branch October 13, 2026 10:42

Copy link
Copy Markdown
Contributor Author

Thanks a lot for merging this, @amanagarwal042, and no worries at all about the review time! Glad the OpenCode integration made it in. I'll keep contributing to OpenLIT, and I'm looking forward to the next PR.

This branch was successfully deployed

1 active deployment
release-notes — 5032a8dd Deployed Oct 13, 2026 by ishanjaincodes via Summarize / Merged pull request #182
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.

Feature: Support opencode integration

3 participants