lmnr-ai / lmnr-ai/lmnr-opencode-plugin

OpenCode plugin loads but exports fail with gRPC UNAVAILABLE

Open
#7 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary

In our environment, `@lmnr-ai/opencode-plugin@0.1.2` loads successfully in OpenCode and runs its flush hook, but no spans appear in Laminar. OpenCode logs show gRPC export failures:

```text
14 UNAVAILABLE: No connection established. Last error: undefined.
```

This was tested with other Laminar/OpenCode tracing plugins disabled, so only the official plugin was loaded.

## Environment

- Package: `@lmnr-ai/opencode-plugin@0.1.2`
- OpenCode: `1.14.30`
- Node: `v22.22.2`
- OS: Linux
- `LMNR_PROJECT_API_KEY` was set in the shell where OpenCode was launched

## Isolated config

We used a temporary OpenCode config file with only the official Laminar plugin enabled:

```json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@lmnr-ai/opencode-plugin"]
}
```

Important detail: OpenCode appears to merge `OPENCODE_CONFIG` with global config instead of replacing it, so we temporarily disabled other global plugins before testing. `opencode debug config` then showed only the official plugin loaded from the temporary config.

## Reproduction commands

```bash
OPENCODE_CONFIG=/path/to/temp-opencode-config.json \
opencode debug config

OPENCODE_CONFIG=/path/to/temp-opencode-config.json \
opencode --print-logs --log-level INFO run -m / \
"Reply with exactly: OFFICIAL_LMNR_ONLY_CHECK" --format json
```

We also tried overriding the gRPC port:

```bash
LMNR_GRPC_PORT=443 \
OPENCODE_CONFIG=/path/to/temp-opencode-config.json \
opencode --print-logs --log-level INFO run -m / \
"Reply with exactly: OFFICIAL_LMNR_PORT443_CHECK" --format json
```

## Observed behavior

Both OpenCode runs completed and produced the expected assistant text.

The plugin loaded and reached the flush hook:

```text
service=laminar Flushing OTEL spans before idle
```

But both runs logged gRPC export failures:

```text
ERROR ... service=default e=14 UNAVAILABLE: No connection established. Last error: undefined. Resolution note: rejection
```

Laminar SQL queries for the corresponding runs returned no spans.

## Expected behavior

The plugin should export OpenCode spans to Laminar, or provide a way to use an export path that works in environments where the current gRPC path fails.

For comparison, an isolated local OpenCode plugin using `@opentelemetry/exporter-trace-otlp-proto` with OTLP/HTTP-protobuf to:

```text
https://api.lmnr.ai:443/v1/traces
```

and header:

```text
authorization: Bearer $LMNR_PROJECT_API_KEY
```

successfully exports traces in the same environment.

## Possible direction

Would you consider adding a configurable OTLP/HTTP-protobuf fallback or honoring an env var such as `LMNR_FORCE_HTTP=1` for this plugin? That would make it usable in environments where the current gRPC path fails.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the official plugin's OpenTelemetry setup and flush hook, reproducing the failure with the isolated OPENCODE_CONFIG commands and the LMNR_GRPC_PORT=443 variant. Done means spans from the run appear in Laminar, or the plugin exposes and documents a working OTLP/HTTP-protobuf path such as the one described.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.