Skip to content

Port: declare 'model:' in opencode-rescue agent frontmatter #39

Closed

Description

@JohnnyVicious

Port of openai/codex-plugin-cc#169 (merged)

Current state

plugins/opencode/agents/opencode-rescue.md has no model field in its frontmatter:

---
name: opencode-rescue
description: Proactively use when Claude Code is stuck, wants a second implementation or diagnosis pass, needs a deeper root-cause investigation, or should hand a substantial coding task to OpenCode through the shared runtime
tools: Bash
skills:
  - opencode-runtime
  - opencode-prompting
---

Without model, Claude Code assigns whatever default tier it chooses at runtime, giving no tier guarantee and an unpredictable cost profile.

Why it matters

opencode-rescue is a thin forwarding wrapper — its entire job is to invoke opencode-companion.mjs task ... via a single Bash call, apply trivial routing logic (--background vs --wait, --resume vs --fresh), and return the companion stdout unchanged. It does not need a heavy reasoning tier.

Fix

Add a model: field. Upstream picked sonnet (not haiku) because the routing logic — detecting "continue"/"fresh" intent, choosing background vs foreground based on task complexity — is slightly above pure mechanical forwarding. Match upstream:

 ---
 name: opencode-rescue
 description: Proactively use when Claude Code is stuck, wants a second implementation or diagnosis pass, needs a deeper root-cause investigation, or should hand a substantial coding task to OpenCode through the shared runtime
+model: sonnet
 tools: Bash
 skills:
   - opencode-runtime
   - opencode-prompting
 ---

If subsequent testing shows haiku handles the routing reliably, downgrade. The important thing is that the field is declared explicitly so users have a cost guarantee.

Upstream reference

openai/codex-plugin-cc#169 (merged 2026-04-08).

Activity

  1. JohnnyVicious commented on Apr 12, 2026

    @JohnnyVicious
    OwnerAuthor

    Consolidated into #17. The rescue-agent model frontmatter is only relevant if the forwarding design keeps the subagent; track that decision in the canonical rescue contract issue.

  2. added 2 commits that reference this issue on Apr 12, 2026
    6665b2d
    e6a18bc
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