[bug] LifeOSHooks sandbox breaks subagent Bash in auto mode
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 53/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start with pluginPlan in hooks/SubagentGitSandbox.hook.ts and inspect wrapInline plus the local tests described in the issue. Verify exact recognition of a wrap for the current profile and that near matches, including a trailing command, are rejected. Done when exact wrapped commands are handled safely and the reported auto mode flow is verified end to end.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened
LifeOSHooks sandbox breaks subagent Bash in auto mode
Summary
Environment: LifeOS 8.761.0, Claude Code 2.1.322, macOS, auto mode, LIFEOS_SUBAGENT_SANDBOX=on, LifeOSHooks plugin loaded.
Problem. The plugin rewrites a subagent's Bash call into a sandbox-exec wrap after the auto-mode classifier has reviewed it. Claude Code then refuses the call: "a hook changed this call's input after auto mode reviewed it". Re-issuing the rewritten command, as the refusal suggests, fails the same way, because it gets wrapped again. Calls the classifier does not review (echo) still run. Git, tests and file writes do not, so subagents cannot do shell work in auto mode.
Cause. pluginPlan (the bridge's plan op) in hooks/SubagentGitSandbox.hook.ts always returns wrapInline(wrap, profile). Nothing recognises a command that is already that exact wrap.
Suggested fix. Treat a command that is exactly wrapInline(inner, profile) for the current profile as already sandboxed: return it unchanged, and give inner to the classic PreToolUse hooks. The match must be exact. A prefix check is a sandbox escape: <wrap>; touch .git/HEAD passes it, and the tail runs outside the sandbox (reproduced).
function unwrapExact(cmd: string, profile: string, shell = "/bin/zsh"): string | null {
const head = `${SANDBOX_EXEC_BIN} -p ${shQuote(profile)} ${shell} -c `;
if (!cmd.startsWith(head)) return null;
const rest = cmd.slice(head.length);
if (!/^'(?:[^']|'\\'')*'$/.test(rest)) return null; // one quoted word, nothing after it
const inner = rest.slice(1, -1).replaceAll(`'\\''`, "'");
return wrapInline(inner, profile, shell) === cmd ? inner : null;
}
Five local tests pass against the shipped wrapInline. They show that the wrap is not idempotent today, that an exact wrap is recognised, that a plain command, another profile or a trailing word is not, that the prefix-check escape is real, and that the real wrap denies it. Not yet verified: that auto mode then accepts the re-issued command end to end.
Workaround: default permission mode for subagent-heavy work.
Details
- Kind: bug
- LifeOS version: 8.761.0
Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.
- Lenguaje dominante
- TypeScript
- Estrellas
- 19.9k
- Forks
- 2.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: 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 danielmiessler/LifeOS
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
danielmiessler/LifeOS#2894 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
danielmiessler/LifeOS#2891 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
danielmiessler/LifeOS#2888 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
danielmiessler/LifeOS#2886 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
danielmiessler/LifeOS#2848 ·
Los mantenedores suelen responder en 5 días
Todos los issues de danielmiessler/LifeOS
Issues similares
-
ready-for-agent
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
LucasSantana-Dev/Lucky#3257 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
XiaomiMiMo/MiMo-Code#2849 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement frontend good first issue help wanted testing-infrastructure
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
enhancement follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
obsidian-tasks-group/obsidian-tasks#4155 ·
Los mantenedores suelen responder en 1 día