fix(opencode): the auth check is the binary, and create takes the adapter's verdict (Issue #60, Linux item 3)
opencode 2.x needs no login: a fresh HOME runs a free default model and a local provider has no key, while 2.x keeps no auth.json. auth_ok is now "opencode on PATH or under <HOME>/.opencode/bin". `python -m lib_py.agents auth-ok <agent>` exits with an adapter's verdict, and create's opencode branch uses it (same 7 lines) instead of its own auth.json/key test and `opencode --version`, which wrote a line to the real opencode log. test_a4's opencode block now pins the binary rule (decision D1, required by the brief's item 3 and by both reviewers). Other agents are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7803d47026
commit
d17cd80bd9
5 files changed
+100
-17
No files matched your search
@@ -143,9 +143,9 @@ elif [ "$AGENT" = "grok" ]; then
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$AGENT" = "opencode" ]; then
|
||||
if [ -f "$HOME/.local/share/opencode/auth.json" ] || [ -n "${ANTHROPIC_API_KEY:-}" ] || [ -n "${OPENAI_API_KEY:-}" ] || [ -n "${GEMINI_API_KEY:-}" ] || [ -n "${GROQ_API_KEY:-}" ]; then
|
||||
true
|
||||
elif ! opencode --version >/dev/null 2>&1; then
|
||||
# opencode needs no login (2.x: a free default model, keyless local
|
||||
# providers); the adapter's auth_ok is the one verdict.
|
||||
if ! "$(_delegate_py_bin)" -m lib_py.agents auth-ok opencode >/dev/null 2>&1; then
|
||||
echo "ERROR: opencode is not functional or configured." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user