mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 04:03:31 +00:00
chore: update examples to use opencode
This commit is contained in:
parent
c3a95c3611
commit
57eb329f9a
3 changed files with 9 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue