amicus 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +32 -0
- package/README.md +3 -1
- package/docs/DISTRIBUTION.md +234 -0
- package/docs/ROADMAP.md +200 -0
- package/docs/SHIMS.md +62 -0
- package/docs/architecture.md +104 -0
- package/docs/configuration.md +371 -0
- package/docs/council.md +911 -0
- package/docs/doc-system.md +92 -0
- package/docs/electron-testing.md +471 -0
- package/docs/jsdoc-setup.md +75 -0
- package/docs/opencode-integration.md +114 -0
- package/docs/publishing.md +60 -0
- package/docs/schemas.md +55 -0
- package/docs/testing.md +589 -0
- package/docs/troubleshooting.md +298 -0
- package/docs/usage.md +699 -0
- package/electron/fold.js +1 -1
- package/electron/main.js +4 -1
- package/electron/setup-ui-aliases.js +6 -6
- package/electron/workspace-ui/live-model.js +12 -1
- package/electron/workspace-ui/md-lite.js +52 -8
- package/electron/workspace-ui/workspace-matrix.js +46 -9
- package/electron/workspace-ui/workspace-panels.js +14 -3
- package/electron/workspace-ui/workspace-render.js +7 -1
- package/electron/workspace-ui/workspace-verbs.js +48 -2
- package/package.json +8 -3
- package/schemas/council-run.schema.json +20 -0
- package/schemas/progress.schema.json +12 -0
- package/schemas/spend.schema.json +52 -4
- package/src/cli-handlers-spend.js +20 -2
- package/src/cli-handlers-watch.js +11 -0
- package/src/cli.js +4 -2
- package/src/council/briefings-debate.js +27 -7
- package/src/council/briefings-stage2.js +155 -25
- package/src/council/briefings.js +24 -1
- package/src/council/findings.js +236 -9
- package/src/council/parse-stage2.js +10 -2
- package/src/council/report.js +19 -8
- package/src/council/run-assemble.js +42 -1
- package/src/council/run-budget.js +64 -11
- package/src/council/run-chair.js +4 -1
- package/src/council/run-debate.js +4 -2
- package/src/council/run-finalize.js +102 -0
- package/src/council/run-launch.js +29 -1
- package/src/council/run-server.js +248 -0
- package/src/council/run-stage2.js +118 -0
- package/src/council/run-stages.js +132 -111
- package/src/council/run-state.js +23 -1
- package/src/council/run.js +44 -46
- package/src/council/tally.js +10 -0
- package/src/headless.js +175 -6
- package/src/observe/council-legs.js +60 -3
- package/src/observe/live-doc.js +18 -1
- package/src/observe/watch-render.js +4 -1
- package/src/sidecar/child-sessions.js +1 -2
- package/src/sidecar/fanout-leg-fallback.js +69 -21
- package/src/sidecar/fanout-leg.js +6 -0
- package/src/sidecar/fanout-signals.js +61 -0
- package/src/sidecar/fanout-wave-io.js +75 -0
- package/src/sidecar/fanout.js +61 -70
- package/src/sidecar/progress-fields.js +26 -4
- package/src/sidecar/progress.js +8 -1
- package/src/sidecar/session-utils.js +23 -14
- package/src/spend-query.js +17 -5
- package/src/utils/lifecycle.js +37 -1
- package/src/utils/path-fence.js +39 -1
- package/src/utils/pricing.js +26 -10
- package/src/utils/server-setup.js +79 -1
- package/src/utils/spend-ledger.js +24 -3
- package/src/workspace/artifact-guard.js +22 -1
- package/src/workspace/fold-format.js +33 -4
- package/src/workspace/live-normalize.js +28 -15
- package/src/workspace/run-detail.js +7 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# Troubleshooting (Extended)
|
|
2
|
+
|
|
3
|
+
> Quick reference is in the [README Troubleshooting table](../README.md#troubleshooting).
|
|
4
|
+
> This document covers the same symptoms with more diagnostic depth.
|
|
5
|
+
|
|
6
|
+
## First: run `amicus doctor`
|
|
7
|
+
|
|
8
|
+
Before working through any symptom below, run `amicus doctor` (plugin-only installs: `npx -y amicus@latest doctor`). It checks, in order: Node version, config directory, API keys, default model, catalog freshness, alias staleness, the OpenCode binary, the OpenCode engine's MCP launch path, Electron, installed skills, MCP registration, the legacy sidecar MCP entry, session index tmp files, OpenRouter credit, local providers, and the project root — and prints a targeted fix hint for every failing check. `amicus doctor --fix` self-heals what it can (e.g. re-installs a broken Electron in place); `--json` gives machine-readable output.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Install Fails with `EEXIST: … claude-sidecar`
|
|
13
|
+
|
|
14
|
+
**Symptom:** `npm install -g amicus` fails with `npm error code EEXIST` naming a `claude-sidecar` (or `sidecar`) file under your global npm bin directory.
|
|
15
|
+
|
|
16
|
+
**Cause:** The old upstream `claude-sidecar` package is still installed globally. Through v1.x, Amicus shipped `sidecar`/`claude-sidecar` as deprecated bin aliases, which could also collide here — v2.0.0 no longer ships those aliases at all (removed in #19), so on a current install this is purely leftover from the old package.
|
|
17
|
+
|
|
18
|
+
**Fix:**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm uninstall -g claude-sidecar
|
|
22
|
+
npm install -g amicus
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Your keys and past sessions are not deleted by this swap, but v2.0.0 no longer reads them from the old locations automatically: config data was auto-migrated forward on every v1.x run, but if you're jumping straight from a pre-rebrand install, copy `~/.config/sidecar/` to `~/.config/amicus/` and rename any `.claude/sidecar_sessions/` dirs to `.claude/amicus_sessions/` by hand. See [docs/SHIMS.md](./SHIMS.md) for the full removal record.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Auth / 401 Errors
|
|
30
|
+
|
|
31
|
+
**Symptom:** `401 Unauthorized`, `invalid_api_key`, or `OPENROUTER_API_KEY is not set`.
|
|
32
|
+
|
|
33
|
+
**Key resolution order** (highest priority first, implemented in `src/utils/env-loader.js`):
|
|
34
|
+
1. `process.env` — environment variables already set in the shell at launch. Never overwritten.
|
|
35
|
+
2. `~/.config/amicus/.env` — keys saved via `amicus setup`. The legacy `~/.config/sidecar/.env` fallback was removed in v2.0.0 — see [docs/SHIMS.md](./SHIMS.md). If you're migrating a pre-rebrand install directly to v2.0.0, copy the file over by hand.
|
|
36
|
+
3. `~/.local/share/opencode/auth.json` — OpenCode SDK credential store (lowest priority; Amicus only reads, never writes here).
|
|
37
|
+
|
|
38
|
+
**Diagnostic steps:**
|
|
39
|
+
- `amicus setup` — re-enters the wizard and writes the key to `~/.config/amicus/.env`.
|
|
40
|
+
- Check the model prefix matches the key: `openrouter/…` requires `OPENROUTER_API_KEY`; `google/…` requires `GOOGLE_GENERATIVE_AI_API_KEY`; `openai/…` requires `OPENAI_API_KEY`; `anthropic/…` requires `ANTHROPIC_API_KEY`.
|
|
41
|
+
- `LOG_LEVEL=debug amicus start …` will log which source each key was loaded from.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Every Direct Anthropic Model Fails with `"Not Found"`
|
|
46
|
+
|
|
47
|
+
**Symptom:** Any model on the `anthropic/…` **direct** route — `haiku`, `sonnet`, `claude`, `opus`,
|
|
48
|
+
or an explicit `anthropic/claude-…` id — errors with exactly `Not Found` after ~2 s, with **zero
|
|
49
|
+
tokens** and no cost. The same model reached through OpenRouter
|
|
50
|
+
(`openrouter/anthropic/claude-haiku-4.5`) works normally. `amicus models --check` reports the alias
|
|
51
|
+
as valid, and `amicus doctor` reports the Anthropic key as valid, because both of those talk to
|
|
52
|
+
`api.anthropic.com` themselves rather than through the engine.
|
|
53
|
+
|
|
54
|
+
In a council this is worse than a plain failure: **a dead seat does not stop a run, it shrinks
|
|
55
|
+
one.** The council degrades around the missing model — the chair silently falls back, the bench
|
|
56
|
+
collapses from 3 seats to 2, and every finding comes back `confidence: "thin"` because it only ever
|
|
57
|
+
had one peer corroborator. Nothing in `verdict.json` records that the roster changed.
|
|
58
|
+
|
|
59
|
+
**Cause:** an `ANTHROPIC_BASE_URL` environment variable that is missing the `/v1` path segment.
|
|
60
|
+
The OpenCode engine passes it straight through to `@ai-sdk/anthropic` as the SDK `baseURL`, and the
|
|
61
|
+
SDK appends only `/messages` to it. With `ANTHROPIC_BASE_URL=https://api.anthropic.com` the engine
|
|
62
|
+
therefore posts to `https://api.anthropic.com/messages` instead of
|
|
63
|
+
`https://api.anthropic.com/v1/messages`. That URL returns HTTP **404 with an empty body**, so the AI
|
|
64
|
+
SDK has no error payload to report and surfaces the bare HTTP status text — `Not Found`. The model
|
|
65
|
+
id, the alias, and the API key are all fine; only the URL is wrong.
|
|
66
|
+
|
|
67
|
+
Some hosts set this variable for you. Notably, running `amicus` from a shell spawned by Claude Code
|
|
68
|
+
inherits `ANTHROPIC_BASE_URL=https://api.anthropic.com` (no `/v1`) from the host process, so amicus
|
|
69
|
+
can fail this way on a machine where nothing in the amicus config is wrong.
|
|
70
|
+
|
|
71
|
+
**Confirm it in one command** (no key needed for the first line):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
echo "$ANTHROPIC_BASE_URL" # if this prints a URL with no /v1 suffix, that's the cause
|
|
75
|
+
amicus start --model openrouter/anthropic/claude-haiku-4.5 --prompt hi --no-ui # works
|
|
76
|
+
amicus start --model haiku --prompt hi --no-ui # "Not Found"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Fix** — pick one:
|
|
80
|
+
- Add the missing segment: `export ANTHROPIC_BASE_URL=https://api.anthropic.com/v1`
|
|
81
|
+
- Or unset it entirely and let the SDK use its own default:
|
|
82
|
+
`unset ANTHROPIC_BASE_URL` (PowerShell: `Remove-Item Env:\ANTHROPIC_BASE_URL`)
|
|
83
|
+
- Or route Anthropic models through OpenRouter for the run: `--gateway openrouter`.
|
|
84
|
+
|
|
85
|
+
Either of the first two makes `amicus start --model haiku …` complete normally. **Before spending
|
|
86
|
+
money on a council, run one throwaway `amicus start` against each configured seat** — a
|
|
87
|
+
`Not Found` there costs nothing, whereas discovering it mid-council costs a degraded verdict.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## `Model 'X' is unverified against the direct catalog; attempting anyway`
|
|
92
|
+
|
|
93
|
+
**Symptom:** a launch-time notice on stderr naming a model that really does exist, e.g.
|
|
94
|
+
`Model 'deepseek/deepseek-v4-pro' is unverified against the direct catalog; attempting anyway.`
|
|
95
|
+
The run proceeds and may even succeed, so the notice is easy to scroll past.
|
|
96
|
+
|
|
97
|
+
**Cause:** the notice is not a claim that the model is wrong — it means amicus **could not check**.
|
|
98
|
+
`classifyModel()` is tri-state: `valid` / `invalid` / `unknown`, and `unknown` never blocks a
|
|
99
|
+
launch. It returns `unknown` when the cached catalog holds **no rows at all** for that vendor's
|
|
100
|
+
direct namespace, which happens when the direct fetch for that provider failed — most often because
|
|
101
|
+
the key amicus has stored for it is stale, truncated, or simply a different key from the one the
|
|
102
|
+
engine uses.
|
|
103
|
+
|
|
104
|
+
That split is the trap. Amicus resolves keys in the order listed under
|
|
105
|
+
[Auth / 401 Errors](#auth--401-errors), and the OpenCode engine keeps its own credential store in
|
|
106
|
+
`~/.local/share/opencode/auth.json`. If `~/.config/amicus/.env` holds a **bad** key for a provider
|
|
107
|
+
while `auth.json` holds a **good** one, amicus's catalog fetch 401s (→ empty namespace → the
|
|
108
|
+
notice) while the engine still runs the model successfully with the other key. You get a permanent
|
|
109
|
+
warning about a model that works, and no warning at all that one of your two stored keys is dead.
|
|
110
|
+
|
|
111
|
+
**Diagnose:**
|
|
112
|
+
```bash
|
|
113
|
+
amicus key # lists configured providers
|
|
114
|
+
amicus models --refresh # re-fetches every keyed provider; watch for a provider that stays empty
|
|
115
|
+
amicus models --check # audits every pinned alias route against the catalog
|
|
116
|
+
```
|
|
117
|
+
Then check the provider's own listing endpoint with the stored key (DeepSeek:
|
|
118
|
+
`GET https://api.deepseek.com/models`; Anthropic: `GET https://api.anthropic.com/v1/models`).
|
|
119
|
+
A `401` identifies the bad key.
|
|
120
|
+
|
|
121
|
+
**Fix:** re-save the working key so both stores agree — `amicus key <provider> <apikey>` (or
|
|
122
|
+
`amicus setup`) — then `amicus models --refresh`. The notice disappears once the vendor's direct
|
|
123
|
+
namespace has live rows again.
|
|
124
|
+
|
|
125
|
+
**If the model genuinely is retired,** the notice is the only warning you get before the launch
|
|
126
|
+
attempt: verify against the vendor's catalog and update the model id or drop the seat.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## OpenRouter 402 / "Payment Required" on First Call
|
|
131
|
+
|
|
132
|
+
**Symptom:** `amicus setup` and `amicus key openrouter <key>` both report the key as valid, but the first council review / `start` / `fanout` call against an OpenRouter model fails with `402 Payment Required`. (The `amicus council` subcommand itself is deterministic math and never calls a model, so it can't trigger this.)
|
|
133
|
+
|
|
134
|
+
**Cause:** Key save only checks that the key **authenticates** (`validateApiKey` — a `GET` against `openrouter.ai/api/v1/models`, which succeeds for any real key regardless of balance). It does not check credit; a zero-credit or free-tier-only key saves cleanly and only fails later, on the first paid-model call. `amicus doctor` DOES probe credit (the "OpenRouter credit" check, non-blocking) and the interactive `amicus setup` wizard prints a warning at the end if it detects zero credit or free-tier — but neither runs automatically after `amicus key`.
|
|
135
|
+
|
|
136
|
+
**Fix:**
|
|
137
|
+
- Run `amicus doctor` to confirm: it reports `openrouter-credit` as `warn` with the remaining-balance message if the key is zero-credit or free-tier-only.
|
|
138
|
+
- Add credit at [openrouter.ai/credits](https://openrouter.ai/credits), **or**
|
|
139
|
+
- Build a zero-cost council instead: `amicus setup` → option 2 (Free OpenRouter council) detects live `:free`-suffixed models and saves them as `councils.free`; then run `amicus fanout --council free …` (or let the `second-opinion` skill pick it up automatically).
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Session Not Found
|
|
144
|
+
|
|
145
|
+
**Symptom:** `Session <id> not found`, `Error: no recent session`.
|
|
146
|
+
|
|
147
|
+
**Causes and fixes:**
|
|
148
|
+
- **Explicit ID mismatch:** Run `amicus list` to see available sessions, then pass `--session-id <id>` explicitly.
|
|
149
|
+
- **Wrong project directory:** Amicus looks for sessions under `<project>/.claude/amicus_sessions/`. If you run from a different cwd, the session won't be found. Pass `--project <path>` to override.
|
|
150
|
+
- **Pre-rebrand sessions:** Sessions created before the Amicus rebrand live under `.claude/sidecar_sessions/`. The dual-read shim that used to resolve those automatically was removed in v2.0.0 — Amicus now only reads `.claude/amicus_sessions/`. Rename the directory to make old sessions visible again. See [docs/SHIMS.md](./SHIMS.md).
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## No Conversation History Found
|
|
155
|
+
|
|
156
|
+
**Symptom:** `No conversation history found` or empty context injected into the Amicus run.
|
|
157
|
+
|
|
158
|
+
**Cause:** Amicus reads Claude Code's session JSONL files from `~/.claude/projects/<encoded-path>/`. The project path is encoded by replacing `/`, `\`, `:`, and `_` with `-` (implemented in `src/session.js` `encodeProjectPath()`).
|
|
159
|
+
|
|
160
|
+
**Common encoding gotchas:**
|
|
161
|
+
- On Windows, `C:\Users\alice\myproject` encodes to `C--Users-alice-myproject` (the drive-letter colon becomes a dash, backslashes become dashes).
|
|
162
|
+
- Underscores in the path also become dashes, which can make two different paths collide.
|
|
163
|
+
|
|
164
|
+
**Diagnostic steps:**
|
|
165
|
+
- Run `ls ~/.claude/projects/` (or `dir` on Windows) to see what encoded directories exist.
|
|
166
|
+
- Compare the encoded name to `encodeProjectPath(process.cwd())` output: `node -e "console.log(require('./src/session').encodeProjectPath(process.cwd()))"` from the project root.
|
|
167
|
+
- If the directory is missing, Claude Code may not have run in that project yet — open a Claude Code session first.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Headless Run Never Finishes / Timeout
|
|
172
|
+
|
|
173
|
+
**Symptom:** `amicus start --no-ui` hangs or exits with `timedOut: true`.
|
|
174
|
+
|
|
175
|
+
**Primary knob:** `--timeout <minutes>` (default 15). Example: `--timeout 30`.
|
|
176
|
+
|
|
177
|
+
**Poller tuning** (env vars, all in `src/headless.js`):
|
|
178
|
+
|
|
179
|
+
| Variable | Default | Effect |
|
|
180
|
+
|----------|---------|--------|
|
|
181
|
+
| `AMICUS_POLL_INTERVAL_MS` | `2000` | Poll cadence in ms |
|
|
182
|
+
| `AMICUS_STABLE_FINISHED_POLLS` | `2` | Polls to wait after `time.completed` is set |
|
|
183
|
+
| `AMICUS_STABLE_IDLE_POLLS` | `30` | Polls to wait when no `time.completed` signal (~60 s) |
|
|
184
|
+
| `AMICUS_POLL_CALL_TIMEOUT_MS` | `30000` | Per `getMessages` call timeout |
|
|
185
|
+
| `AMICUS_MAX_CONSECUTIVE_POLL_FAILURES` | `15` | Bail out after N consecutive poll errors (~30 s) |
|
|
186
|
+
|
|
187
|
+
For full headless configuration, see [docs/configuration.md](./configuration.md).
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Multiple Active Sessions / Wrong Session Picked Up
|
|
192
|
+
|
|
193
|
+
**Symptom:** Amicus resumes or reads from the wrong session.
|
|
194
|
+
|
|
195
|
+
**Fix:** Pass `--session-id <id>` explicitly. When multiple sessions exist and no ID is specified, Amicus picks the most recent one by creation time. Run `amicus list` to inspect what's available.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Fold Summary Looks Corrupted
|
|
200
|
+
|
|
201
|
+
**Symptom:** The summary output contains debug log lines, JSON blobs, or other non-summary text.
|
|
202
|
+
|
|
203
|
+
**Cause:** `LOG_LEVEL` is set to a verbose level (`debug` or `info`) and those log lines are reaching stdout instead of stderr.
|
|
204
|
+
|
|
205
|
+
**Fix:** Re-run with `LOG_LEVEL=debug amicus start …` to confirm what is leaking, then check that no `console.log` or `logger.*` call in the hot path writes to stdout. All Amicus log output should go to stderr. The summary is captured from stdout only.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## "Council Review This" Does Nothing
|
|
210
|
+
|
|
211
|
+
**Symptom:** Typing `council review this` (or similar) in Claude Code produces no response or an error about the skill not being found.
|
|
212
|
+
|
|
213
|
+
**Cause:** The `second-opinion` skill is not installed in `~/.claude/skills/`.
|
|
214
|
+
|
|
215
|
+
**Fix:**
|
|
216
|
+
1. Check whether the skill file exists: `~/.claude/skills/second-opinion/SKILL.md`.
|
|
217
|
+
2. If absent, re-run `npm install -g amicus` — the postinstall script installs both the `sidecar` chat skill and the `second-opinion` council skill automatically.
|
|
218
|
+
3. If the file exists but Claude Code still ignores it, verify that `~/.claude/skills/` is on Claude Code's skill search path (check your `~/.claude/settings.json`).
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Model Fails Catalog Validation
|
|
223
|
+
|
|
224
|
+
**Symptom:** `Error: model 'xyz' not found in catalog` on `amicus start` or `amicus fanout`.
|
|
225
|
+
|
|
226
|
+
**Cause:** The model name isn't in the locally cached catalog (`~/.config/amicus/model-catalog.json`), either because the catalog is stale or the model was renamed upstream.
|
|
227
|
+
|
|
228
|
+
**Fix:**
|
|
229
|
+
- `amicus models --refresh` — fetches the current catalog from the OpenRouter API and updates the cache.
|
|
230
|
+
- `amicus models --search <term>` — search the catalog for the correct model ID.
|
|
231
|
+
- `--no-validate-model` — bypass catalog validation for this run (the model is still validated by the OpenCode server at prompt time).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Fanout Exits 2 (Partial Wave)
|
|
236
|
+
|
|
237
|
+
**Symptom:** `amicus fanout` exits with code 2.
|
|
238
|
+
|
|
239
|
+
**Meaning:** Exit code 2 means `partial` — at least one leg completed successfully and at least one did not. Exit code 1 means all legs failed (`error` or `aborted`). Exit code 0 means all legs completed.
|
|
240
|
+
|
|
241
|
+
**Diagnostic steps:**
|
|
242
|
+
1. Read the wave document: `amicus read <waveId> --json` or inspect `<project>/.claude/amicus_sessions/<waveId>/wave.json`.
|
|
243
|
+
2. Find legs with `status !== "complete"` in the `legs[]` array.
|
|
244
|
+
3. Read the individual leg: `amicus read <legId> --json` for the `error` field and the summary.
|
|
245
|
+
4. Re-run the failed leg independently: `amicus start --model <model> --prompt "…" --no-ui`.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Electron Download Fails Behind a Corporate Proxy
|
|
250
|
+
|
|
251
|
+
**Symptom:** The first interactive `amicus start` (or `amicus doctor --fix`) hangs or errors while "provisioning Electron", on a network that requires an HTTP/HTTPS proxy.
|
|
252
|
+
|
|
253
|
+
**Cause:** Amicus downloads the Electron binary via `@electron/get`. As of `@electron/get` 5.x (shipped with the Electron 43 upgrade), the downloader uses Node's native `fetch`, which — unlike the older `got`-based path — does **not** honor `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY` automatically. Proxied and authenticated-proxy environments are therefore not auto-detected.
|
|
254
|
+
|
|
255
|
+
**Fix:**
|
|
256
|
+
- **Manual install (most reliable):** on a machine/network with direct access, run any `amicus start` once to populate the Electron cache, then copy the cache directory to the target machine — `%LOCALAPPDATA%\electron\Cache` (Windows), `~/Library/Caches/electron` (macOS), `$XDG_CACHE_HOME/electron` or `~/.cache/electron` (Linux). Amicus reuses a valid cached binary without re-downloading.
|
|
257
|
+
- **Point at your own mirror:** set `ELECTRON_MIRROR` (and `ELECTRON_CUSTOM_DIR` if needed) to an internal Electron mirror that is reachable without a proxy.
|
|
258
|
+
- Headless runs and the full council never need Electron — use `--no-ui` if the GUI is not required.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## GUI Load Failsafe
|
|
263
|
+
|
|
264
|
+
**Symptom:** Interactive Amicus window shows a load-error page instead of the OpenCode UI, with a message about the UI not responding.
|
|
265
|
+
|
|
266
|
+
**Cause:** The OpenCode web UI did not load within the allowed window (default 15 000 ms). This can happen if the Go server is still cold-starting, or if the port is already in use.
|
|
267
|
+
|
|
268
|
+
**Fix:**
|
|
269
|
+
- Increase the timeout: `AMICUS_GUI_LOAD_TIMEOUT_MS=30000 amicus start …`
|
|
270
|
+
- Check whether another process is already using the target port: `netstat -ano | findstr <port>` (Windows) or `lsof -i :<port>` (macOS/Linux). (`amicus list --status running` shows running *sessions*, which may still hold a server — it does not list ports.)
|
|
271
|
+
- `AMICUS_SHARED_SERVER=0` forces a fresh per-process server if the shared server is in a bad state.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Shared Server Crash Loop
|
|
276
|
+
|
|
277
|
+
**Symptom:** `amicus start` fails repeatedly; logs show `Shared server crashed` followed by restart attempts.
|
|
278
|
+
|
|
279
|
+
**Cause:** The OpenCode Go binary is crashing on startup or shortly after. The `SharedServerManager` allows up to 3 restarts in a 5-minute window, then stops retrying.
|
|
280
|
+
|
|
281
|
+
**Fix:**
|
|
282
|
+
- `LOG_LEVEL=debug amicus start …` to capture the crash output from the Go process.
|
|
283
|
+
- `AMICUS_SHARED_SERVER=0` to fall back to per-process mode (bypasses the shared server entirely).
|
|
284
|
+
- Reinstall: `npm install -g amicus` to ensure the bundled `opencode-ai` binary is intact.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Amicus Process Not Self-Terminating
|
|
289
|
+
|
|
290
|
+
**Symptom:** `amicus start --no-ui` keeps running after the task completes.
|
|
291
|
+
|
|
292
|
+
**Cause:** The idle watchdog is disabled or has a very long timeout.
|
|
293
|
+
|
|
294
|
+
**Diagnostic steps:**
|
|
295
|
+
- Check per-mode overrides first: `AMICUS_IDLE_TIMEOUT_HEADLESS`, `AMICUS_IDLE_TIMEOUT_INTERACTIVE`, `AMICUS_IDLE_TIMEOUT_SERVER` (in minutes).
|
|
296
|
+
- The blanket `AMICUS_IDLE_TIMEOUT` overrides all modes.
|
|
297
|
+
- Setting any of these to `0` disables self-termination for that mode.
|
|
298
|
+
- `LOG_LEVEL=debug amicus start …` traces watchdog state transitions (`IdleWatchdog`).
|