Files
PaperClipAI/packages/adapters/opencode-local
cryppadottaandPaperclip 486ab99f71 fix(opencode): fix API key env/secret resolution and support Antigravity connector
- Strip probe-overridden credential keys (including symmetric GEMINI_API_KEY /
  GOOGLE_GENERATIVE_AI_API_KEY aliases) from adapterConfig and environment
  envVars before secret persistence and runtime resolution in test-environment.
- Prefer an explicit pasted API key over auto-selected organization secrets in
  NewAgentSetup, and clear stale provider refs when switching credentials.
- Alias GEMINI_API_KEY to GOOGLE_GENERATIVE_AI_API_KEY and pass direct provider
  API keys across legacy opencode_local, native paperclip-runner (TS and Rust),
  and Plugin Runner environments, while redacting provider keys in output custody.
- Enable API-key AI connections (including the Google / Antigravity connector)
  for opencode_local with provider-to-model compatibility checks and isolated
  runtime environment preparation.

Fixes #23359
Refs #23370

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-12-01 15:53:11 +00:00
..
2026-03-12 13:09:22 -05:00

OpenCode local adapter

Runtime configuration

prepareOpenCodeRuntimeConfig stages an isolated OpenCode configuration directory on the host for both local and remote execution targets. It copies the operator configuration and applies the runtime provider and permission settings. Its returned XDG_CONFIG_HOME points to that host directory.

For remote execution, execute and testEnvironment pass the staged directory to prepareAdapterExecutionTargetRuntime as the xdgConfig asset. They replace XDG_CONFIG_HOME with the asset's remote destination before running OpenCode. The helper's cleanup function removes the host staging directory.