agent: log when a configured working directory is rejected and falls back to home
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- go
- Área
- backend, observability-sre
Línea de trabajo
Lee usershell.ResolveWorkingDir y los dos puntos de llamada, agentssh.Server.resolveWorkingDir y agentproc.manager.resolveWorkingDir. Rastrea primero el rechazo de stat/IsDir y la resolución de SSH EnvInfoer. Se considera terminado cuando los diagnósticos de nivel warn en los puntos de llamada incluyen las rutas configurada y realmente resuelta cuando una configuración no vacía recae en el directorio home, mientras el resolver compartido sigue sin logger.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
usershell.ResolveWorkingDir (introduced in coder/coder#26102) uses a configured working directory when it exists as a directory, and otherwise silently falls back to the user's home directory. The callers (the agentssh SSH command and SFTP paths, and agentproc) do not distinguish "used the configured directory" from "fell back to home," so a rejected configured directory produces no log or metric.
Scenario: an admin sets the agent directory to a path that does not exist or is not accessible (bad mount, wrong permissions). SSH and SFTP sessions silently land in $HOME. Nothing correlates the rejected directory with the session, so support cannot explain why sessions start in the wrong place.
This is pre-existing behavior. All three resolvers fell back silently before the unification, which preserved the contract rather than introducing it.
How to verify
Read usershell.ResolveWorkingDir and the two call sites (agentssh.Server.resolveWorkingDir and agentproc.manager.resolveWorkingDir). When the configured directory is non-empty but fails the stat/IsDir check, the function returns the home directory with a nil error and nothing is logged.
Desired outcome
When a non-empty configured working directory is rejected and resolution falls back to home, the agent emits a diagnostic (a warn-level log with the configured and resolved paths) at the call sites that have a logger. The shared resolver stays logger-free.
Constraints
- Keep the shared
usershell.ResolveWorkingDirfree of a logger dependency. The diagnostic belongs at the call sites. - The SSH command path resolves against a per-session EnvInfoer (container override), so the log there should reflect the actual resolved directory rather than assume the host.
Follow-up to coder/coder#26102 (deep-review CRF-1).
🤖 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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
flake
-
flake
Todos los issues de coder/internal
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mksglu/context-mode#1200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100