Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
timeout-minutes: 45
run: GITHUB_ACTIONS=false bun turbo test
env:
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}
CODEV_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}

- name: Check generated client
if: runner.os == 'Linux'
Expand Down
4 changes: 2 additions & 2 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ _Avoid_: Response envelope
- **Native Continuation Metadata** remains in durable history. Provider-turn projection includes it only for a successful exact originating provider/model match; failed turns and incompatible models omit opaque metadata, while non-empty visible reasoning lowers to ordinary assistant text after a model switch. This conservative relation may widen only when recorded provider tests establish compatibility.
- **Model Request Options** remain provider-semantic through Catalog resolution. The Session runner maps them into the LLM package's provider-option namespace; the selected protocol adapter alone owns provider wire encoding.
- **Generation Controls**, protocol-semantic **Model Request Options**, and compatibility request body fields are separate Catalog domains. A shared ingestion adapter partitions legacy and models.dev AI-SDK-shaped options before routing.
- The **PTY Environment** is a server concern rather than a Core PTY concern. PTY creation merges caller values, then the host overlay, then Core-forced terminal invariants such as `TERM` and `OPENCODE_TERMINAL`.
- The **PTY Environment** is a server concern rather than a Core PTY concern. PTY creation merges caller values, then the host overlay, then Core-forced terminal invariants such as `TERM` and `CODEV_TERMINAL`.
- Networked and **Embedded CoDev Code** use the same **CoDev Code Client** and preserve the full HTTP encoding, routing, middleware, and decoding boundary; only the `HttpClient` transport differs.
- The Effect-native network constructor obtains `HttpClient.HttpClient` from its environment so callers own transport selection, recording, tracing, retries, and tests. Convenience runtimes may provide a fetch transport separately.
- Creating **Embedded CoDev Code** is scoped. Closing its owning Scope releases the in-process server resources, database resources, registrations, and fibers.
Expand Down Expand Up @@ -185,7 +185,7 @@ _Avoid_: Response envelope
- A **PTY Environment** adapter observes plugins in the request Location while passing the resolved PTY working directory to the hook; standalone servers use an empty adapter.
- A **Mid-Conversation System Message** lowers to the provider's native chronological instruction role when supported and to a wrapped chronological fallback otherwise.
- When the effective aggregate instruction set changes, its **Mid-Conversation System Message** includes the complete current ordered set and supersedes the prior aggregate value; when no ambient instructions remain, the message states that previously loaded instructions no longer apply.
- Ambient project instruction discovery honors `OPENCODE_DISABLE_PROJECT_CONFIG`; global instructions remain eligible.
- Ambient project instruction discovery honors `CODEV_DISABLE_PROJECT_CONFIG`; global instructions remain eligible.
- Oversized textual **Model Tool Output** retains a bounded preview in Session history while its complete text moves to managed tool-output storage. Arbitrary structured-result size is a separate concern.
- One tool settlement receives one aggregate textual limit, using the configured maximum lines or UTF-8 bytes, whichever is reached first. The limit is provider-independent; token pressure belongs to context assembly and compaction.
- Generic truncation preserves the beginning and end of textual output. Tools may apply a more meaningful strategy before the Tool Registry enforces the final limit.
Expand Down
22 changes: 12 additions & 10 deletions DIVERGENCES.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you need true isolation, run CoDev Code inside a Docker container or VM.

### Server Mode

Server mode is opt-in only. When enabled, set `OPENCODE_SERVER_PASSWORD` to require HTTP Basic Auth. Without this, the server runs unauthenticated (with a warning). It is the end user's responsibility to secure the server - any functionality it provides is not a vulnerability.
Server mode is opt-in only. When enabled, set `CODEV_SERVER_PASSWORD` to require HTTP Basic Auth. Without this, the server runs unauthenticated (with a warning). It is the end user's responsibility to secure the server - any functionality it provides is not a vulnerability.

### Out of Scope

Expand Down
10 changes: 5 additions & 5 deletions infra/enterprise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ new sst.cloudflare.x.SolidStart("Teams", {
buildCommand: "bun run build:cloudflare",
link: [SECRET.SupportApiKey],
environment: {
OPENCODE_STORAGE_ADAPTER: "r2",
OPENCODE_STORAGE_ACCOUNT_ID: sst.cloudflare.DEFAULT_ACCOUNT_ID,
OPENCODE_STORAGE_ACCESS_KEY_ID: SECRET.R2AccessKey.value,
OPENCODE_STORAGE_SECRET_ACCESS_KEY: SECRET.R2SecretKey.value,
OPENCODE_STORAGE_BUCKET: storage.name,
CODEV_STORAGE_ADAPTER: "r2",
CODEV_STORAGE_ACCOUNT_ID: sst.cloudflare.DEFAULT_ACCOUNT_ID,
CODEV_STORAGE_ACCESS_KEY_ID: SECRET.R2AccessKey.value,
CODEV_STORAGE_SECRET_ACCESS_KEY: SECRET.R2SecretKey.value,
CODEV_STORAGE_BUCKET: storage.name,
},
})
8 changes: 4 additions & 4 deletions nix/opencode.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {
'';

env.MODELS_DEV_API_JSON = "${models-dev}/dist/_api.json";
env.OPENCODE_DISABLE_MODELS_FETCH = true;
env.OPENCODE_VERSION = finalAttrs.version;
env.OPENCODE_CHANNEL = "prod";
env.CODEV_DISABLE_MODELS_FETCH = true;
env.CODEV_VERSION = finalAttrs.version;
env.CODEV_CHANNEL = "prod";

buildPhase = ''
runHook preBuild
Expand Down Expand Up @@ -91,7 +91,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
writableTmpDirAsHomeHook
];
doInstallCheck = true;
versionCheckKeepEnvironment = [ "HOME" "OPENCODE_DISABLE_MODELS_FETCH" ];
versionCheckKeepEnvironment = [ "HOME" "CODEV_DISABLE_MODELS_FETCH" ];
versionCheckProgramArg = "--version";

passthru = {
Expand Down
8 changes: 4 additions & 4 deletions packages/app/e2e/performance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The suite contains:
- cached session repaint and mutation tracing
- streaming timeline throughput, RAF-gap, long-task, geometry, and remount diagnostics

All benchmarks import the shared `benchmark` fixture. Pages created through Playwright's `page` fixture automatically capture main-frame navigation history and emit a Chrome trace when `OPENCODE_PERFORMANCE_TRACE_DIR` is set. Benchmarks that need isolated browser contexts use `withBenchmarkPage`, which owns the context and the same diagnostics lifecycle.
All benchmarks import the shared `benchmark` fixture. Pages created through Playwright's `page` fixture automatically capture main-frame navigation history and emit a Chrome trace when `CODEV_PERFORMANCE_TRACE_DIR` is set. Benchmarks that need isolated browser contexts use `withBenchmarkPage`, which owns the context and the same diagnostics lifecycle.

New benchmarks should look like normal Playwright tests:

Expand Down Expand Up @@ -58,10 +58,10 @@ Committed smoke and regression tests continue to own correctness coverage for pa

## Chrome traces

Set `OPENCODE_PERFORMANCE_TRACE_DIR` to emit a standard Chrome DevTools trace for every benchmark page automatically:
Set `CODEV_PERFORMANCE_TRACE_DIR` to emit a standard Chrome DevTools trace for every benchmark page automatically:

```sh
OPENCODE_PERFORMANCE_TRACE_DIR=/tmp/opencode-performance-traces \
CODEV_PERFORMANCE_TRACE_DIR=/tmp/opencode-performance-traces \
bunx playwright test --config e2e/performance/playwright.config.ts \
timeline/session-tab-switch-benchmark.spec.ts
```
Expand All @@ -74,6 +74,6 @@ Trace capture mirrors [Puppeteer's official tracing defaults and lifecycle](http
bunx devtools-tracing stats <trace-path-from-BENCHMARK_PAGE>
```

INP analysis requires a trace with a supported navigation/interaction insight. Selector statistics require a trace captured with `OPENCODE_PERFORMANCE_SELECTOR_TRACE=1`.
INP analysis requires a trace with a supported navigation/interaction insight. Selector statistics require a trace captured with `CODEV_PERFORMANCE_SELECTOR_TRACE=1`.

`e2e/performance/playwright.uncapped.config.ts` disables Chromium frame-rate limiting for explicit uncapped diagnostics. Native product benchmarks should use the default Playwright configuration.
6 changes: 3 additions & 3 deletions packages/app/e2e/performance/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const benchmark = base.extend<BenchmarkFixtures>({
console.log(
`BENCHMARK ${JSON.stringify({
schemaVersion: 2,
runID: process.env.OPENCODE_PERFORMANCE_RUN_ID,
runID: process.env.CODEV_PERFORMANCE_RUN_ID,
name: benchmarkName(testInfo),
status: missing ? "failed" : testInfo.status,
expectedStatus: testInfo.expectedStatus,
Expand Down Expand Up @@ -122,15 +122,15 @@ async function reportPerformancePage(name: string, diagnostics: PerformancePageD
console.log(
`BENCHMARK_PAGE ${JSON.stringify({
schemaVersion: 2,
runID: process.env.OPENCODE_PERFORMANCE_RUN_ID,
runID: process.env.CODEV_PERFORMANCE_RUN_ID,
name,
test: testInfo ? benchmarkName(testInfo) : undefined,
retry: testInfo?.retry,
repeatEachIndex: testInfo?.repeatEachIndex,
context: {
platform: process.platform,
trace,
selectorTrace: process.env.OPENCODE_PERFORMANCE_SELECTOR_TRACE === "1",
selectorTrace: process.env.CODEV_PERFORMANCE_SELECTOR_TRACE === "1",
},
navigations: diagnostics.navigations,
})}`,
Expand Down
6 changes: 3 additions & 3 deletions packages/app/e2e/performance/chrome-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const categories = [
]

export async function startChromeTrace(page: Page, name: string) {
const directory = process.env.OPENCODE_PERFORMANCE_TRACE_DIR
const directory = process.env.CODEV_PERFORMANCE_TRACE_DIR
if (!directory) return

const selectors = process.env.OPENCODE_PERFORMANCE_SELECTOR_TRACE === "1"
const selectors = process.env.CODEV_PERFORMANCE_SELECTOR_TRACE === "1"
const file = await prepareChromeTrace(directory, name, selectors)
const session = await page.context().newCDPSession(page)
try {
Expand Down Expand Up @@ -73,7 +73,7 @@ export async function prepareChromeTrace(
nonce = randomUUID().slice(0, 8),
) {
await mkdir(directory, { recursive: true })
const run = process.env.OPENCODE_PERFORMANCE_RUN_ID ?? "manual"
const run = process.env.CODEV_PERFORMANCE_RUN_ID ?? "manual"
const hash = createHash("sha256").update(name).digest("hex").slice(0, 8)
return path.join(
directory,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/e2e/performance/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import config from "../../playwright.config"

const port = Number(process.env.PLAYWRIGHT_PORT ?? 3000)
process.env.PLAYWRIGHT_SERVER_PORT = String(port)
process.env.OPENCODE_PERFORMANCE_RUN_ID ??= `${new Date().toISOString().replace(/[:.]/g, "-")}-${process.pid}`
process.env.CODEV_PERFORMANCE_RUN_ID ??= `${new Date().toISOString().replace(/[:.]/g, "-")}-${process.pid}`

export default {
...config,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/e2e/performance/timeline-stability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The suite does not provide complete coverage for:

Playwright video, trace, screenshots, and observation JSON are diagnostic evidence. They are not pixel baselines and do not participate in normal pass/fail decisions.

For optional before/violation/after screenshots, set `OPENCODE_STABILITY_CAPTURE=1`. Capture is opt-in because compositor readback can perturb timing.
For optional before/violation/after screenshots, set `CODEV_STABILITY_CAPTURE=1`. Capture is opt-in because compositor readback can perturb timing.

## Test Layers

Expand Down
2 changes: 1 addition & 1 deletion packages/app/e2e/utils/visual-stability/capture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type VisualCapture = {
}

export async function startVisualCapture(page: Page, startedAtEpoch: number) {
if (process.env.OPENCODE_STABILITY_CAPTURE !== "1") return
if (process.env.CODEV_STABILITY_CAPTURE !== "1") return
const session = await page.context().newCDPSession(page)
await session.send("Page.enable")
const recording: VisualCapture = {
Expand Down
6 changes: 3 additions & 3 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const reuse = !process.env.CI
const workers = Number(process.env.PLAYWRIGHT_WORKERS ?? (process.env.CI ? 5 : 0)) || undefined
export default defineConfig({
testDir: "./e2e",
testIgnore: process.env.OPENCODE_PERFORMANCE === "1" ? "performance/**/*.test.ts" : "performance/**",
testIgnore: process.env.CODEV_PERFORMANCE === "1" ? "performance/**/*.test.ts" : "performance/**",
outputDir: "./e2e/test-results",
timeout: 60_000,
expect: {
Expand All @@ -26,8 +26,8 @@ export default defineConfig({
reuseExistingServer: reuse,
timeout: 120_000,
env: {
VITE_OPENCODE_SERVER_HOST: serverHost,
VITE_OPENCODE_SERVER_PORT: serverPort,
VITE_CODEV_SERVER_HOST: serverHost,
VITE_CODEV_SERVER_PORT: serverPort,
},
},
use: {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/help-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createSignal, Show } from "solid-js"
import { createStore } from "solid-js/store"

export function HelpButton() {
if (import.meta.env.VITE_OPENCODE_CHANNEL !== "dev") return null
if (import.meta.env.VITE_CODEV_CHANNEL !== "dev") return null

const [state, setState] = /* persisted(Persist.global("help-button"), */ createStore({ dismissed: false }) /* ) */
const [shown, setShown] = createSignal(false)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/settings-v2/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export const SettingsGeneralV2: Component<{
</div>
</SettingsRowV2>

<Show when={mobile() && import.meta.env.VITE_OPENCODE_CHANNEL !== "prod"}>
<Show when={mobile() && import.meta.env.VITE_CODEV_CHANNEL !== "prod"}>
<SettingsRowV2
title={language.t("settings.general.row.mobileTitlebarBottom.title")}
description={language.t("settings.general.row.mobileTitlebarBottom.description")}
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ function TitlebarUpdateIconButton(props: { state: TitlebarUpdatePillState }) {
function ChannelIndicator() {
return (
<>
{["beta", "dev"].includes(import.meta.env.VITE_OPENCODE_CHANNEL) && (
{["beta", "dev"].includes(import.meta.env.VITE_CODEV_CHANNEL) && (
<div class="bg-icon-interactive-base text-[#FFF] font-medium px-2 rounded-sm uppercase font-mono">
{import.meta.env.VITE_OPENCODE_CHANNEL.toUpperCase()}
{import.meta.env.VITE_CODEV_CHANNEL.toUpperCase()}
</div>
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/context/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface Settings {
export const monoDefault = "System Mono"
export const sansDefault = "System Sans"
export const terminalDefault = "JetBrainsMono Nerd Font Mono"
export const newLayoutDesignsDefault = import.meta.env.VITE_OPENCODE_CHANNEL !== "prod"
export const newLayoutDesignsDefault = import.meta.env.VITE_CODEV_CHANNEL !== "prod"

const monoFallback =
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if (!(root instanceof HTMLElement) && import.meta.env.DEV) {
const getCurrentUrl = () => {
if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
if (import.meta.env.DEV)
return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
return `http://${import.meta.env.VITE_CODEV_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_CODEV_SERVER_PORT ?? "4096"}`
return location.origin
}

Expand Down Expand Up @@ -147,7 +147,7 @@ if (import.meta.env.VITE_SENTRY_DSN) {
integrations: (integrations) => {
return integrations.filter(
(i) =>
i.name !== "Breadcrumbs" && !(import.meta.env.OPENCODE_CHANNEL === "prod" && i.name === "GlobalHandlers"),
i.name !== "Breadcrumbs" && !(import.meta.env.CODEV_CHANNEL === "prod" && i.name === "GlobalHandlers"),
)
},
})
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interface ImportMetaEnv {
readonly VITE_OPENCODE_SERVER_HOST: string
readonly VITE_OPENCODE_SERVER_PORT: string
readonly VITE_OPENCODE_CHANNEL?: "dev" | "beta" | "prod"
readonly VITE_CODEV_SERVER_HOST: string
readonly VITE_CODEV_SERVER_PORT: string
readonly VITE_CODEV_CHANNEL?: "dev" | "beta" | "prod"

readonly VITE_SENTRY_DSN?: string
readonly VITE_SENTRY_ENVIRONMENT?: string
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/pages/layout/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export function homeSessionServerStatus(active: boolean, status: () => { working
return status()
}

const OPENCODE_PROJECT_ID = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"
const CODEV_PROJECT_ID = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"

export function getProjectAvatarSource(id?: string, icon?: { color?: string; url?: string; override?: string }) {
if (id === OPENCODE_PROJECT_ID) return "https://opencode.ai/favicon.svg"
if (id === CODEV_PROJECT_ID) return "https://opencode.ai/favicon.svg"
if (icon?.override) return icon.override
if (icon?.color) return undefined
return icon?.url
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/new-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useSettingsDialog } from "@/components/settings-dialog"
import { Persist, persisted } from "@/utils/persist"
import createPresence from "solid-presence"

const workspaceBarEnabled = import.meta.env.VITE_OPENCODE_CHANNEL !== "prod"
const workspaceBarEnabled = import.meta.env.VITE_CODEV_CHANNEL !== "prod"
const providerTipDismissalDuration = 30 * 24 * 60 * 60 * 1000
const providerTipExitDuration = 250

Expand Down
6 changes: 3 additions & 3 deletions packages/app/vite.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { fileURLToPath } from "url"
const theme = fileURLToPath(new URL("./public/oc-theme-preload.js", import.meta.url))

const channel = (() => {
const raw = process.env.OPENCODE_CHANNEL
const raw = process.env.CODEV_CHANNEL
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
if (process.env.OPENCODE_CHANNEL === "latest") return "prod"
if (process.env.CODEV_CHANNEL === "latest") return "prod"
return "dev"
})()

Expand All @@ -26,7 +26,7 @@ export default [
},
},
define: {
"import.meta.env.VITE_OPENCODE_CHANNEL": JSON.stringify(channel),
"import.meta.env.VITE_CODEV_CHANNEL": JSON.stringify(channel),
},
worker: {
format: "es",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/bin/lildax.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function run(target) {
})
}

const envPath = process.env.OPENCODE_BIN_PATH
const envPath = process.env.CODEV_BIN_PATH
const scriptDir = path.dirname(fs.realpathSync(__filename))
const cached = path.join(scriptDir, ".lildax")
const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[os.platform()] || os.platform()
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ for (const item of targets) {
windows: {},
},
define: {
OPENCODE_VERSION: `'${Script.version}'`,
OPENCODE_CLI_NAME: `'${binary}'`,
OPENCODE_MODELS_DEV: modelsData,
OPENCODE_CHANNEL: `'${Script.channel}'`,
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "undefined",
CODEV_VERSION: `'${Script.version}'`,
CODEV_CLI_NAME: `'${binary}'`,
CODEV_MODELS_DEV: modelsData,
CODEV_CHANNEL: `'${Script.channel}'`,
CODEV_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "undefined",
// FFF_LIBC selects the fff native lib variant: "musl" or "gnu".
FFF_LIBC: item.os === "linux" ? `'${item.abi ?? "gnu"}'` : "undefined",
OTUI_TREE_SITTER_WORKER_PATH:
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/script/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.dev"
const modelsUrl = process.env.CODEV_MODELS_URL || "https://models.dev"

export const modelsData = process.env.MODELS_DEV_API_JSON
? await Bun.file(process.env.MODELS_DEV_API_JSON).text()
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/commands.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Argument, Flag } from "effect/unstable/cli"
import { Spec } from "../framework/spec"

declare const OPENCODE_CLI_NAME: string | undefined
declare const CODEV_CLI_NAME: string | undefined

export const Commands = Spec.make(typeof OPENCODE_CLI_NAME === "string" ? OPENCODE_CLI_NAME : "opencode", {
export const Commands = Spec.make(typeof CODEV_CLI_NAME === "string" ? CODEV_CLI_NAME : "opencode", {
description: "OpenCode 2.0 preview command line interface",
commands: [
Spec.make("api", {
Expand Down
4 changes: 2 additions & 2 deletions packages/codev-gateway/src/auth-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ interface AuthFileContents {
// Keyed off the hub's auth.json rather than the ~/.codev-hub/ dir (mirroring
// the hub's own fresh-install check): unrelated code creates the directory,
// so only the file signals a hub session worth adopting. Home is resolved per
// call via OPENCODE_TEST_HOME (same convention as core's Global) because
// call via CODEV_TEST_HOME (same convention as core's Global) because
// Bun's homedir() ignores runtime HOME changes, which tests rely on.
function authDir() {
const home = process.env.OPENCODE_TEST_HOME ?? homedir()
const home = process.env.CODEV_TEST_HOME ?? homedir()
const hub = join(home, ".codev-hub")
if (existsSync(join(hub, "auth.json"))) return hub
return join(home, ".codev")
Expand Down
Loading
Loading