agent: route remaining home-directory lookups through usershell EnvInfoer
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Comienza con los cinco archivos Go indicados e inspecciona cómo EnvInfoer ya se transmite a través del agente, utilizando el comando grep proporcionado para encontrar las búsquedas directas restantes. Sigue primero la interfaz existente de usershell antes de determinar el cableado necesario para cada subsistema. Se considera terminado cuando las búsquedas del agente que no sean de prueba fuera de agent/usershell ya no omitan EnvInfoer, mientras que agent/agentsocket/socket_windows.go permanece sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 3
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/internal
-
flake
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
chore: cleanup http transport debtPosiblemente ocupada @sreya la tomó hace 2 días. Abierto
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
flake: TestPubsubCluster/ClusterAuthRequiredQuizá libre de nuevo @sreya la tomó hace 53 días y no hay ningún pull request abierto. Abiertoflake
Todos los issues de coder/internal
Issues similares
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hyprwm/aquamarine#426 ·
Los mantenedores suelen responder en 1 día
-
Fallback after an HTTP-200 refusal/invalid response logs no cause and is labelled "provider failure"Abiertoarea/streaming comp/agent P2 provider/anthropic type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#124874 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
leptos-rs/leptos#4885 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día