Skip to content

fix(opencode): profile instructions fail before model call under write-jail #145

Description

@drewstone

Problem

OpenCode exits before the model call when AgentProfile instructions are materialized under the host write jail.

Reproduction

  1. Run current CLI Bridge commit 4176081 with BRIDGE_BACKENDS=opencode, OPENCODE_EXECUTOR=host, and BRIDGE_JAIL_MODE=write-jail.
  2. Send an OpenCode turn with a temporary project as cwd and an AgentProfile that contains prompt.instructions.
  3. The profile materializer creates .opencode/profile-instructions.md and opencode.json.
  4. OpenCode exits 1 before any model usage.

Observed bridge error:

opencode exited 1: Error: Unexpected error
Unknown: FileSystem.writeFile (<workspace>/.opencode/.gitignore)

The receipt reports the requested instructions as supported and materialized, but the run returns zero calls and zero tokens.

Expected

OpenCode profile materialization and the write jail must compose. The runner should be able to initialize its generated config without making the tracked project writable.

A durable fix could place generated OpenCode state in the writable scratch tree, pre-materialize every required generated file, or mount only the generated config area writable. It must not weaken the project read-only boundary silently.

Product impact

A valid Braid AgentProfile with instructions fails through CLI Bridge before model execution. Removing prompt.instructions avoids this specific failure, so the profile dimension is the trigger.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions