Skip to content

fix: store app PEM secret immediately after creation - #515

Merged
rh-hemartin merged 1 commit into
mainfrom
fix/324-store-pem-immediately
May 5, 2026
Merged

rh-hemartin merged 1 commit into
mainfrom
fix/324-store-pem-immediately

Conversation

@rh-hemartin

Copy link
Copy Markdown
Member

Summary

  • Store each app's PEM secret on the .fullsend repo immediately after creation (via StoreSecretFunc callback), instead of deferring to SecretsLayer — survives partial install failures
  • Ensure .fullsend config repo exists before app setup begins so secrets have a storage target
  • Recover from a related partial failure: if the process exits after creating an app but before installing it on the org, re-runs detect the existing app (PEM secret + GetAppClientID lookup) and resume installation instead of trying to recreate

Closes #324

Test plan

  • TestSetup_ExistingApp_Reuse_StoreSecretNotCalled — reuse path skips store callback
  • TestSetup_RecoverCreatedApp_PEMExists — detects app created in previous run
  • TestSetup_RecoverCreatedApp_KnownSlug — recovery works with non-standard slug
  • TestSetup_RecoverCreatedApp_NoPEM — no false recovery when PEM absent
  • TestSetup_RecoverCreatedApp_NoSecretExistsFunc — graceful nil when no checker
  • TestEnsureConfigRepoExists_CreatesWhenMissing — creates repo when absent
  • TestEnsureConfigRepoExists_NoOpWhenExists — idempotent when repo exists
  • TestEnsureConfigRepoExists_ReturnsError — propagates non-404 errors
  • go vet clean, make lint clean

🤖 Generated with Claude Code

Closes #324. Previously PEM secrets were only stored when SecretsLayer
ran, so a failure between app creation and secret storage lost the PEM
permanently. Now each PEM is stored right after the manifest flow via a
StoreSecretFunc callback, and the .fullsend config repo is ensured to
exist before app setup begins.

Also adds recovery for a related partial-failure scenario: if the
process exits after creating an app but before installing it on the
org, re-runs now detect the existing app (via PEM secret + app client
ID lookup) and resume installation instead of trying to recreate it.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://dfa4cdb2-site.fullsend-ai.workers.dev

Commit: c0f1e5ff2e6b89107697e9cdc4686fc4e90d75fb

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: #515

Head SHA: c0f1e5f
Timestamp: 2026-04-29T00:00:00Z
Outcome: approve

Summary

This PR correctly addresses issue #324 by storing each app's PEM secret immediately after creation (via a StoreSecretFunc callback) and adding a recovery path for partially failed installs where the app was created but not installed on the org. The .fullsend config repo is now ensured to exist before app setup begins, providing a valid storage target. The changes are well-scoped, follow existing patterns (builder methods, error wrapping, test structure), and include thorough test coverage across reuse, recovery, and repo-creation paths. No security concerns — PEM storage uses the existing encrypted repo secret mechanism and the config repo is created as private.

Findings

Critical

None.

High

None.

Medium

None.

Low

  • [Correctness] internal/appsetup/appsetup.go:recoverCreatedApp — The recovered AppCredentials has a zero-value AppID (unlike handleExistingApp which populates it from the installation). Currently harmless since downstream consumers don't use AppID, but creates an inconsistency that could cause subtle bugs if future code relies on AppID from the recovery path.
    Remediation: Consider fetching the app ID via the API or documenting the zero-value contract.

  • [Style] internal/appsetup/appsetup.go:recoverCreatedApp — When the known slug equals the expected slug, the same slug is checked twice via GetAppClientID. Harmless but slightly wasteful.
    Remediation: Deduplicate the candidates slice.

Info

  • [Style] internal/cli/admin_test.go — discardWriter type is duplicated across appsetup_test.go and admin_test.go. Acceptable since they're in separate test packages.

Footer

Outcome: approve
This review applies to SHA c0f1e5ff2e6b89107697e9cdc4686fc4e90d75fb. Any push to the PR head clears this review and requires a new evaluation.

@rh-hemartin
rh-hemartin added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit 17905a4 May 5, 2026
7 of 8 checks passed
@rh-hemartin
rh-hemartin deleted the fix/324-store-pem-immediately branch May 5, 2026 10:03
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 8, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 8, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 14, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 16, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 21, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 23, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 24, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 24, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 25, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 29, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 29, 2026
…ecklist

- Expand the security.enabled: false warning in docs/runtimes/opencode.md
  to disclose all five suppressed scan stages, not just the exit-97 guard.
- Document OPENCODE_CONFIG_CONTENT in the Running it locally section with
  a minimal JSON example and corrected env-file command.
- Add fail-closed check in Run() when hooks are enabled but the adapter
  bytes are nil (not yet available until fullsend-ai#515).
- Clarify AGENTS.md-only instruction behavior in Behaviour differences.
- Tick all 11 consumer-completeness checklist boxes in
  docs/contributing/runtime-implementation.md.
- Fix broken #planned-write-path-support anchor link.

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

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 30, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 30, 2026
…ecklist

- Expand the security.enabled: false warning in docs/runtimes/opencode.md
  to disclose all five suppressed scan stages, not just the exit-97 guard.
- Document OPENCODE_CONFIG_CONTENT in the Running it locally section with
  a minimal JSON example and corrected env-file command.
- Add fail-closed check in Run() when hooks are enabled but the adapter
  bytes are nil (not yet available until fullsend-ai#515).
- Clarify AGENTS.md-only instruction behavior in Behaviour differences.
- Tick all 11 consumer-completeness checklist boxes in
  docs/contributing/runtime-implementation.md.
- Fix broken #planned-write-path-support anchor link.

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

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 30, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Sep 30, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 1, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 7, 2026
…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)
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 8, 2026
…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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 13, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 13, 2026
…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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 13, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 13, 2026
…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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
- 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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
…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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
- 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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
- 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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for fullsend-ai#515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / fullsend-ai#515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
…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]>
yvonnedevlinrh added a commit to yvonnedevlinrh/fullsend that referenced this pull request Oct 15, 2026
- 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]>
waynesun09 pushed a commit that referenced this pull request Oct 15, 2026
Bootstrap/Run/ExtractTranscripts/ConfigDir for the OpenCode agent runtime,
mirroring the pi runtime pattern. Flip config.ValidRuntimes() to include
"opencode" so org/per-repo/per-agent config can select it.

What lands in this PR
- sandbox.SandboxOpenCodeConfig (/sandbox/opencode-config) — runner-owned
  config dir, off the agent-writable workspace. Path convention pinned by
  unbound-force#515 (hook adapter also lives here under plugins/).
- opencode.go: ConfigDir → SandboxOpenCodeConfig; EnvExports exports
  OPENCODE_CONFIG_DIR (runner-owned dir pointer), OPENCODE_CONFIG_CONTENT
  (Vertex provider + permission-deny config, merges last in opencode's config
  stack so it wins over any repo config), and GOOGLE_APPLICATION_CREDENTIALS;
  implements DebugLogNamer.
- opencode_bootstrap.go: Bootstrap() creates agent/, skills/, plugins/ under
  ConfigDir; translates the Claude-style agent .md to OpenCode's
  {agent,agents}/**/*.md layout with JSON frontmatter (mode: primary, tools
  as {toolID: bool}); uploads harness skills; preflights opencode --version.
  No ClaudeHooksBootstrap — hook adapter is unbound-force#515; plugin path
  reserved at ConfigDir/plugins/fullsend-hooks.ts with sha256 fail-closed
  guard shape (exit 97, before .env) for #515 to populate.
- opencode_run.go: buildOpenCodeRunCommand renders "opencode run --format json
  --model <provider/model> --variant <effort> --agent <name> <prompt>
  </dev/null"; honors RunParams.Prompt (feedback_mode); shell-escapes all
  interpolated values (sh -c boundary); emits InitEvent from RunParams.Model
  (wire format carries no model metadata); captures ResultEvent metrics;
  overrides exit 0 when the stream reports an error (same as pi).
- opencode_transcript.go: ExtractTranscripts downloads the tee'd output.jsonl
  (interim approach; full redesign → unbound-force#513); ParseTranscriptFile
  replays ndjson through parseOpenCodeStream for the exit-0 override;
  ExtractDebugLog downloads opencode-debug.log.
- config.ValidRuntimes(): adds "opencode"; all call sites that hardcoded
  "opencode" as a rejected stub updated to accept it or use "nonexistent"
  for the invalid-name coverage.
- docs/contributing/runtime-implementation.md: security matrix OpenCode
  column filled in (hooks: not wired / #515; transcripts: interim tee;
  host-side scans: runtime-agnostic). docs/runtimes.md: config-key table
  OpenCode column added; runtime table entry updated from "Stub" to
  "Implemented".
- 44 new tests; patch coverage on new opencode production files ≈ 82%.

What does NOT land (owned by unbound-force#515)
- Hook plugin adapter (tool.execute.before/after) — path reserved.
- SandboxHooksBootstrap type-assert in Bootstrap.
- ContextBridger: omitted — opencode reads AGENTS.md natively.

Phase 0 (opencode headless in sandbox) confirmed via unbound-force#509.
ConfigDir path + sha256 convention pinned per unbound-force#515 comment.

Signed-off-by: Yvonne Devlin <[email protected]>
waynesun09 pushed a commit that referenced this pull request Oct 15, 2026
…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 #515.

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

Assisted-by: OpenCode (claude-opus-4-6@default)
Signed-off-by: Yvonne Devlin <[email protected]>
waynesun09 pushed a commit that referenced this pull request Oct 15, 2026
- 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 #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 #515 lands.
- Add docs/cli/agent.md to the runtime-implementation.md checklist.
- Add #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]>

This branch was successfully deployed

1 active deployment
site-preview — c0f1e5ff Deployed Apr 29, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store app PEM secret immediately after creation to survive partial install failures

1 participant