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

オープン 初心者向け
#1,882 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

まず、cmd/agentop/cmd_claudecode.go の runClaudeCode と、issue で挙げられている recordedSettings および planUnrouteClaudeCode の各パスを確認します。設定パスと以前の値がどのように記録されるかをたどり、次に依頼された2つのテストを追加します。1つは相対設定パス、もう1つは2つ目のファイルに対する有効化を対象にします。完了条件は、uninstall と doctor が相対パスを処理でき、2回目の有効化が最初のファイル名を示すメッセージとともに拒否されることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
26
フォーク
46
平均マージ
9時間 55分
マージ済み PR(30日)
257

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rossoctl/cortex のほかの issue

rossoctl/cortex の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。