refactor: centralize client identity (#38148)

This commit is contained in:
Dax 2026-07-21 14:01:04 -04:00 committed by GitHub
commit 9c38358197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 102 additions and 94 deletions

View file

@ -1,10 +1,11 @@
#!/usr/bin/env bun
import { NodeRuntime, NodeServices } from "@effect/platform-node"
import { Effect } from "effect"
import { Effect, Layer } from "effect"
import { Commands } from "./commands/commands"
import { Runtime } from "./framework/runtime"
import { Observability } from "@opencode-ai/util/observability"
import { Client } from "@opencode-ai/util/client"
import { Updater } from "./services/updater"
import { InstallationChannel, InstallationVersion, InstallationLocal } from "@opencode-ai/util/installation/version"
import { LayerNode } from "@opencode-ai/util/effect/layer-node"
@ -73,8 +74,7 @@ Effect.logInfo("cli starting", {
Observability.layer({
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
client: process.env.OPENCODE_CLIENT ?? "cli",
}),
}).pipe(Layer.provide(Client.layer(process.env.OPENCODE_CLIENT))),
),
Effect.provide(NodeServices.layer),
Effect.scoped,