Skip to content

fix(agents): render OpenCode agents and preserve selected links - #20

Merged
urmzd merged 1 commit into
mainfrom
fix/opencode-agent-portability
Sep 12, 2026
Merged

urmzd merged 1 commit into
mainfrom
fix/opencode-agent-portability

Conversation

@urmzd

@urmzd urmzd commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

OpenCode cannot load Claude model aliases/tool allowlists or Copilot fallback model arrays copied unchanged into its agent directory. Render agent metadata at the tool boundary: preserve exact per-tool models overrides (including gateway prefixes), inherit OpenCode's calling model for Claude aliases, and translate supported Claude tool allowlists into OpenCode permissions. Reject unsupported OpenCode model/tool shapes before writing.

Use ~/.config/opencode/{agents,skills} for global resources. Agent links become rendered copies, with refresh and integrity checks using the same renderer. Unchanged native files retain their original bytes.

Sync now reconciles existing links and repairs explicitly tracked destinations instead of enabling every resource in every installed tool. Explicit unlinking survives sync; the upstream excluded_tools behavior remains intact. Document exact model overrides and migration from legacy agent symlinks/directories.

Test plan

  • cargo fmt --all -- --check
  • cargo test -p agentspec --offline: 104 unit tests and 46 integration tests passed. Disabled Git commit signing only in the test process.
  • cargo clippy -p agentspec --offline --all-targets -- -D warnings
  • Regression coverage for proxy IDs, scoped permissions, unchanged native hashes, rendered-copy verification, missing-link repair, and unlink persistence.
  • OpenCode 1.18.30 startup discovers eight rendered portable agents after backing up incompatible legacy definitions.

Provider authentication and model inference were not exercised. Existing agent symlinks need an explicit unlink/re-link to activate rendering; legacy OpenCode definitions must be backed up and removed from discovery separately.

@urmzd
urmzd merged commit b670e07 into main Sep 12, 2026
6 checks passed
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.

1 participant