bug(opencode): early local identity failures hide actionable recovery diagnostics
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Existing Issue Search
- I searched existing issues and will add evidence to a canonical tracker when applicable.
Searched open and closed issues for OpenCode diagnostics and stale binaries. #2016 remains the tracker for the original healthy-server registration failure. Its disk-migration occurrence supplies evidence for this narrower diagnostic defect. #1705 concerned setup reconciliation of an existing MCP command, not this early plugin-readiness diagnostic.
📝 Observed Consequence
When the OpenCode plugin cannot execute its selected Engram binary or obtain a valid local identity, attributed writes expose the generic session-registration error without actionable detail. After moving an installation, users cannot distinguish a stale baked binary path from another identity-command failure, even when doctor or a separately invoked CLI works.
🔄 Steps to Reproduce
- Use the OpenCode adapter from main at 2ceda3cc35ac76e50cca64db20b74aaeba8107e7.
- In isolated adapter fixtures, select a nonexistent baked binary path and simulate spawnSync ENOENT; similarly exercise a stale explicit override, failed launch/nonzero exit, invalid identity stdout, and health identity mismatch.
- Invoke the attributed mem_save hook and inspect its error and queued degraded warning.
- On the base, six new diagnostic cases fail because the output remains generic; the valid-override compatibility control passes. No real installation, database or service changes are needed.
Field evidence: https://github.com/Gentleman-Programming/engram/issues/2016#issuecomment-6447034366 reports Core 3.6.0 on Windows after disk migration, a nonexistent baked ENGRAM_BIN, no health/registration requests, and recovery after rerunning setup from the current installation and restarting OpenCode. This explains that occurrence only, not the original healthy-server report.
✅ Expected Behavior
Expose privacy-safe, actionable diagnostics for missing selected binary, failed identity command, invalid identity output, and health identity mismatch. Identify explicit override versus setup-default selection without paths, identity values or raw command output. Give supported setup-and-restart recovery for a stale baked path and override correction guidance where applicable.
Preserve binary precedence, explicit ENGRAM_URL behavior, identity/auth/session guards, registration rejection and acknowledgement handling. A valid override must still succeed despite a stale baked default. No automatic PATH fallback, automatic server replacement/termination, guard weakening or self-healing framework.
❌ Actual Behavior
On the investigated base, localInstanceID failure is caught before health/session registration and surfaces as: gentle-engram could not confirm Engram session registration for engram_mem_save; verify that the Engram server is available and retry. Startup/readiness categories do not identify the selected-binary failure or recovery.
Operating System
Windows; deterministic adapter fixtures also run through existing cross-platform OpenCode suites.
Release Version (Report Context)
Field occurrence: Core 3.6.0. Investigated current-main base: 2ceda3cc35ac76e50cca64db20b74aaeba8107e7. Candidate: c0ee4ebfac3ad765ce08f526f73a28ba17d00dea in PR #2167. No claim of reproducing the original healthy-server failure.
Agent / Client
OpenCode (field report: V2).
📋 Relevant Logs
Base diagnostic regression: 7 tests, 1 pass, 6 fail.
Candidate focused diagnostics: 8 pass, 0 fail, 0 skip.
Candidate OpenCode three-file suites: 281 pass, 0 fail, 0 skip.
💡 Additional Context
Root-cause evidence on the base: plugin/opencode/engram.ts:219-255 validates instance-id and catches failure without exposing cause; :668-705 registers sessions only after readiness/project resolution; :895 emits the generic error when no registration cause exists. internal/setup/setup.go:488-543 bakes the selected absolute fallback into the installed plugin.
Accepted narrow correction is implemented in PR #2167: diagnostics and recovery documentation only; source/embedded parity and setup literal-patch compatibility preserved. Native RDD review approved and acknowledged the exact candidate without corrections. Local Go 1.26.10 setup patch/install tests pass. Hosted Unit/E2E/plugin/platform checks passed when inspected; Go Race Tests failed in a separate unchanged CLI test, tracked under #2169 and not declared resolved.
This tracker is intentionally split from #2016 after review identified that closing the original issue would overstate the result. The maintainer authorized creating, approving and assigning this bounded diagnostic tracker to dnlrsls and changing PR linkage. #2016 must remain open. No new source scope or CI rerun is authorized by this metadata correction.
- Dominant language
- Go
- Stars
- 7.1k
- Forks
- 729
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 331
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Gentleman-Programming/engram
-
status:needs-review type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Gentleman-Programming/engram#2138 ·
Maintainers usually reply within 1 day
-
status:needs-review
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Gentleman-Programming/engram#2065 ·
Maintainers usually reply within 1 day
-
bug(tests): investigate session-owned startup failure assertion under Linux race CIPossibly taken @dnlrsls claimed this today. Openstatus:needs-review type:bug
Gentleman-Programming/engram#2169 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
status:needs-review type:bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Gentleman-Programming/engram#2166 ·
Maintainers usually reply within 1 day
-
fix(test): prevent autosync requests racing with TLS fixture cleanupPossibly taken @dnlrsls claimed this today. Openstatus:approved type:bug
Gentleman-Programming/engram#2165 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Gentleman-Programming/engram
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ovh/ovhcloud-cli#309 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area/docs
Difficulty 1/5 Under an hour Newbie friendliness 92/100
layer5io/getnighthawk#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day