bug: agentop uninstall misses a Claude Code project settings file given as a relative path or as a second file

Aperta Adatta ai principianti
#1,882 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Inizia da runClaudeCode in cmd/agentop/cmd_claudecode.go e dai percorsi recordedSettings e planUnrouteClaudeCode indicati nell’issue. Segui come vengono registrati i percorsi delle impostazioni e i valori precedenti, quindi aggiungi i due test richiesti: uno per un percorso delle impostazioni relativo e uno per l’abilitazione con un secondo file. Il lavoro è completato quando uninstall e doctor gestiscono il percorso relativo e un secondo tentativo di abilitazione viene rifiutato con un messaggio che indica il primo file.

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

Descrizione

bug laptop

Problem

agentop uninstall and agentop doctor can miss a Claude Code project settings file that configure claude-code enable --settings <file> changed. That project then keeps HTTPS_PROXY=localhost:47600, and Claude Code in that project fails after uninstall. No message tells the user.

There are two cases.

Case 1: a relative --settings path
  1. In a project directory: agentop configure claude-code enable --settings .claude/settings.json.
  2. Enable writes the path to the record as given (Settings: pl.settingsPath, cmd/agentop/cmd_claudecode.go:554). It never applies filepath.Abs. The only filepath.Abs calls in the file are for the CA paths (:384, :390).
  3. recordedSettings (cmd/agentop/cmd_doctor.go:194-199) returns "" for a relative path.
  4. planUnrouteClaudeCode (cmd/agentop/cmd_uninstall.go:398-415) then checks only ~/.claude/settings.json. The project file stays routed. Doctor does not check it either.
Case 2: a second project file
  1. enable --settings /a/.claude/settings.json, then enable --settings /b/.claude/settings.json.
  2. writeState (cmd_claudecode.go:122-144) keeps the old Prior only when the path is the same (:129). For a different path, it replaces the record.
  3. The record now names only /b. Uninstall leaves /a routed.
  4. A later disable on /a finds no Prior, so it deletes the managed keys. If /a held a user value (for example a corporate proxy) before enable, that value is lost.

Fix

  • Case 1: *settingsPath, _ = filepath.Abs(*settingsPath) in runClaudeCode (cmd_claudecode.go:277).
  • Case 2: refuse a second enable while the record names a different file, with a message that names the first file.

Add a test for each case.

Impact if not fixed

Claude Code in the project points at a dead proxy after uninstall. In case 2, the user's own value in the first file can be lost.

Lingua principale
Go
Stelle
26
Fork
46
Merge medio
9h 55m
PR unite (30g)
257

Preparare l'ambiente

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 rossoctl/cortex

Tutte le issue di rossoctl/cortex

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.