From 57eb329f9a67a513e9e429c47274cf0059d3982e Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Wed, 25 Feb 2026 02:29:45 -0800 Subject: [PATCH] chore: update examples to use opencode --- examples/boxlite-python/Dockerfile | 3 +-- examples/boxlite-python/credentials.py | 11 ++++------- examples/docker-python/credentials.py | 11 ++++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/examples/boxlite-python/Dockerfile b/examples/boxlite-python/Dockerfile index 4564417..faef9f7 100644 --- a/examples/boxlite-python/Dockerfile +++ b/examples/boxlite-python/Dockerfile @@ -1,5 +1,4 @@ FROM node:22-bookworm-slim RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* RUN curl -fsSL https://releases.rivet.dev/sandbox-agent/0.2.x/install.sh | sh -RUN sandbox-agent install-agent claude -RUN sandbox-agent install-agent codex +RUN sandbox-agent install-agent opencode diff --git a/examples/boxlite-python/credentials.py b/examples/boxlite-python/credentials.py index 46114dc..dfa319f 100644 --- a/examples/boxlite-python/credentials.py +++ b/examples/boxlite-python/credentials.py @@ -8,16 +8,13 @@ def detect_agent() -> str: """Pick an agent based on env vars. Exits if no credentials are found.""" if os.environ.get("SANDBOX_AGENT"): return os.environ["SANDBOX_AGENT"] - has_claude = bool( + has_anthropic = bool( os.environ.get("ANTHROPIC_API_KEY") or os.environ.get("CLAUDE_API_KEY") - or os.environ.get("CLAUDE_CODE_OAUTH_TOKEN") ) - has_codex = (os.environ.get("OPENAI_API_KEY") or "").startswith("sk-") - if has_codex: - return "codex" - if has_claude: - return "claude" + has_openai = bool(os.environ.get("OPENAI_API_KEY")) + if has_anthropic or has_openai: + return "opencode" print("No API keys found. Set ANTHROPIC_API_KEY or OPENAI_API_KEY.") sys.exit(1) diff --git a/examples/docker-python/credentials.py b/examples/docker-python/credentials.py index 5d5e489..8940cc5 100644 --- a/examples/docker-python/credentials.py +++ b/examples/docker-python/credentials.py @@ -8,16 +8,13 @@ def detect_agent() -> str: """Pick an agent based on env vars. Exits if no credentials are found.""" if os.environ.get("SANDBOX_AGENT"): return os.environ["SANDBOX_AGENT"] - has_claude = bool( + has_anthropic = bool( os.environ.get("ANTHROPIC_API_KEY") or os.environ.get("CLAUDE_API_KEY") - or os.environ.get("CLAUDE_CODE_OAUTH_TOKEN") ) - has_codex = (os.environ.get("OPENAI_API_KEY") or "").startswith("sk-") - if has_codex: - return "codex" - if has_claude: - return "claude" + has_openai = bool(os.environ.get("OPENAI_API_KEY")) + if has_anthropic or has_openai: + return "opencode" print("No API keys found. Set ANTHROPIC_API_KEY or OPENAI_API_KEY.") sys.exit(1)