Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

agent: route remaining home-directory lookups through usershell EnvInfoer

Abierto
#1,572 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
go
Área
backend

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

tech-debt

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.go resolving ~/.Xauthority
  • agent/agentscripts/agentscripts.go expanding ~ in script log paths
  • agent/agentcontextconfig/resolve.go expanding ~ in context-config paths
  • agent/agentfiles/ls.go resolving the home base for LSRelativityHome
  • agent/agentcontainers/ignore/dir.go resolving 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, and agent/agentcontainers/ignore do not currently receive an EnvInfoer. 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.go calls user.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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de coder/internal

Todos los issues de coder/internal

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.