2026-03-04 16:48:54 -06:00
export const type = "opencode_local" ;
export const label = "OpenCode (local)" ;
2026-03-05 08:02:39 -06:00
export const DEFAULT_OPENCODE_LOCAL_MODEL = "openai/gpt-5.2-codex" ;
2026-03-04 16:48:54 -06:00
2026-03-08 12:10:59 -05:00
export const models : Array < { id : string ; label : string } > = [
2026-03-04 16:48:54 -06:00
{ id : DEFAULT_OPENCODE_LOCAL_MODEL , label : DEFAULT_OPENCODE_LOCAL_MODEL } ,
2026-03-05 18:59:42 -06:00
{ id : "openai/gpt-5.4" , label : "openai/gpt-5.4" } ,
2026-03-05 08:02:39 -06:00
{ id : "openai/gpt-5.2" , label : "openai/gpt-5.2" } ,
{ id : "openai/gpt-5.1-codex-max" , label : "openai/gpt-5.1-codex-max" } ,
{ id : "openai/gpt-5.1-codex-mini" , label : "openai/gpt-5.1-codex-mini" } ,
2026-03-04 16:48:54 -06:00
] ;
export const agentConfigurationDoc = ` # opencode_local agent configuration
Adapter : opencode_local
Use when :
- You want Paperclip to run OpenCode locally as the agent runtime
- You want provider / model routing in OpenCode format ( provider / model )
- You want OpenCode session resume across heartbeats via -- session
Don ' t use when :
2026-03-07 18:50:25 -06:00
- You need webhook - style external invocation ( use openclaw_gateway or http )
2026-03-04 16:48:54 -06:00
- You only need one - shot shell commands ( use process )
- OpenCode CLI is not installed on the machine
Core fields :
- cwd ( string , optional ) : default absolute working directory fallback for the agent process ( created if missing when possible )
- instructionsFilePath ( string , optional ) : absolute path to a markdown instructions file prepended to the run prompt
2026-03-05 15:24:20 +01:00
- model ( string , required ) : OpenCode model id in provider / model format ( for example anthropic / claude - sonnet - 4 - 5 )
2026-03-05 18:59:42 -06:00
- variant ( string , optional ) : provider - specific reasoning / profile variant passed as -- variant ( for example minimal | low | medium | high | xhigh | max )
2026-03-26 08:43:27 -05:00
- dangerouslySkipPermissions ( boolean , optional ) : inject a runtime OpenCode config that allows \ ` external_directory \` access without interactive prompts; defaults to true for unattended Paperclip runs
2026-03-04 16:48:54 -06:00
- promptTemplate ( string , optional ) : run prompt template
- command ( string , optional ) : defaults to "opencode"
- extraArgs ( string [ ] , optional ) : additional CLI args
- env ( object , optional ) : KEY = VALUE environment variables
Operational fields :
- timeoutSec ( number , optional ) : run timeout in seconds
- graceSec ( number , optional ) : SIGTERM grace period in seconds
Notes :
2026-03-05 15:24:20 +01:00
- OpenCode supports multiple providers and models . Use \
\ ` opencode models \` to list available options in provider/model format.
- Paperclip requires an explicit \ ` model \` value for \` opencode_local \` agents.
2026-03-04 16:48:54 -06:00
- Runs are executed with : opencode run -- format json . . .
- Sessions are resumed with -- session when stored session cwd matches current cwd .
2026-03-25 17:22:49 -07:00
- The adapter sets OPENCODE_DISABLE_PROJECT_CONFIG = true to prevent OpenCode from \
writing an opencode . json config file into the project working directory . Model \
selection is passed via the -- model CLI flag instead .
2026-03-26 08:43:27 -05:00
- When \ ` dangerouslySkipPermissions \` is enabled, Paperclip injects a temporary \
runtime config with \ ` permission.external_directory=allow \` so headless runs do \
not stall on approval prompts .
2026-03-04 16:48:54 -06:00
` ;