The system SHALL support an OpenCode-backed provider when a target is configured with provider: opencode.
- WHEN a target is configured with
provider: opencode - AND an eval case is executed for that target
- THEN the system invokes OpenCode to generate an assistant response
- AND runs OpenCode within an isolated per-eval-case working directory
- AND returns a
ProviderResponsewithoutputMessagespopulated
- WHEN an OpenCode target is selected
- AND the OpenCode runtime cannot be started or reached (missing executable, failed server startup, unreachable base URL)
- THEN the eval case attempt fails with an actionable error message
- AND other eval cases continue when running in parallel
When an OpenCode-based provider run is executed, the system SHALL support writing a per-run stream log file and surfacing its path for debugging.
- WHEN a provider run begins for an OpenCode-backed target
- THEN the provider writes a log file under
.agentv/logs/opencode/by default (or a configured override) - AND the provider appends progress entries as the agent executes
- WHEN OpenCode stream logging is disabled via configuration or environment
- THEN the provider does not create a log file
- AND evaluation continues normally
- WHEN the provider cannot create the configured log directory (permissions, invalid path)
- THEN the provider continues without stream logs
- AND emits a warning in verbose mode only
The system SHALL provide a mechanism to publish OpenCode log file paths so the CLI can present them to the user as soon as they are created.
- WHEN the provider decides on a log file path for an OpenCode run
- THEN it publishes
{ filePath, targetName, evalCaseId?, attempt? }to a process-local log tracker - AND downstream consumers MAY subscribe to this tracker to display the log path
The OpenCode provider SHALL map OpenCode tool lifecycle parts into AgentV tool calls so deterministic evaluators can operate on the trace.
- WHEN OpenCode returns a response containing one or more
toolparts - THEN the provider emits
ProviderResponse.outputMessagescontainingtoolCalls - AND each tool call includes
toolname andinputarguments when available - AND completed tool calls include
outputwhen available - AND tool call identifiers are stable across retries within an attempt when OpenCode provides them
- WHEN OpenCode returns a
toolpart with error state - THEN the provider includes the tool call in
toolCalls - AND includes the error information in a provider-specific metadata field or in
outputwith a structured error payload
The OpenCode provider SHALL handle OpenCode permission requests deterministically based on target configuration.
- WHEN OpenCode emits a permission request during an eval case
- AND the target does not explicitly enable auto-approval
- THEN the provider rejects the request
- AND the eval attempt fails with a clear error describing the blocked permission
- WHEN OpenCode emits a permission request during an eval case
- AND the target is configured to auto-approve permissions
- THEN the provider approves the request according to the configured policy (e.g., once or always)
- AND execution continues normally