Skip to content

fix: write the recall allow as a V1 permission rule so OpenCode V1 1.19+ starts - #122

Draft
MaheshtheDev wants to merge 1 commit into
mainfrom
capy/write-the-recall-allow
Draft

MaheshtheDev wants to merge 1 commit into
mainfrom
capy/write-the-recall-allow

Conversation

@MaheshtheDev

Copy link
Copy Markdown
Member

The installer added the OpenCode 2 rule "permissions": [{ "action": "supermemory_recall", "resource": "*", "effect": "allow" }] to the shared ~/.config/opencode/opencode.jsonc. OpenCode V1 1.19.0 and later refuse to start when that key is present:

Configuration is invalid at ~/.config/opencode/opencode.jsonc
↳ V2 permissions are not supported by OpenCode V1. Use V1 "permission" rules or run opencode2. permissions

This happened on a clean opencode-supermemory@2.1.0 install with opencode-ai@1.19.5 during the SCR-325 plugin end-to-end pass.

The installer now writes the V1 form, "permission": { "supermemory_recall": "allow" }. OpenCode V1 accepts it, and OpenCode 2 converts it into exactly the old V2 rule. Configs written by earlier versions are repaired on the next install: our own V2 allow is removed from permissions (the key is dropped if nothing else is left), and any other user rules stay. An explicit deny in either form is still preserved with a warning, and status reports the recall rule from either form.

Verified with opencode debug config / opencode2 debug config on the config the installer now produces:

Runtime Before After
opencode-ai 1.19.0 / 1.19.5 (V1) invalid config loads, permission.supermemory_recall = "allow"
@opencode/cli 2.2.5 (OpenCode 2) rule present same rule present: [{"action":"supermemory_recall","resource":"*","effect":"allow"}]

bun test (34 pass) and bun run typecheck are clean. OpenCode V1 1.17 and 1.18 still reject the shared file, because they don't recognise the plugins key at all. That limitation predates this change and is not addressed here.

Open in Capy

…19+ starts

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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