block / block/thread-manager-for-amp

Auth fails: secrets.json not found (Amp stores credentials in system keychain)

Open
#79 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6
Forks
7
PR merge metrics
No merged PRs in 30d

Description

The server expects the Amp API key at `~/.local/share/amp/secrets.json` (see `server/lib/amp-api.ts:getAmpToken()`), but current versions of Amp store auth credentials in the system keychain rather than a plain JSON file.

This causes the backfill and all API-dependent features to fail on startup:

```
[prompt-history] Backfill failed: Error: Not authenticated with Amp. Please run "amp" to log in.
at callAmpInternalAPI (server/lib/amp-api.ts:80:11)
```

The user is authenticated — `amp` works fine from the CLI — but `secrets.json` simply does not exist.

**Environment:**
- Amp CLI 0.0.1779209758
- Ubuntu 24.04 / Node 26
- No `secret-tool` or other keychain CLI available

**Possible approaches:**
- Shell out to `amp` CLI (available via `$AMP_BIN`) for authenticated API calls
- Use the OS keychain API (e.g., `keytar` or `libsecret`) to read the stored token
- Support an env var override (e.g., `AMP_API_TOKEN`) as a fallback

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.