Skip to content

feat(runtime): implement OpenCodeRuntime - #7103

Merged
waynesun09 merged 44 commits into
fullsend-ai:mainfrom
yvonnedevlinrh:feat/opencode-runtime-510
Oct 16, 2026
Merged

waynesun09 merged 44 commits into
fullsend-ai:mainfrom
yvonnedevlinrh:feat/opencode-runtime-510

Conversation

@yvonnedevlinrh

Copy link
Copy Markdown
Contributor

Summary

Adds OpenCode as an opt-in Fullsend agent runtime while keeping Claude Code as the default.

OpenCode is currently restricted to read-only agents until the sandbox security-hook adapter tracked by unbound-force/unbound-force#515 is implemented.

Related Issue

Related to #1260.

Downstream implementation tracker: unbound-force/unbound-force#510

Changes Made

  • Adds OpenCode bootstrap, execution, configuration, and transcript handling.
  • Translates agent definitions and tool permissions into OpenCode format.
  • Supports model aliases, provider/model references, and effort via --variant.
  • Captures NDJSON output, runtime metrics, debug logs, and transcript errors.
  • Uses a runner-owned configuration directory outside the writable workspace.
  • Adds OpenCode to runtime selection, CLI help, configuration validation, and documentation.
  • Adds the required Vertex AI egress binary mappings.
  • Preserves Codex, Pi, dummy, and dummy-playback behavior from current main.
  • Adds unit tests covering bootstrap, execution, parsing, configuration, and transcript extraction.

Security

OpenCode does not yet install sandbox tool hooks. Write-capable agents remain gated until the hook adapter lands.

Host-side scanning and sandbox egress controls continue to apply.

Testing

  • make lint-all
  • Focused tests for internal/runtime, internal/cli, internal/config, internal/repos, and internal/scaffold
  • Approximate patch coverage: 89.9%
  • Verified against OpenCode CLI v1.18.26

Full local Go testing encountered pre-existing environment-sensitive failures tracked in #7078 and #7079. The arm64 vendor-test failures do not affect amd64 CI.

make e2e-test was not run because it requires live GitHub pool credentials.

Backward Compatibility

This is additive and opt-in. Existing configurations continue to use Claude Code unless runtime: opencode is selected.

@yvonnedevlinrh
yvonnedevlinrh requested a review from a team September 8, 2026 12:49
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

E2E tests are running

Authorization passed for this commit. See the E2E Tests workflow for results.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Implement OpenCode as an opt-in agent runtime

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Implements OpenCode bootstrap, execution, model translation, metrics, debugging, and transcript
 handling.
• Enables opt-in runtime selection while retaining Claude Code as the default.
• Documents read-only security limitations and adds focused runtime, configuration, and egress
 tests.
Diagram

graph TD
  Select["CLI and Config"] --> Registry["Runtime Registry"] --> Bootstrap["OpenCode Bootstrap"] --> Config["Runner Config"] --> CLI["OpenCode CLI"] --> Parser["NDJSON Parser"] --> Output["Metrics and Artifacts"]
  Egress["Vertex Egress"] --> CLI
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Defer until sandbox hooks are complete
  • ➕ Ships OpenCode with the same sandbox tool-hook guarantees as established runtimes.
  • ➕ Avoids an interim read-only operational restriction and reserved empty adapter contract.
  • ➖ Blocks early runtime validation and read-only pilots.
  • ➖ Couples execution, transcript, and provider work to the separate hook-adapter schedule.
2. Use exported OpenCode sessions instead of stream teeing
  • ➕ Could provide richer, full-fidelity session artifacts.
  • ➕ May reduce dependence on synthesized completion state from the live event stream.
  • ➖ Adds scope and delays the runtime rollout.
  • ➖ Post-run export alone would not provide live progress and metrics handling.
  • ➖ Requires the separate transcript redesign already tracked by unbound-force#513.

Recommendation: Keep the phased implementation: runner-owned configuration, live NDJSON parsing, and interim transcript teeing provide a practical foundation without coupling this PR to two downstream adapters. The rollout should remain limited to read-only use until unbound-force#515 lands; that restriction should be enforced operationally or in runtime selection rather than relying only on documentation.

Files changed (38) +1681 / -232

Enhancement (12) +836 / -82
admin.goExpose OpenCode in admin runtime help +1/-1

Expose OpenCode in admin runtime help

• Updates the administrative setup flag help with OpenCode and the supported dummy runtimes.

internal/cli/admin.go

agent.goExpose OpenCode for per-agent configuration +1/-1

Expose OpenCode for per-agent configuration

• Adds OpenCode to the documented values accepted by the agent runtime flag.

internal/cli/agent.go

github.goExpose OpenCode during GitHub setup +1/-1

Expose OpenCode during GitHub setup

• Adds OpenCode to the per-repository runtime flag guidance.

internal/cli/github.go

repos.goExpose OpenCode for repository installs +1/-1

Expose OpenCode for repository installs

• Adds OpenCode to the repository manifest runtime flag help.

internal/cli/repos.go

run.goExpose OpenCode run and model overrides +2/-2

Expose OpenCode run and model overrides

• Adds OpenCode to runtime override help and documents its provider/model support.

internal/cli/run.go

runtime_prompt.goOffer OpenCode in the interactive runtime prompt +5/-4

Offer OpenCode in the interactive runtime prompt

• Adds OpenCode as an experimental human-selectable runtime and communicates its read-only limitation.

internal/cli/runtime_prompt.go

config.goMake OpenCode a valid configured runtime +5/-5

Make OpenCode a valid configured runtime

• Adds OpenCode to the recognized runtime set for organization, repository, and agent configuration.

internal/config/config.go

opencode.goReplace the OpenCode runtime stub +57/-64

Replace the OpenCode runtime stub

• Defines the implemented runtime metadata, runner-owned configuration directory, required environment exports, and debug-log capability.

internal/runtime/opencode.go

opencode_bootstrap.goBootstrap OpenCode agents and skills +257/-0

Bootstrap OpenCode agents and skills

• Creates the runner-owned OpenCode layout, translates Claude-style agent definitions and tool permissions, uploads skills, warns on unsupported plugins, and preflights the CLI binary.

internal/runtime/opencode_bootstrap.go

opencode_run.goExecute OpenCode inside the sandbox +362/-0

Execute OpenCode inside the sandbox

• Implements model alias and provider resolution, secure command construction, effort variants, prompt overrides, stream teeing, metrics, debug capture, artifact cleanup, and reserved hook-integrity checks.

internal/runtime/opencode_run.go

opencode_transcript.goExtract and validate OpenCode artifacts +141/-0

Extract and validate OpenCode artifacts

• Downloads sandbox-side JSONL transcripts and debug logs, replays streams for error detection, and emits standard transcript summaries.

internal/runtime/opencode_transcript.go

registry.goRecognize OpenCode as user-selectable +3/-3

Recognize OpenCode as user-selectable

• Updates registry validation documentation now that OpenCode belongs to the configured runtime set.

internal/runtime/registry.go

Tests (12) +674 / -112
run_overrides_test.goTreat OpenCode as a valid run override +6/-6

Treat OpenCode as a valid run override

• Replaces former OpenCode rejection cases with genuinely unknown runtime values.

internal/cli/run_overrides_test.go

runtime_binaries_test.goMap OpenCode to Vertex egress binaries +3/-0

Map OpenCode to Vertex egress binaries

• Adds OpenCode executable patterns to the expected Vertex AI runtime egress mapping.

internal/cli/runtime_binaries_test.go

runtime_prompt_test.goTest interactive OpenCode selection +4/-3

Test interactive OpenCode selection

• Verifies OpenCode is accepted by the runtime prompt and appears in validation guidance.

internal/cli/runtime_prompt_test.go

config_test.goTest OpenCode configuration validation +9/-15

Test OpenCode configuration validation

• Updates runtime validation tests to accept OpenCode across organization, repository, and agent settings while preserving unknown-runtime rejection.

internal/config/config_test.go

manifest_edit_test.goPreserve unknown runtime rejection coverage +1/-1

Preserve unknown runtime rejection coverage

• Replaces the now-valid OpenCode rejection case with a nonexistent runtime.

internal/repos/manifest_edit_test.go

manifest_test.goUpdate manifest validation for OpenCode +2/-2

Update manifest validation for OpenCode

• Uses an unknown runtime for negative validation now that OpenCode is supported.

internal/repos/manifest_test.go

capabilities_test.goVerify OpenCode debug-log capability +8/-4

Verify OpenCode debug-log capability

• Confirms OpenCode supplies its runtime-specific debug filename while retaining fallback and precedence coverage through a neutral test runtime.

internal/runtime/capabilities_test.go

opencode_bootstrap_test.goTest OpenCode bootstrap and execution integration +331/-0

Test OpenCode bootstrap and execution integration

• Covers agent translation, skill upload, preflight failures, transcript downloads, streamed execution, metrics, cleanup, and error-exit correction using fake sandbox commands.

internal/runtime/opencode_bootstrap_test.go

opencode_test.goTest OpenCode runtime behavior +255/-29

Test OpenCode runtime behavior

• Adds coverage for metadata, environment exports, registry resolution, model and tool translation, command safety, hook guards, transcript parsing, and debug handling.

internal/runtime/opencode_test.go

registry_test.goTest OpenCode runtime resolution paths +52/-49

Test OpenCode runtime resolution paths

• Verifies OpenCode resolves from organization, repository, and per-agent configuration while unknown runtimes remain rejected.

internal/runtime/registry_test.go

scaffold_test.goLock the OpenCode Vertex binary allowlist +1/-1

Lock the OpenCode Vertex binary allowlist

• Extends scaffold validation to require both OpenCode executable patterns in the Vertex profile.

internal/scaffold/scaffold_test.go

runtime_test.goAccept OpenCode in behavior-test validation +2/-2

Accept OpenCode in behavior-test validation

• Replaces former OpenCode rejection fixtures with nonexistent runtime values while retaining invalid-setting coverage.

pkg/behaviourtest/steps/runtime_test.go

Documentation (12) +158 / -37
config.tsAdd OpenCode to the runtime navigation +1/-0

Add OpenCode to the runtime navigation

• Adds the OpenCode runtime guide to the documentation sidebar.

docs/.vitepress/config.ts

agent.mdDocument OpenCode agent overrides +1/-1

Document OpenCode agent overrides

• Lists OpenCode as a supported value for per-agent runtime selection.

docs/cli/agent.md

github.mdDocument OpenCode GitHub setup selection +1/-1

Document OpenCode GitHub setup selection

• Adds OpenCode to the GitHub setup runtime choices and clarifies dummy runtime usage.

docs/cli/github.md

repos.mdDocument OpenCode repository manifest settings +2/-2

Document OpenCode repository manifest settings

• Adds OpenCode to repository installation and default runtime documentation.

docs/cli/repos.md

run.mdDocument OpenCode run overrides and metrics +3/-3

Document OpenCode run overrides and metrics

• Adds OpenCode to run-time overrides, metrics examples, and iteration timeout coverage.

docs/cli/run.md

runtime-implementation.mdDescribe OpenCode security and artifact support +16/-15

Describe OpenCode security and artifact support

• Updates the runtime capability matrix for the implemented OpenCode backend. It explicitly records that host controls apply while sandbox tool hooks remain unavailable pending the plugin adapter.

docs/contributing/runtime-implementation.md

cli-internals.mdExpose OpenCode in the CLI command map +1/-1

Expose OpenCode in the CLI command map

• Updates the internal CLI reference with OpenCode as a per-agent runtime option.

docs/guides/dev/cli-internals.md

choosing-a-runtime.mdAdd OpenCode to runtime selection guidance +1/-1

Add OpenCode to runtime selection guidance

• Shows OpenCode as a valid runtime when changing repository setup.

docs/guides/getting-started/choosing-a-runtime.md

configuring-github.mdMark OpenCode as an experimental runtime +1/-1

Mark OpenCode as an experimental runtime

• Adds OpenCode to the experimental runtimes available during GitHub setup.

docs/guides/getting-started/configuring-github.md

runtimes.mdIntegrate OpenCode into the runtime comparison +16/-10

Integrate OpenCode into the runtime comparison

• Promotes OpenCode from a stub to an experimental runtime and documents model, effort, tools, skills, configuration, artifacts, and security-hook behavior.

docs/runtimes.md

opencode.mdAdd the OpenCode runtime guide +113/-0

Add the OpenCode runtime guide

• Introduces usage, provider configuration, runner-owned config discovery, local execution, artifacts, behavior differences, and current read-only security limitations.

docs/runtimes/opencode.md

manifest.goDocument OpenCode manifest support +2/-2

Document OpenCode manifest support

• Updates repository manifest field comments to include OpenCode as a supported runtime.

internal/repos/manifest.go

Other (2) +13 / -1
sandbox.goDefine the runner-owned OpenCode config path +10/-0

Define the runner-owned OpenCode config path

• Adds a sandbox constant for OpenCode configuration outside the agent-writable workspace.

internal/sandbox/sandbox.go

fullsend-vertex-ai.yamlPermit OpenCode through Vertex AI egress +3/-1

Permit OpenCode through Vertex AI egress

• Adds OpenCode executable patterns to the Vertex inference profile and updates its runtime description.

internal/scaffold/fullsend-repo/profiles/fullsend-vertex-ai.yaml

@qodo-code-review

qodo-code-review Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. First-party images lack OpenCode ✓ Resolved
Description
openCodePreflightVersion now requires opencode --version to succeed, but the sandbox image
source installs the other runtimes without installing OpenCode. The agents repository pins that
image family by digest in its triage and prioritize harnesses, so either advertised first-party
OpenCode pilot fails during bootstrap before an iteration begins.
Code

internal/runtime/opencode_bootstrap.go[R248-250]

+	stdout, stderr, exitCode, err := sandbox.Exec(sandboxName, "opencode --version", 30*time.Second)
+	if err != nil {
+		return fmt.Errorf("opencode preflight: %w", err)
Relevance

●●● Strong

Bootstrap preflights an executable absent from the cited image, deterministically preventing
advertised first-party runs.

PR-#6035

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new bootstrap fails when the OpenCode executable is absent, while the image source shown
installs Claude Code and pi but has no corresponding OpenCode installation. Both first-party agents
advertised for the pilot remain pinned to published image digests from that image family.

internal/runtime/opencode_bootstrap.go[243-256]
images/sandbox/Containerfile[49-60]
images/sandbox/Containerfile[81-104]
External repo: fullsend-ai/agents, harness/triage.yaml [11-18]
External repo: fullsend-ai/agents, harness/prioritize.yaml [11-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Install a reviewed, pinned OpenCode CLI version in the sandbox images before making the runtime selectable.

## Issue Context
After publishing updated images, coordinate updates to the image digests used by the first-party triage and prioritize harnesses.

## Fix Focus Areas
- images/sandbox/Containerfile[49-104]
- internal/runtime/opencode_bootstrap.go[243-256]
- harness/triage.yaml[11-18]
- harness/prioritize.yaml[11-18]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Secure OpenCode runs never start ✗ Dismissed
Description
buildOpenCodeRunCommand enables the hook-integrity guard whenever HooksSettingsPath is
non-empty, but the new runtime supplies neither an adapter file nor adapter bytes for the required
hash. Security is enabled by default and the runner sets that path in this case, so ordinary
OpenCode runs exit 97 before sourcing .env or executing the agent.
Code

internal/runtime/opencode_run.go[R128-134]

+	if hooksEnabled {
+		// Before .env: that file is agent-writable and could otherwise shadow
+		// the guard's tools with functions or a PATH entry. #515 supplies the
+		// embedded adapter bytes; until then the guard is only emitted when
+		// the runner signals hooks are on, and #515 wires the real hash.
+		prelude = append(prelude, "&& "+openCodeHooksGuard(r.openCodeHooksExtensionPath()))
+	}
Relevance

●●● Strong

The default security guard requires an adapter that this PR explicitly does not install, so runs
fail closed immediately.

PR-#6756

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The runner sets HooksSettingsPath when security is enabled, which defaults to true. The added
command inserts a guard in that case, while the guard requires an on-disk file matching the hash of
a nil adapter and Bootstrap explicitly installs nothing.

internal/cli/run.go[2211-2228]
internal/harness/harness.go[230-236]
internal/runtime/opencode_run.go[128-138]
internal/runtime/opencode_run.go[240-251]
internal/runtime/opencode_bootstrap.go[60-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The OpenCode launch command enables a fail-closed adapter guard even though this PR intentionally does not install the adapter. Default security-enabled runs therefore fail before OpenCode executes.

## Issue Context
The adapter is explicitly deferred to the follow-up implementation, while security is enabled by default and supplies `HooksSettingsPath` to every runtime.

## Fix Focus Areas
- internal/runtime/opencode_run.go[128-134]
- internal/runtime/opencode_run.go[240-251]
- internal/runtime/opencode_bootstrap.go[60-66]
- internal/cli/run.go[2211-2228]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Readers mistake deferred work as ready ✓ Resolved
Description
docs/runtimes/opencode.md presents the unimplemented security-hook adapter under an Experimental
blockquote rather than the required > **Planned:** callout. The same deferred adapter governs
write-path denial and sandbox hooks, so readers encounter future behavior in several capability
descriptions without the standardized status marker.
Code

docs/runtimes/opencode.md[R14-17]

+> **Experimental — read-only agents only.** OpenCode is enabled for read-only agents (`triage`,
+> `prioritize`). Write-capable agents (`code`, `fix`) are gated on the security-hook adapter, tracked
+> in [unbound-force#515](https://github.com/unbound-force/unbound-force/issues/515): OpenCode has no
+> native PreToolUse/PostToolUse hooks, so until the runner-owned, sha256-gated plugin adapter lands,
Relevance

●●● Strong

Explicit documentation-format rules and the deferred feature status make the standardized Planned
callout a straightforward correction.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1062082 mandates the exact > **Planned:** blockquote format and an issue link for
not-yet-implemented features. The added documentation links the tracking issue but labels the
missing adapter as experimental or describes it inline instead of using the required marker.

docs/runtimes/opencode.md[14-18]
docs/runtimes/opencode.md[41-44]
docs/contributing/runtime-implementation.md[157-175]
Skill: writing-user-docs

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Documentation mentions the unimplemented OpenCode hook adapter without the required planned-feature callout format.

## Issue Context
Convert each mention of deferred adapter, write-denial, hook, or transcript work into a `> **Planned:**` blockquote containing the relevant linked issue, while keeping current capabilities distinct from future ones.

## Fix Focus Areas
- docs/runtimes/opencode.md[14-18]
- docs/runtimes/opencode.md[41-44]
- docs/runtimes/opencode.md[96-98]
- docs/contributing/runtime-implementation.md[157-175]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (4)
4. First-party models stay unconfigured ✗ Dismissed
Description
OpenCodeRuntime.EnvExports references OPENCODE_CONFIG_CONTENT, but neither the runtime bootstrap
nor the agents repository constructs the required anthropic-vertex provider and permission policy.
The first-party harnesses provide only the existing Vertex environment and credentials, so selecting
OpenCode leaves its default model reference without the configuration needed for inference.
Code

internal/runtime/opencode.go[R72-73]

+		"OPENCODE_CONFIG_CONTENT",        // Vertex provider + permission denials (merges last)
+		"GOOGLE_APPLICATION_CREDENTIALS", // WIF credential file
Relevance

●●● Strong

The runtime declares required configuration but does not construct or deliver the provider
configuration needed for inference.

PR-#6467

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR declares that the harness must deliver the OpenCode provider configuration and exports only
its variable name, while Bootstrap creates directories and translated artifacts without generating
that content. The agents harness mounts only its existing GCP environment and credential files,
whose variables contain no OpenCode provider configuration.

internal/runtime/opencode.go[53-74]
internal/runtime/opencode_bootstrap.go[96-139]
External repo: fullsend-ai/agents, harness/triage.yaml [23-31]
External repo: fullsend-ai/agents, env/gcp-vertex.env [1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Generate and export the OpenCode provider and permission configuration instead of assuming first-party harnesses already supply `OPENCODE_CONFIG_CONTENT`.

## Issue Context
The agents repository currently supplies Vertex credentials and Claude-oriented variables only. Prefer constructing runner-owned OpenCode configuration in this repository; otherwise coordinate explicit configuration across every agents harness.

## Fix Focus Areas
- internal/runtime/opencode.go[53-74]
- internal/runtime/opencode_bootstrap.go[96-139]
- harness/triage.yaml[23-31]
- env/gcp-vertex.env[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Vertex blocks first-party inference ✓ Resolved
Description
The scaffold Vertex profile adds OpenCode binary patterns, but the agents repository's profile
actually selected by first-party harnesses still permits only Claude, pi, and Node. Triage and
prioritize therefore reach the sandbox with a profile that denies OpenCode's Vertex requests even
after an image and provider configuration are supplied.
Code

internal/scaffold/fullsend-repo/profiles/fullsend-vertex-ai.yaml[R25-26]

+  - "**/opencode"
+  - "**/opencode.exe"
Relevance

●●● Strong

Scaffold profile drift affecting runtime binaries is actionable; historical scaffold consistency
fixes were accepted.

PR-#390

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed scaffold profile permits both OpenCode executable names, but the release-coupled agents
profile omits them. The first-party triage and prioritize harnesses explicitly select the stale
agents profile.

internal/scaffold/fullsend-repo/profiles/fullsend-vertex-ai.yaml[21-27]
External repo: fullsend-ai/agents, profiles/fullsend-vertex-ai.yaml [28-32]
External repo: fullsend-ai/agents, harness/triage.yaml [14-18]
External repo: fullsend-ai/agents, harness/prioritize.yaml [14-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Add the OpenCode executable patterns to the Vertex profile enforced by the agents repository.

## Issue Context
The scaffold copy and fleet copy are release-coupled. Update and validate both before advertising OpenCode for first-party agents.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/profiles/fullsend-vertex-ai.yaml[21-27]
- profiles/fullsend-vertex-ai.yaml[28-32]
- harness/triage.yaml[14-18]
- harness/prioritize.yaml[14-18]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Every OpenCode run exits before starting ✓ Resolved
Description
OpenCodeRuntime.EnvExports adds OPENCODE_CONFIG_CONTENT and GOOGLE_APPLICATION_CREDENTIALS as
bare lines, and bootstrapEnv writes those lines verbatim into the sourced .env file. POSIX sh
treats each bare name as a command, so . /sandbox/workspace/.env fails with command-not-found and
the subsequent && chain never invokes opencode.
Code

internal/runtime/opencode.go[R71-73]

+		fmt.Sprintf("export OPENCODE_CONFIG_DIR=%s", r.ConfigDir()),
+		"OPENCODE_CONFIG_CONTENT",        // Vertex provider + permission denials (merges last)
+		"GOOGLE_APPLICATION_CREDENTIALS", // WIF credential file
Relevance

●●● Strong

Bare environment names sourced as shell commands cause deterministic startup failure before OpenCode
executes.

PR-#3820

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new runtime returns two unqualified variable names, whereas bootstrap writes runtime entries
directly to .env; OpenCode then sources that file before its command. A bare shell word is
executed as a command rather than exporting an inherited variable, and the && sequence aborts on
that failure.

internal/runtime/opencode.go[69-74]
internal/cli/run.go[2935-2950]
internal/runtime/opencode_run.go[135-143]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenCode runtime environment entries are emitted as command names rather than shell exports, causing the sourced sandbox `.env` file to fail before OpenCode starts.

## Issue Context
`bootstrapEnv` appends each runtime export verbatim and `Run` sources that file in an `&&` chain.

## Fix Focus Areas
- internal/runtime/opencode.go[69-74]
- internal/cli/run.go[2935-2950]
- internal/runtime/opencode_run.go[135-138]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Write agents run without safeguards ✗ Dismissed
Description
Adding opencode to ValidRuntimes makes it selectable through repository, per-agent, and
command-line overrides, while ResolveForAgent checks neither the agent role nor ReadonlyRepo,
even though OpenCode installs no sandbox hook adapter and enables Write, Edit, and Bash. When
selected for the first-party code or fix agents, or any unrestricted custom agent in a normally
writable harness, execution reaches write-capable tools without the intended read-only rollout gate.
Code

internal/config/config.go[322]

+	return []string{"claude", "pi", "codex", "opencode", "dummy", "dummy-playback"}
Relevance

●●● Strong

Enabling a runtime without enforcing its documented read-only limitation is a concrete security
boundary failure.

PR-#6756

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The configuration change places OpenCode in the universal valid-runtime set, and runtime resolution
validates only the runtime name, allowing repository configuration, per-agent settings, and
--runtime opencode overrides to select it. The runner makes a checkout read-only only when the
independent ReadonlyRepo option is enabled, whose default is false, while OpenCode’s tool
translation enables Write, Edit, and Bash and its bootstrap explicitly omits security-hook
wiring. The code and fix agent definitions confirm that these first-party agents modify, test,
and commit repository content, demonstrating that the documented read-only limitation is not
enforced before write-capable execution.

Rule 2889480: Consult runtime implementation guide when modifying runtime.Runtime backends
internal/config/config.go[317-323]
internal/runtime/registry.go[69-96]
internal/runtime/opencode_bootstrap.go[60-66]
internal/cli/run.go[2211-2234]
internal/runtime/opencode_bootstrap.go[60-67]
internal/runtime/opencode_bootstrap.go[217-228]
internal/config/config.go[317-322]
internal/harness/harness.go[339-345]
internal/cli/run.go[1972-1990]
internal/runtime/opencode_bootstrap.go[179-228]
docs/contributing/runtime-implementation.md[157-175]
docs/runtimes/opencode.md[14-18]
External repo: fullsend-ai/agents, agents/code.md [2-17]
External repo: fullsend-ai/agents, agents/fix.md [2-17]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Reject OpenCode for write-capable or unrestricted agents until its sandbox hook adapter is installed and integrity-checked. Ensure repository configuration, per-agent configuration, and command-line runtime overrides all enforce the documented read-only limitation before sandbox execution.

## Issue Context
Configuration validation alone cannot identify whether an agent is safe for the OpenCode pilot. Runtime resolution currently accepts OpenCode for any named agent, `ReadonlyRepo` is an independent harness setting that defaults to false, and the OpenCode bootstrap enables write, edit, and bash tools while intentionally installing no hook adapter. Enforce eligibility at a central boundary where the resolved agent and harness capabilities are available, including the intended triage/prioritize or explicitly read-only cases, and add coverage for the first-party `code` and `fix` agents as well as unrestricted custom agents across every runtime-selection path.

## Fix Focus Areas
- internal/config/config.go[317-323]
- internal/runtime/registry.go[69-96]
- internal/cli/run.go[1011-1035]
- internal/cli/run.go[1972-1990]
- internal/runtime/opencode_bootstrap.go[60-66]
- internal/runtime/opencode_bootstrap.go[179-228]
- agents/code.md[2-17]
- agents/fix.md[2-17]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

8. Critical command changes go untested ✗ Dismissed
Description
The PR modifies internal/cli but its testing declaration explicitly says make e2e-test was not
run. Because these command paths trigger the live installation-flow requirement, the latest changes
have no successful end-to-end result before merge.
Code

internal/cli/admin.go[630]

+	cmd.Flags().StringVar(&runtimeName, "runtime", "claude", "agent runtime for fullsend run (claude, pi, codex, opencode, dummy or dummy-playback; dummy runtimes are for behaviour tests only)")
Relevance

●●● Strong

The active rule explicitly requires e2e evidence for changed internal/cli paths; the PR states the
suite was not run.

PR-#5615

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1062051 applies whenever a changed path starts with internal/cli/ and treats missing,
skipped, or unsuccessful make e2e-test evidence as a violation. This PR changes multiple files in
that directory and explicitly reports that the required suite was not run.

Rule 1062051: Run end-to-end tests for critical internal modules before merge
internal/cli/admin.go[630-630]
internal/cli/runtime_binaries_test.go[49-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Changes under `internal/cli` require a successful `make e2e-test` result, but the PR states that this suite was not run.

## Issue Context
Run the required suite in an environment with the live GitHub pool credentials, record its successful result for the latest commit, and address any failures before merge.

## Fix Focus Areas
- internal/cli/admin.go[630-630]
- internal/cli/runtime_binaries_test.go[49-51]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Run artifacts can expose credentials ✗ Dismissed
Description
Run tees the raw OpenCode event stream directly into OutputPath, and ExtractTranscripts
downloads the second raw copy without applying credential-literal or secret-pattern redaction. When
model or tool output contains a token, key, password, or credential-bearing command output, both
persisted artifacts receive it unchanged.
Code

internal/runtime/opencode_run.go[R281-283]

+			defer f.Close()
+			reader = io.TeeReader(stdout, f)
+		}
Relevance

●●● Strong

Recent OpenCode precedent accepted secret redaction for untrusted tool output and artifact exposure.

PR-#6147
PR-#3186

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3092695 requires external content written to logs or files to use the credential-redaction
guidance. The new runtime stores its unfiltered NDJSON stream in a host output file and later
downloads the unfiltered sandbox copy as a transcript.

Rule 3092695: Consult Go credential redaction guide for external-facing code changes
internal/runtime/opencode_run.go[275-283]
internal/runtime/opencode_transcript.go[54-67]
docs/contributing/go-code.md[417-454]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenCode output and transcript artifacts are persisted without the repository's required credential-redaction passes.

## Issue Context
Apply sensitive runner-environment literal replacement and `security.SecretRedactor` before external content reaches host files or extracted transcripts. Ensure resulting files use restrictive permissions and add tests containing representative opaque and recognizable credentials.

## Fix Focus Areas
- internal/runtime/opencode_run.go[275-283]
- internal/runtime/opencode_transcript.go[54-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Agent model pins are ignored ✗ Dismissed
Description
buildOpenCodeRunCommand always supplies --model, and translateOpenCodeModel converts an empty
runner model into the default opus. When only the agent definition has a model: value, that
generated frontmatter is overridden and OpenCode runs the default model instead.
Code

internal/runtime/opencode_run.go[R154-158]

+	// translateOpenCodeModel never returns empty (it falls back to the default
+	// alias), so --model is always supplied; opencode's own resolution is a
+	// backstop, not the primary path. --model takes provider/model
+	// (`opencode run --help`).
+	invocation = append(invocation, "--model "+shellQuote(openCodeValidatedArg(modelSpec)))
Relevance

●●● Strong

Always passing a fallback model overrides agent frontmatter, contradicting shared runtime
model-resolution behavior.

PR-#6467

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Bootstrap records def.Model in the translated agent, but command construction always adds a model
after replacing an empty input with opus. The shared runtime model helper states that an agent
definition's frontmatter model is the fallback when the runner resolved none, and Pi applies that
helper during execution.

internal/runtime/opencode_bootstrap.go[147-176]
internal/runtime/opencode_run.go[44-59]
internal/runtime/model.go[8-24]
internal/runtime/pi_run.go[805-819]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenCode unconditionally passes a default `--model`, overriding the model copied from the agent definition into OpenCode frontmatter. Preserve the shared model precedence by using the agent-definition model when the runner did not resolve one, or omit `--model` so OpenCode can use its agent configuration.

## Issue Context
The repository already defines `EffectiveModel(runModel, agentModel)` as the shared fallback chain. Ensure the same effective value drives the command, initialization event, and metrics.

## Fix Focus Areas
- internal/runtime/opencode_bootstrap.go[147-176]
- internal/runtime/opencode_run.go[41-60]
- internal/runtime/opencode_run.go[154-165]
- internal/runtime/model.go[8-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (4)
11. Sub-agent dispatch silently disappears ✓ Resolved
Description
openCodeToolForClaude maps the legacy Task name but omits the current Agent alias used by
Claude-style definitions. An agent declaring tools: Agent has that entry dropped as unsupported,
so OpenCode never receives its task tool permission.
Code

internal/runtime/opencode_bootstrap.go[R225-228]

+	"LS":        "list",
+	"WebFetch":  "webfetch",
+	"Task":      "task",
+}
Relevance

●●● Strong

The current tool translation omits a supported Claude alias, silently removing sub-agent capability.

PR-#6752

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
OpenCode drops names absent from its mapping, and the added map contains only Task: task. The
existing Pi translation explicitly recognizes both Agent and Task as equivalent sub-agent tools,
demonstrating the supported Claude-style vocabulary.

internal/runtime/opencode_bootstrap.go[184-200]
internal/runtime/opencode_bootstrap.go[217-228]
internal/runtime/pi_agent.go[213-234]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The OpenCode tool translator recognizes only the legacy `Task` spelling for sub-agent dispatch. Map both `Agent` and `Task` to OpenCode's `task` tool and add coverage for the modern spelling.

## Issue Context
The shared Claude-style parser and Pi translation treat `Agent` and `Task` as aliases. OpenCode currently drops every unknown tool with a warning, turning this omission into a disabled capability.

## Fix Focus Areas
- internal/runtime/opencode_bootstrap.go[179-228]
- internal/runtime/opencode_test.go[77-91]
- internal/runtime/pi_agent.go[213-234]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Repository model choices are ignored ✓ Resolved
Description
translateOpenCodeModel consults only the built-in alias map and never uses
RunParams.ModelAliases. When a repository remaps an alias such as sonnet, OpenCode instead runs
the built-in generation while the plan can display the repository's configured target.
Code

internal/runtime/opencode_run.go[R56-59]

+	if id, ok := openCodeModelAliases[model]; ok {
+		model = id
+	}
+	return provider + "/" + model
Relevance

●●● Strong

Ignoring repository model aliases violates established runtime precedence and produces incorrect
model selection.

PR-#6467

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The CLI explicitly loads repository aliases and passes them through RunParams.ModelAliases, but
both OpenCode model translation calls accept only params.Model. Existing runtime code establishes
that repository aliases override built-in mappings before provider normalization.

internal/cli/run.go[1043-1064]
internal/cli/run.go[2216-2233]
internal/runtime/opencode_run.go[41-60]
internal/runtime/pi_run.go[143-199]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenCode ignores `.fullsend/config.yaml` model alias overrides even though the runner passes them in `RunParams.ModelAliases`. Merge repository aliases over the built-in OpenCode alias table before constructing the provider/model value.

## Issue Context
Alias resolution must occur before provider-prefix handling because an alias target may already be a complete provider/model reference. Keep command selection, telemetry, and displayed model resolution consistent.

## Fix Focus Areas
- internal/runtime/opencode_run.go[35-60]
- internal/runtime/opencode_run.go[267-300]
- internal/cli/run.go[1043-1064]
- internal/cli/run.go[2216-2233]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Missing transcripts appear successful ✓ Resolved
Description
The generated pipeline records and returns only OpenCode's exit status after piping stdout through
tee, discarding a failed tee status. When the sandbox cannot create or write the transcript
file, the host can still parse stdout and report a successful run, while extraction merely logs that
no transcript was found.
Code

internal/runtime/opencode_run.go[R199-201]

+	pipeline := "{ " + strings.Join(invocation, " ") + " ; echo $? > " + shellQuote(rcFile) + " ; }" +
+		" | tee " + shellQuote(sandboxTranscript) +
+		" ; exit \"$(cat " + shellQuote(rcFile) + " 2>/dev/null || echo 1)\""
Relevance

●●● Strong

Specific pipeline error propagation bug can falsely report success; reliability fixes in OpenCode
are accepted.

PR-#6147

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The pipeline saves only the left command's status in the rc file and exits with it after tee, so a
tee write failure cannot affect the returned status. Transcript extraction relies solely on the
sandbox file and treats an absent file as a non-fatal informational condition.

internal/runtime/opencode_run.go[185-203]
internal/runtime/opencode_transcript.go[41-67]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A failed sandbox-side `tee` is ignored, allowing successful runs without the transcript artifact that this runtime promises to extract.

## Issue Context
The command must preserve OpenCode's exit code across the pipeline, but it also needs to detect a non-zero `tee` result before returning success.

## Fix Focus Areas
- internal/runtime/opencode_run.go[185-203]
- internal/runtime/opencode_transcript.go[41-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Broken streams can pass as successful ✓ Resolved
Description
OpenCodeRuntime.Run logs and discards parseOpenCodeStream errors, while its success override
requires a non-nil lastResult. If reading the stream fails and the command reports exit zero, the
run returns success without a result and loses result-derived turn, cost, and token metrics.
Code

internal/runtime/opencode_run.go[R323-327]

+	if _, parseErr := parseOpenCodeStream(reader, handler); parseErr != nil {
+		fmt.Fprintf(os.Stderr, "  progress parser: %v\n", sanitizeOutput(parseErr.Error()))
+		cancel()
+		io.Copy(io.Discard, reader)
+	}
Relevance

●●● Strong

Discarded parser failures causing incomplete metrics match accepted runtime stream-accounting fixes.

PR-#6147
PR-#1982

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
A non-EOF reader error returns before OpenCode's synthesized ResultEvent. Run then cancels and
drains the stream but ignores the parser error in its final decision, and only copies aggregate
metrics when a ResultEvent was received.

internal/runtime/opencode_progress.go[131-144]
internal/runtime/opencode_progress.go[237-256]
internal/runtime/opencode_run.go[302-349]
internal/runtime/pi_progress.go[252-258]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenCode stream read failures are logged but do not affect the returned execution result. Preserve partial metrics where possible and return a failed result or error whenever parsing terminates abnormally without a trustworthy terminal result.

## Issue Context
The parser synthesizes its result only after normal EOF, while `Run` copies metrics only from that result. Pi's parser provides a useful precedent by emitting an incomplete error result even when reading fails.

## Fix Focus Areas
- internal/runtime/opencode_progress.go[131-144]
- internal/runtime/opencode_progress.go[237-256]
- internal/runtime/opencode_run.go[302-349]
- internal/runtime/pi_progress.go[252-258]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 75 rules
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/agents (sha: ec2f8a5b)
  Explored: repo: fullsend-ai/.fullsend (sha: 7c163cad)
Review mode: 🧠 Deep: This adds a security-sensitive, opt-in runtime with substantial new bootstrap, shell execution, permissions, model translation, transcript, and configuration logic across many independent paths.

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/runtime/opencode_run.go Resolved
Comment thread docs/runtimes/opencode.md Resolved
Comment thread internal/cli/admin.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode.go Resolved
Comment thread internal/runtime/opencode_bootstrap.go Resolved
Comment thread internal/config/config.go Resolved

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review sweep — 4 findings below (2 HIGH, 2 MEDIUM), verified against upstream OpenCode source and cross-checked against existing bot comments on this PR for duplicates.

Comment thread internal/runtime/opencode.go Resolved
Comment thread internal/runtime/opencode_bootstrap.go Resolved
Comment thread internal/runtime/opencode_bootstrap.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
@yvonnedevlinrh
yvonnedevlinrh force-pushed the feat/opencode-runtime-510 branch from 06db3c2 to 236d183 Compare September 8, 2026 15:24
Comment thread docs/runtimes/opencode.md Resolved
@rh-hemartin rh-hemartin added the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://79e5b006-site.fullsend-ai.workers.dev

Commit: deda34fb1d51e3e3e5ece7ccce755fc6eb797164

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review sweep — 7 findings (2 HIGH, 5 MEDIUM), each verified against this PR's head, the sibling runtime implementations, and upstream OpenCode source. Cross-checked against the existing threads on this PR; the two that sit near an existing thread carry an explicit note on how they differ.

Six findings are inline below. One has no line inside a diff hunk, so it is recorded here:


[MEDIUM] Two consumers this PR's own runtime-implementation checklist marks required were not updated

docs/contributing/runtime-implementation.md (checklist lines 83 and 90 — outside this PR's diff hunks, hence this body comment)

The "Consumer-completeness touchpoints" checklist that this PR itself edits lists at line 83 [ ] docs/architecture.md — update the runtime selection diagram and at line 90 [ ] docs/guides/infrastructure/layered-config-reference.md — update.

Neither file appears in this PR's changed-file list, and both still exclude opencode on the head branch:

  • docs/architecture.md:198 renders the config node as runtime: claude | pi | codex | dummy | dummy-playback
  • docs/guides/infrastructure/layered-config-reference.md:137 reads Valid values: claude, pi, codex, dummy, ...

The PR did update the other consumers on the list (choosing-a-runtime.md, cli/run.md, runtimes.md), so this reads as two specific misses rather than a wholesale omission. A user following layered-config-reference.md will conclude that runtime: opencode is invalid.

Suggestion: Add opencode to the docs/architecture.md:198 runtime selection diagram (and the surrounding prose at line 232) and to the valid-values list at layered-config-reference.md:137, then tick both checklist boxes.

Comment thread internal/runtime/opencode_bootstrap.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/runtime/opencode_run.go Resolved
Comment thread internal/config/config_test.go Resolved
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 14, 2026
… mechanics

Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Security:
- Add OPENCODE_DISABLE_PROJECT_CONFIG=true to EnvExports (H1)
- Re-pin runner-owned env vars after .env source, mirroring pi/codex (H6)
- Migrate tools: to permission: field matching upstream schema (H3/H5)
- Fix LS tool mapping from "list" to "read" (H2)
- Add agent name validation in Bootstrap to prevent fallback (H7)

Run mechanics:
- Add clearStrayProcesses to ClearIterationArtifacts (H4)
- Move rc file under output/ so it is cleaned between iterations (H8)
- Make final exit conditional on prelude success (H8)
- Add --print-logs --log-level DEBUG when Debug is set (H9)
- Propagate stream parseErr to adjust exit code (B6)

Assisted-by: claude-opus
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 14, 2026
Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Docs:
- Add opencode to architecture.md runtime selection diagram (H11)
- Add opencode to layered-config-reference.md valid values (H11)
- Tick runtime-implementation.md checklist boxes (H11)
- Change "Experimental" to "Planned" callout for deferred features (B2)
- Fix "opt-in per org" to "opt-in per repo" per ADR 0044 (H10)
- Update tools: references to permission: in opencode.md (H3)

Config:
- Restore ADR 0044 deprecation guard in TestOrgConfigValidateRuntime (H10)
- Add write-agent note to ValidRuntimes doc comment (B14)

Image:
- Add OpenCode binary to base sandbox Containerfile (B12)

Assisted-by: claude-opus
@github-actions github-actions Bot removed the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Sep 14, 2026
@yvonnedevlinrh
yvonnedevlinrh force-pushed the feat/opencode-runtime-510 branch from d72430f to e6f1988 Compare September 14, 2026 09:14
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 14, 2026
… mechanics

Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Security:
- Add OPENCODE_DISABLE_PROJECT_CONFIG=true to EnvExports (H1)
- Re-pin runner-owned env vars after .env source, mirroring pi/codex (H6)
- Migrate tools: to permission: field matching upstream schema (H3/H5)
- Fix LS tool mapping from "list" to "read" (H2)
- Add agent name validation in Bootstrap to prevent fallback (H7)

Run mechanics:
- Add clearStrayProcesses to ClearIterationArtifacts (H4)
- Move rc file under output/ so it is cleaned between iterations (H8)
- Make final exit conditional on prelude success (H8)
- Add --print-logs --log-level DEBUG when Debug is set (H9)
- Propagate stream parseErr to adjust exit code (B6)

Assisted-by: claude-opus
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 14, 2026
Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Docs:
- Add opencode to architecture.md runtime selection diagram (H11)
- Add opencode to layered-config-reference.md valid values (H11)
- Tick runtime-implementation.md checklist boxes (H11)
- Change "Experimental" to "Planned" callout for deferred features (B2)
- Fix "opt-in per org" to "opt-in per repo" per ADR 0044 (H10)
- Update tools: references to permission: in opencode.md (H3)

Config:
- Restore ADR 0044 deprecation guard in TestOrgConfigValidateRuntime (H10)
- Add write-agent note to ValidRuntimes doc comment (B14)

Image:
- Add OpenCode binary to base sandbox Containerfile (B12)

Assisted-by: claude-opus
@yvonnedevlinrh
yvonnedevlinrh force-pushed the feat/opencode-runtime-510 branch from 57fd03c to 0ce83aa Compare September 16, 2026 09:26
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
… mechanics

Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Security:
- Add OPENCODE_DISABLE_PROJECT_CONFIG=true to EnvExports (H1)
- Re-pin runner-owned env vars after .env source, mirroring pi/codex (H6)
- Migrate tools: to permission: field matching upstream schema (H3/H5)
- Fix LS tool mapping from "list" to "read" (H2)
- Add agent name validation in Bootstrap to prevent fallback (H7)

Run mechanics:
- Add clearStrayProcesses to ClearIterationArtifacts (H4)
- Move rc file under output/ so it is cleaned between iterations (H8)
- Make final exit conditional on prelude success (H8)
- Add --print-logs --log-level DEBUG when Debug is set (H9)
- Propagate stream parseErr to adjust exit code (B6)

Assisted-by: claude-opus
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Docs:
- Add opencode to architecture.md runtime selection diagram (H11)
- Add opencode to layered-config-reference.md valid values (H11)
- Tick runtime-implementation.md checklist boxes (H11)
- Change "Experimental" to "Planned" callout for deferred features (B2)
- Fix "opt-in per org" to "opt-in per repo" per ADR 0044 (H10)
- Update tools: references to permission: in opencode.md (H3)

Config:
- Restore ADR 0044 deprecation guard in TestOrgConfigValidateRuntime (H10)
- Add write-agent note to ValidRuntimes doc comment (B14)

Image:
- Add OpenCode binary to base sandbox Containerfile (B12)

Assisted-by: claude-opus
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
… mechanics

Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Security:
- Add OPENCODE_DISABLE_PROJECT_CONFIG=true to EnvExports (H1)
- Re-pin runner-owned env vars after .env source, mirroring pi/codex (H6)
- Migrate tools: to permission: field matching upstream schema (H3/H5)
- Fix LS tool mapping from "list" to "read" (H2)
- Add agent name validation in Bootstrap to prevent fallback (H7)

Run mechanics:
- Add clearStrayProcesses to ClearIterationArtifacts (H4)
- Move rc file under output/ so it is cleaned between iterations (H8)
- Make final exit conditional on prelude success (H8)
- Add --print-logs --log-level DEBUG when Debug is set (H9)
- Propagate stream parseErr to adjust exit code (B6)

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
Address PR fullsend-ai#7103 review feedback from @waynesun09 and @qodo-code-review:

Docs:
- Add opencode to architecture.md runtime selection diagram (H11)
- Add opencode to layered-config-reference.md valid values (H11)
- Tick runtime-implementation.md checklist boxes (H11)
- Change "Experimental" to "Planned" callout for deferred features (B2)
- Fix "opt-in per org" to "opt-in per repo" per ADR 0044 (H10)
- Update tools: references to permission: in opencode.md (H3)

Config:
- Restore ADR 0044 deprecation guard in TestOrgConfigValidateRuntime (H10)
- Add write-agent note to ValidRuntimes doc comment (B14)

Image:
- Add OpenCode binary to base sandbox Containerfile (B12)

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
@yvonnedevlinrh
yvonnedevlinrh force-pushed the feat/opencode-runtime-510 branch from 0ce83aa to 034c3b3 Compare September 16, 2026 09:49
yvonnedevlinrh and others added 27 commits October 15, 2026 18:00
…egress glob

Addresses review council findings from PR fullsend-ai#7103.

- Containerfile: replace unanchored grep version check with exact string
  comparison matching the codex sibling, and scope the error message to
  the version step only (curl/tar/chmod failures no longer mislabelled
  as version mismatch).
- openCodeUtilityPin: check each utility individually and name the
  missing one in the error message instead of a generic "utility not
  found".
- Drop **/opencode.exe from the Vertex egress profile, the
  runtime_binaries_test table, the scaffold_test assertion, and
  runtime-implementation.md. The Containerfile installs only
  /usr/local/bin/opencode; no install step produces opencode.exe.

Signed-off-by: Yvonne Devlin <[email protected]>
Assisted-by: OpenCode (google-vertex-anthropic/claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
Defense-in-depth: add a non-empty guard for FULLSEND_DISPATCH_SECRET
in runGitLabWebhook before constructing poll.Options, consistent with
how --project, CI_COMMIT_REF_NAME, and TRIGGER_PAYLOAD are validated
in the same function. The downstream validation in RunWebhook already
fails closed (state.go:388), so this surfaces the error earlier with
a clearer message.

Addresses PR fullsend-ai#7103 review feedback (self-RC finding 1).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
…tion

Add a code comment explaining that the %%s format verb (instead of %%w)
in CreateRepoSecret error wrapping is intentional: redactSecretValues
scrubs secret values from the error message before it propagates to
logs, and no callers inspect the returned error with errors.Is/As.

Addresses PR fullsend-ai#7103 review feedback (self-RC finding 2).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
- opencode.md: change "third" to "fourth" agent runtime (codex is third)
- agent.md: add opencode to agent new --runtime options list, matching
  agent set --runtime which already includes it

Addresses PR fullsend-ai#7103 review feedback (self-RC findings 5, 8).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
OpenCode uses Vertex WIF via OPENCODE_CONFIG_CONTENT, so UsesVertex()
correctly returns true. Add an explicit case (instead of relying on
the default branch) to document the intent and prevent accidental
breakage if a non-Vertex runtime is added above the default. Add
opencode to TestUsesVertex coverage.

Addresses PR fullsend-ai#7103 review feedback (self-RC finding 9).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
- poll: test malformed-entry drop paths in decodePendingLabels and
  restoreDispatchedKeys (corrupted base64, invalid JSON, empty key)
- forge/github: test GetRepoSecretProtection (exists, missing, error)
- forge/gitlab: test ListPullRequestCommits multi-page pagination
- scm/github, scm/gitlab: test GetFileContentAtRef driver wrappers

Addresses PR fullsend-ai#7103 review feedback (self-RC findings 11-15).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
Add timeout=30 to subprocess.run in run_gh() to prevent indefinite
hangs if the GitHub API stalls. The gh CLI has its own network
timeouts, but this adds a hard upper bound at the process level.

Addresses PR fullsend-ai#7103 review feedback (self-RC finding 16).

Assisted-by: claude-opus
Signed-off-by: Yvonne Devlin <[email protected]>
Reverts four commits that addressed self-review-council findings
outside the OpenCode runtime scope. These belong in separate PRs:

- 907a48e fix(cli): validate FULLSEND_DISPATCH_SECRET early
- f01a654 docs(repos): document intentional %%s wrapping
- 72d4bb6 test: add coverage for poll, forge, scm drivers
- 3caee3d fix(skills): add subprocess timeout to adr-corner

Addresses PR fullsend-ai#7103 review feedback from @waynesun09.

Assisted-by: OpenCode (claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
… loading

- Make /sandbox/opencode-config root-owned mode 0750 (Containerfile)
  so the agent cannot write plugins or rewrite agent definitions.
- Expand openCodeDangerousEnvVars from 4 to 20 entries, covering
  OPENCODE_AUTH_CONTENT, OPENCODE_MODELS_*, OPENCODE_DB,
  OPENCODE_TEST_HOME, XDG_*, LD_PRELOAD/LIBRARY_PATH/AUDIT,
  NODE_OPTIONS, NODE_PATH, and BUN_OPTIONS.
- Pin HOME and PATH before .env, restore after, so a hostile .env
  cannot redirect config loading via $HOME/.opencode.
- Export OPENCODE_DISABLE_EXTERNAL_SKILLS=true to suppress skill and
  nested instruction discovery from the workspace and $HOME.
- Add GOOGLE_CLOUD_LOCATION mapping from CLOUD_ML_REGION for Vertex
  region parity with pi (pi_run.go:464).

Addresses PR fullsend-ai#7103 review feedback from @waynesun09 (threads 1,3,6,9,10).

Assisted-by: OpenCode (claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
…nt fallback detection

- Omit pattern-map values from parseTrustedPermissionPolicy instead
  of collapsing to "deny", so the global per-command rule applies.
- Treat "ask" like "deny" in intersectPermissionRecord: headless runs
  auto-reject ask prompts, so agent "allow" must not widen past "ask".
- Map fullsend effort levels to OpenCode --variant values via
  openCodeEffortFor; unrecognized efforts (off, minimal) are warned
  and --variant is omitted.
- Add openCodeVerifyAgent: after uploading agent/<name>.md, run
  `opencode debug agent <name>` and assert mode:primary, catching
  silent fallback-to-default-agent scenarios.

Addresses PR fullsend-ai#7103 review feedback from @waynesun09 (threads 2,7,11).

Assisted-by: OpenCode (claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
…docs

- Move openCodeRunRCFile and the tee transcript from output/ to
  runner-state/ so ExtractOutputFiles does not collect them as
  agent outputs. ClearIterationArtifacts wipes both dirs.
- Update docs/runtimes/opencode.md: security.enabled:true returns a
  Go-level error before the sandbox command is built, not exit 97.
  The exit-97 guard shape is reserved for fullsend-ai#515.

Addresses PR fullsend-ai#7103 review feedback from @waynesun09 (threads 4,5).

Assisted-by: OpenCode (claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
Fix two regressions and one gap from review (fullsend-ai#7103):

Containerfile: change opencode-config dir from 0750 to 0775. The
root-owned 0750 mode (a656e09) blocked Bootstrap mkdir and run
prelude opencode.json writes — both run as the sandbox user. 0775
restores group-write for gid sandbox while keeping root ownership.
Full config-dir lockdown deferred to the hook adapter (fullsend-ai#7824).

Permission intersection: parseTrustedPermissionPolicy now returns a
patternMapTools set alongside the flat policy map.
intersectPermissionRecord skips the wildcard fallback for tools in
that set, preventing two failure modes from 89dfd5d: (a) a flat
agent allow overriding the global pattern-map via findLast when no
wildcard exists, and (b) a wildcard deny capping per-command allows
the pattern map defines.

Stream parsing: parseOpenCodeStream returns a malformedLines count
(invalid JSON envelopes and per-type unmarshal failures). The exit-0
guard in opencode_run.go now also checks malformedLines > 0. sawError
is set before the error-event payload unmarshal so a corrupt error
line still marks the run as failed.

Docs: add opencode to config-reference.md valid runtime values,
update glossary.md (was 'stub'), fix runtimes.md count ('All four'),
add opencode to cli-internals.md agent-new flag.

Signed-off-by: Yvonne Devlin <[email protected]>
- Fix intersectPermissionRecord to delete pattern-map tool entries from
  the agent frontmatter rather than leaving a flat allow in place.
  A flat bash: "allow" in the agent record overrides the global
  pattern-map via OpenCode's findLast semantics, widening bash to every
  command instead of just the allowed ones.
- Add fable alias to openCodeModelAliases and correct haiku from
  @default to @20251001, matching the google-vertex-anthropic catalog.
  Add openCodeDocumentedAliases and a coverage test mirroring pi's.
- Correct ConfigDir comment: mode is 0775 (not 0750), writes come from
  the run prelude (not openshell/root), lockdown deferred to fullsend-ai#7824.
- Fix security feature matrix: OpenCode's context injection scan and
  runtime content scan cells were marked as active but both are disabled
  by the required security.enabled: false workaround until fullsend-ai#515 lands.
- Add docs/cli/agent.md to the runtime-implementation.md checklist.
- Add fullsend-ai#7824 callout to docs/runtimes/opencode.md Config discovery so
  the group-writable state is visible and "runner-owned" is not
  misread as "the agent cannot change it".

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Yvonne Devlin <[email protected]>
Three bugs confirmed valid from waynesun09 review 5532929662:

- intersectPermissionRecord deleted patternMapTools entries unconditionally,
  removing an agent's explicit bash: "deny" for agents that never asked for
  Bash, leaving no frontmatter rule so the global pattern-map's
  "gh *: allow" applied via findLast. Fix: only delete when
  agentAction == "allow".

- The patternMapTools deletion pass ran after the len(trustedPolicy) == 0
  early return, so a trusted config whose permission block consisted entirely
  of pattern-map rules (trustedPolicy empty after parsing) left the agent's
  flat bash: "allow" intact, overriding the pattern-map via findLast. Fix:
  move the patternMapTools pass before the early return.

- openCodePermissionRecord emitted explicit denies only for the 12 known
  tool IDs in openCodeAllToolIDs; MCP tools, plugin tools, and tools added
  in later OpenCode releases defaulted to "*: allow". Fix: emit "*": "deny"
  as a catch-all for restricted agents.

- The run prelude did not map ANTHROPIC_VERTEX_PROJECT_ID to
  GOOGLE_CLOUD_PROJECT; upstream google-vertex-anthropic reads
  GOOGLE_CLOUD_PROJECT (not ANTHROPIC_VERTEX_PROJECT_ID), so project-scoped
  Vertex calls would fail on the fleet. Fix: add the mapping mirroring
  pi_run.go:519.

- The unconditional export of GOOGLE_CLOUD_LOCATION exported an empty string
  when both GOOGLE_CLOUD_LOCATION and CLOUD_ML_REGION were unset. Upstream
  JS uses ?? which does not treat "" as absent, so the "global" fallback
  never fired. Fix: export only when the resolved value is non-empty.

Tests added for the two new intersectPermissionRecord edge cases
(agent-without-Bash + pattern-map, pattern-map-only trusted policy)
and updated to assert the "*": "deny" wildcard in restricted agent records.

Signed-off-by: Yvonne Devlin <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Yvonne Devlin <[email protected]>
agent new --runtime opencode did not generate the OPENCODE_CONFIG_CONTENT
env.sandbox entry. Bootstrap validates this env var on startup and fails
closed when it is absent or has no permission block, so a harness produced
by agent new would fail at first run without a manual edit.

Add the entry in render.go alongside the Vertex credentials block.
Add TestOpenCodeHarnessHasOpenCodeConfigContent to assert the entry is
present and the generated harness loads cleanly.
Add TestNonOpenCodeHarnessLacksOpenCodeConfigContent to guard that the
entry does not appear in default, pi, or codex harnesses.
Update docs/runtimes/opencode.md to note that agent new generates the
env.sandbox mapping automatically; the --env-file supply step stays.

Signed-off-by: Yvonne Devlin <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Copy a trusted pattern-map rule into the agent permission record
  instead of deleting the agent's allow. The agent-level "*": "deny" is
  evaluated after the global rules, so deleting the key denied the tool
  outright.
- Re-upload the translated agent file before every iteration and fail
  the iteration when OpenCode prints "Falling back to default agent".
- Align the opus/sonnet/haiku aliases with the other Claude-family
  runtimes (5.5 catalog ids) and add a parity test.
- Fix the stale GOOGLE_CLOUD_LOCATION assertion, test the empty-region
  case, and skip the sha256sum-pinned shell tests on hosts without it.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
- Bump OpenCode to 1.19.1 (latest 1.x). Its built-in model catalog has
  the claude-*-5-5@default ids the opus/sonnet/haiku aliases resolve to;
  1.18.30's did not, and the sandbox cannot reach models.opencode.ai.
  Set OPENCODE_DISABLE_MODELS_FETCH so OpenCode does not try.
- Before each iteration, remove the other places OpenCode loads agent
  overrides from (agent/, agents/, mode/, modes/, opencode.jsonc, the
  user-level config dirs), re-upload the agent file and re-run
  `opencode debug agent`.
- In debug mode, check the debug log for the fallback warning, since
  stderr is redirected there.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
One haiku run through OpenCode Bootstrap/Run with a bash pattern-map
trusted policy. Gated on the undeclared runtime-opencode capability
until fullsend-sandbox:latest ships OpenCode.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
Main now uploads harness skills to skills/<declared SKILL.md name>
through uploadHarnessSkills (fullsend-ai#7830). Use it for OpenCode too, so nested
forge skills that share a basename keep distinct destinations.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
- Apply the agent definition's frontmatter model when the harness names
  none (EffectiveModel), as Claude Code and Codex do.
- Unset an exported empty GOOGLE_CLOUD_LOCATION so OpenCode keeps its
  global default.
- Mark a transcript with malformed lines or a read error as an error,
  matching the live run's verdict.
- Before each iteration also clear tool/, tools/, command/, commands/,
  a cached models.json and auth.json, which OpenCode loads code, models
  or remote config from.
- Behaviour smoke agent writes through $FULLSEND_OUTPUT_DIR, so the
  scenario's policy does not deny an external-directory mkdir.
- Use the standard Planned callout in the OpenCode docs.

Assisted-by: Claude (fix), Claude (review)
Signed-off-by: Wayne Sun <[email protected]>
Rewrite docs/runtimes/opencode.md as a local-run walkthrough with real
output, a models table, and a troubleshooting table. Move the
permission-intersection and per-iteration reset detail to the runtime
implementation guide. Trim duplicated OpenCode notes in the runtimes
index and roughly halve the OpenCode runtime's code comments, keeping
the security reasons and upstream citations.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
OpenCode applies the last matching permission rule, and keys can be
globs. The intersection looked the tool up by exact key in a Go map,
so a trusted {"read":"allow","*":"deny"} still let an agent
allow read. Parse the trusted rules in order and use the last rule
whose key matches the tool.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
The per-iteration reset ran before the run command sources the
agent-writable .env, which can run any command and re-plant the removed
overrides. Repeat the reset in the prelude after .env with a pinned rm,
and fail with exit 98 when the agent file's SHA-256 no longer matches
the verified copy. Also create the output directory, which no other
OpenCode step created.

Docs: add the fable alias, correct the config-error rows, show how to
add the harness entry without a duplicate env key, and name plugin/
and skill/ among the paths that stay writable.

Assisted-by: Claude (fix), Claude (review)
Signed-off-by: Wayne Sun <[email protected]>
OpenCode matches both the tool and the argument pattern, so with
{"*":"allow","bash":{"rm *":"deny"}} it still allows ls. Copying
only the bash map let the agent's own "*": "deny" reject ls. Give a
declared tool every trusted rule that applies to it, in order.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
… dirs

Go's ordered parse and OpenCode's JSON.parse read a permission object
with a repeated key differently, so the translated agent record could
widen the trusted policy. Reject duplicate keys in the trusted policy.

The runner installs no OpenCode plugins yet, so the per-iteration reset
now also clears plugin/, plugins/ and skill/. Only skills/, which holds
the runner's skills, stays writable until fullsend-ai#7824.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
…gent

opencode debug agent ran with the previous iteration's agent-writable
opencode.json. Clear it with the other overrides; the run prelude
writes the runner's copy after the reset.

Assisted-by: Claude
Signed-off-by: Wayne Sun <[email protected]>
@waynesun09

Copy link
Copy Markdown
Member

This branch now carries the work from #8473, which is closed. Your 33 commits are kept with authorship and sign-off, rebased onto current main. The commits on top close the open review findings. OpenCode stays read-only-agents-only until the hook adapter lands (#7824); the docs say so.

Fixes on top:

  • Permission order: trusted rules are applied in config order with glob keys, as OpenCode does (last match wins), so a trusted {"read":"allow","*":"deny"} can no longer be widened by the agent.
  • Pattern-map permissions: when the trusted policy gives a tool a pattern map (bash: {"gh *": "allow", "*": "deny"}), an agent that declares the tool now gets that pattern map. Before this fix, the agent-level "*": "deny" denied the tool outright.
  • Agent fallback: before every iteration the runner clears the other places OpenCode loads agent overrides from (agent/, agents/, mode/, modes/, opencode.jsonc, $HOME/.opencode, $HOME/.config/opencode), re-uploads the translated agent file and re-runs opencode debug agent. An iteration fails when OpenCode prints Falling back to default agent, on stderr or, in debug mode, in the debug log.
  • OpenCode 1.19.1: the pin moves from 1.18.30 to 1.19.1 (latest 1.x, both tarball checksums verified). Its built-in catalog has claude-*-5-5@default, and OPENCODE_DISABLE_MODELS_FETCH=true keeps the sandbox on that catalog. The runtime's flags, event stream, permission evaluation and agent loading are unchanged from 1.18.30. OpenCode 2.x is a separate rewrite with breaking CLI and config changes and no release tarballs, so it is left for a later migration.
  • Model aliases: opus, sonnet and haiku resolve to the same 5.5 generation as the other Claude-family runtimes (claude-*-5-5@default). A parity test checks this. OpenCode has no model fallback chain yet (feat(runtime/opencode): fall back along the alias chain when a model is not served #8476), so on a Vertex project that does not serve 5.5, name a model the project serves.
  • Skills: OpenCode uses the shared uploadHarnessSkills from Forge skills that share a directory basename replace each other: review loses issue-labels #7830, so skills land at skills/<declared SKILL.md name>.
  • Reset after .env: the run prelude repeats the override reset after sourcing the agent-writable .env and fails (exit 98) if the agent file's SHA-256 changed.
  • Smaller fixes: the agent's frontmatter model: applies when the harness names none (as on Claude Code and Codex); an exported empty GOOGLE_CLOUD_LOCATION is unset; a transcript with malformed lines is reported as an error. The per-iteration reset also clears tool/, tools/, command/, commands/, a cached models.json and auth.json.
  • Docs: docs/runtimes/opencode.md is now a short local-run walkthrough with real output, a models table and troubleshooting; the mechanics moved to the runtime implementation guide. Code comments are trimmed.
  • Tests: fixed the stale GOOGLE_CLOUD_LOCATION assertion and covered the empty-region case. The tests that need sha256sum in the pinned utility directories now skip on hosts without it (macOS).

Out of scope

The hook adapter (#7824), credential redaction (#7320), Renovate for OPENCODE_VERSION (#8201), and the Vertex @default suffix handling (#7823).

Test plan

  • go build ./..., and pre-commit run --from-ref origin/main --to-ref HEAD
  • Tests for the touched packages on Linux (Fedora 44): internal/runtime, agentnew, cli, config, repos, scaffold, sandbox, harness, pkg/behaviourtest/...
  • A local fullsend run triage with runtime: opencode (OpenCode 1.19.1 sandbox image built from this branch), against the throwaway repo nonflux/tmp-8473-opencode, with a trusted bash pattern-map policy: agent exit 0, output validation passed. Re-run at the final head after the post-.env reset and agent-file check: exit 0, validation passed. With claude-sonnet-5-5@default the id resolves from the 1.19.1 catalog; the Vertex project used for testing does not serve 5.5 (availability is per project), so that run used claude-sonnet-4-6@default.
  • OpenCode behaviour test: e2e/behaviour/features/runtime/opencode.feature, gated on the runtime-opencode capability. Not run: it needs a published sandbox image that contains OpenCode, which exists only after this merges.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the fixes on top of the author's commits; CI green, all threads resolved, local OpenCode triage run passed.

This branch was successfully deployed

1 active deployment
dev — a638f511 Deployed Oct 16, 2026 by waynesun09 via run / behaviour #4697
site-preview — a638f511 Deployed Oct 16, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants