agent: route remaining home-directory lookups through usershell EnvInfoer
まだ誰も着手していません。
評価
調査の方向性
列挙された5つのGoファイルから始め、EnvInfoerがすでにagent全体でどのように受け渡されているかを調査し、提供されたgrepコマンドを使って残っている直接ルックアップを見つけます。各サブシステムに必要なplumbingを判断する前に、既存のusershell seamを追跡してください。agent/agentsocket/socket_windows.goは変更せず、agent/usershellの外にあるテスト以外のagentのルックアップがEnvInfoerを迂回しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
agent/usershell is the canonical place to resolve a user's home directory and shell, and usershell.EnvInfoer is the injectable seam that lets SSH sessions, the process API, and tests override that resolution (host vs container vs deterministic test environment). coder/coder#26102 routed working-directory resolution, MOTD/hushlogin lookup, manifest path expansion, and secret-file injection through EnvInfoer, and unexported usershell.HomeDir/usershell.Get so the host is no longer reachable directly from the resolution path.
Several agent subsystems still call os.UserHomeDir() (and user.Current()) directly, bypassing the injected EnvInfoer. In a container session, or a test with an injected environment, these resolve the host home directory instead of the intended one.
Remaining sites as of coder/coder#26102:
agent/agentssh/x11.goresolving~/.Xauthorityagent/agentscripts/agentscripts.goexpanding~in script log pathsagent/agentcontextconfig/resolve.goexpanding~in context-config pathsagent/agentfiles/ls.goresolving the home base forLSRelativityHomeagent/agentcontainers/ignore/dir.goresolving the global gitignore home
How to verify
From the coder/coder repo root:
grep -rn 'os\.UserHomeDir\|user\.Current' --include='*.go' agent/ | grep -v '/usershell/' | grep -v '_test.go'
Every hit outside agent/usershell is a direct lookup that does not consult an EnvInfoer.
Desired outcome
These subsystems resolve the home directory through an EnvInfoer (the same one already plumbed into the agent), so injected and container environments are honored consistently. After this, the only direct home/user lookups in the agent tree should live inside agent/usershell, which backs SystemEnvInfo.
Constraints
agent/agentscripts,agent/agentcontextconfig,agent/agentfiles, andagent/agentcontainers/ignoredo not currently receive anEnvInfoer. Threading the seam into each is the bulk of the work, and the reason this is split out from coder/coder#26102 rather than bundled in.agent/agentsocket/socket_windows.gocallsuser.Current()for the current user's SID to set Windows socket ACLs. That is a real OS-identity check, not home/shell resolution, and should stay on the OS user rather than an injectable seam. Leave it as-is.
Follow-up to coder/coder#26102. Parent: coder/internal#1560.
🤖 Filed by Coder Agents on behalf of @mafredri.
- 主要言語
- 言語のデータがありません
- スター
- 3
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/internal のほかの issue
-
flake
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
flake
-
flake
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100