[bug] MergeSettings.ts leaves { "__merge": "append" } wrappers under hooks in the…
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bun, typescript
- Área
- tooling
Línea de trabajo
Lee LIFEOS/TOOLS/MergeSettings.ts, especialmente mergeSettings, y sigue cómo se manejan las claves de objeto que solo existen en el usuario cuando la capa del sistema omite su elemento padre. Reprodúcelo con el JSON del sistema y del usuario proporcionados; luego comprueba que las anotaciones de anexado anidadas se resuelvan como arrays y que las demás claves de salida permanezcan sin cambios. Añade la prueba de regresión sugerida y ejecútala junto con el comando de merge usando --check.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened
MergeSettings.ts leaves { "__merge": "append" } wrappers under hooks in the generated settings.json when settings.system.json has no hooks key, so Claude Code ignores PostToolUse, SessionStart, Stop and UserPromptSubmit hooks
Summary
What happens
LIFEOS/TOOLS/MergeSettings.ts writes { "__merge": "append", "values": [...] } wrappers into the generated settings.json when the annotated key sits under a parent that the system layer does not define.
Claude Code then rejects each affected hook event:
Hook event "PostToolUse" must be an array of matchers; received object. This entry was ignored.
Every hook under those events stops running. The SessionStart hook that reruns the merge is one of them, so the install does not repair itself.
Cause
In mergeSettings(system, user), a key that exists only in the user overlay is merged as mergeSettings(undefined, user[key]). When that value is a plain object, neither the annotation branch nor the object-merge branch matches, and the function returns cloneJsonValue(user). The object is copied whole, so append annotations nested inside it are never resolved.
settings.system.json ships without a hooks key (hooks are installer-owned), so hooks always takes this path. SettingsBackport.ts writes append annotations into the user overlay for appended hooks, which is what puts them there. permissions.allow is unaffected because permissions exists in the system layer.
validateRoundTripOrThrow and --check both pass on the broken output.
Reproduce
- System layer: any valid file with no
hookskey. - User overlay:
{ "hooks": { "Stop": { "__merge": "append", "values": [ { "hooks": [ { "type": "command", "command": "true" } ] } ] } } }
- Run the merge to a scratch path:
bun LIFEOS/TOOLS/MergeSettings.ts --system system.json --user user.json --output out.json
hooks.Stopinout.jsonis the wrapper object. Expected: the array fromvalues.
Fix verified locally
Before the final return cloneJsonValue(user); in mergeSettings:
if (isObjectRecord(user)) {
const merged: Record<string, any> = {};
for (const key of Object.keys(user)) {
if (isRemoveAnnotation(user[key])) continue;
merged[key] = mergeSettings(undefined, user[key]);
}
return merged;
}
With this patch the four affected events (PostToolUse, SessionStart, Stop, UserPromptSubmit) come out as arrays with the same content, every other key in the output is unchanged, and --check reports no differences.
Suggested follow-ups
- A regression test for an append annotation nested under a parent the system layer omits.
- Make the round-trip validation fail when any
__mergekey survives in the output.
Versions
LifeOS 8.761.0, MergeSettings 1.3.16 (file header), macOS.
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 1/5 Menos de una hora Aptitud para principiantes 68/100
danielmiessler/LifeOS#2848 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
danielmiessler/LifeOS#2635 ·
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