Linux: Secrets.ts set exits 1 after a successful write because keychainRead spawns the missing macOS security binary

Aperta Adatta ai principianti
#2,997 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, macos, typescript
Ambito
backend

Direzione di ricerca

Leggi LIFEOS/TOOLS/Secrets.ts, iniziando da keychainRead vicino alla riga 94 e dalla sua chiamata da cmdSet vicino alla riga 327. Riproduci il problema su Linux con Secrets.ts set KEY e verifica che un binario security mancante venga trattato come assenza di un’identità di sigillatura. Il lavoro è concluso quando il valore viene scritto, compare la nota esistente “not sealed” e il comando termina con codice 0.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version

LifeOS 8.761.0 · attestation: 1 system file(s) differ from danielmiessler/[email protected] · 8 system file(s) missing:

  • skills/LifeOS/SKILL.md
What is broken

On Linux, Secrets.ts set KEY writes the value to .env correctly and then exits 1 with Executable not found in $PATH: "security". After the write, cmdSet calls keychainRead() to decide whether to reseal, and keychainRead spawns the macOS security binary through run(). Bun.spawnSync throws ENOENT when the binary does not exist, instead of returning a non-zero exit, so the throw escapes before the intended "not sealed" message is printed. A user sees a failure for a key that was in fact stored, and any script that checks the exit code treats a good write as a failed one. Related: #2536 (no non-Keychain identity store on Linux); this report is narrower: the missing binary should read as "no seal identity", not crash.

Where (file:line)

LIFEOS/TOOLS/Secrets.ts:94 (keychainRead → run → Bun.spawnSync throws ENOENT), reached from cmdSet at :327

Repro on a clean tree
1. On Linux (no `security` binary), run `printf x | LIFEOS_SECRETS_ENV=/tmp/probe.env bun ~/.claude/LIFEOS/TOOLS/Secrets.ts set PROBE_KEY`.
2. Output: `✓ set PROBE_KEY in /tmp/probe.env (mode 600; value not shown)`, then on stderr `✗ Executable not found in $PATH: "security"`, exit 1.
3. `/tmp/probe.env` does contain the new PROBE_KEY line: the write succeeded and only the reseal check crashed.
4. Workaround: `LIFEOS_SECRETS_SECURITY_BIN=false` makes `keychainRead` get a non-zero exit, and `set` ends with the expected "not sealed" note and exit 0.
Negative control

Probe: cd "$PROBEDIR" && printf x | LIFEOS_SECRETS_ENV=probe.env bun ~/.claude/LIFEOS/TOOLS/Secrets.ts set PROBE_KEY · exit 1 · captured 2026-11-28T00:21:47.487Z

Red looks like: Executable not found in $PATH: "security"

✓ set PROBE_KEY in probe.env (mode 600; value not shown)

--- stderr ---
✗ Executable not found in $PATH: "security"
Suggested fix

Make keychainRead() return null when the security binary is missing (catch the ENOENT from run(), or check Bun.which(SECURITY_BIN) first), so a machine with no Keychain reads as "no seal identity". cmdSet then prints its existing "not sealed" note and exits 0. keychainWrite (used by init) should give a clear "macOS Keychain required, see #2536" error instead of a raw ENOENT.

Environment
  • OS: CachyOS (x64)
  • Harness: claude-code
  • bun: 1.4.5 · git: 2.56.1
  • Doctor broken: none
Lingua principale
TypeScript
Stelle
20k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.