From 3857c1f0512468bbc36ab19708fd9c6eb8c66137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timeless=E5=B0=8F=E5=B8=85?= <1250076672@qq.com> Date: Thu, 8 Oct 2026 23:56:06 +0800 Subject: [PATCH] Remove agent-memory plugin; track UTF-8 shell config and npm manifest agent-memory is removed: upstream (kurbezz/memory) states Windows is not supported, as the skill relies on absolute symlinks into the store and a Bash CLI. The checked-in plugins/agent-memory.js was a git symlink (mode 120000) to a Linux path, which Windows materialised as a 68-byte text file, failing to load with 'AggregateError: 7 errors building'. Now tracked so the setup is reproducible elsewhere: opencode.json and pwsh.cmd configure the UTF-8 shell (chcp 65001) that OpenCode's -NoProfile PowerShell otherwise lacks, and package.json records better-sqlite3, without which the sqlite plugin fails to resolve. --- .gitignore | 11 +++++++++++ opencode.json | 4 ++++ package.json | 1 + plugins/agent-memory.js | 1 - pwsh.cmd | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 opencode.json create mode 100644 package.json delete mode 120000 plugins/agent-memory.js create mode 100644 pwsh.cmd diff --git a/.gitignore b/.gitignore index e0bf55f..1519562 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,17 @@ !/plugins/ !/.gitignore +# Machine config for the UTF-8 shell fix (see https://www.xsinfo.vip/windows/01-opencode-utf8.html). +# OpenCode reads opencode.json from this directory and invokes pwsh.cmd as the shell, +# so both are needed to reproduce a working setup on another machine. Note the shell +# path in opencode.json is absolute and per-user, so it must be edited per machine. +!/opencode.json +!/pwsh.cmd + +# npm manifest for the sqlite plugin's better-sqlite3 dependency; without it the +# plugin fails to load with "Cannot find package 'better-sqlite3'". +!/package.json + # Belt and braces, in case a path is ever added from the parent side. node_modules/ *.log diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000..2ea898a --- /dev/null +++ b/opencode.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://opencode.ai/config.json", + "shell": "C:\\Users\\12500\\.config\\opencode\\pwsh.cmd" +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..ae8cef1 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{"name":"opencode-config","private":true,"dependencies":{"better-sqlite3":"^13.0.3"}} \ No newline at end of file diff --git a/plugins/agent-memory.js b/plugins/agent-memory.js deleted file mode 120000 index 9ba6c62..0000000 --- a/plugins/agent-memory.js +++ /dev/null @@ -1 +0,0 @@ -/home/xiaoshuai/.agents/skills/agent-memory/opencode/agent-memory.js \ No newline at end of file diff --git a/pwsh.cmd b/pwsh.cmd new file mode 100644 index 0000000..a01c433 --- /dev/null +++ b/pwsh.cmd @@ -0,0 +1,3 @@ +@echo off +chcp 65001 >nul +pwsh.exe %* \ No newline at end of file