MemoryTurnStart: the 300 ms budget skipped memory retrieval on 1 in 4 prompts on a Windows install
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
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bun, typescript
Línea de trabajo
Empieza por hooks/MemoryTurnStart.hook.ts, especialmente por SOFT_BUDGET_MS en la línea 62 y el presupuesto del trabajador de recuperación en las líneas 280–288. Compara el presupuesto de 300 ms con los resultados comunicados de 2000 ms y luego comprueba cómo se comporta el hook en distintos sistemas operativos. Se considera terminado cuando la recuperación no se omite en las condiciones indicadas y la espera del prompt se mantiene dentro del presupuesto elegido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
LifeOS 8.761.0 · attestation: not run
What is broken
MemoryTurnStart gives per-prompt memory retrieval SOFT_BUDGET_MS = 300 (cut from 4000 on 2026-10-16). When the worker has not answered inside the budget, the prompt gets the notice "retrieval skipped this turn: ... the machine is loaded" and no recalled notes.
On one Windows 11 install the notice replaced retrieval on 19 of 76 prompts (25%) while the release value was in force (2026-11-24 10:45 to 2026-11-26 07:30 UTC), with the hook's wall time at a median of 769 ms. With the budget raised to 2000 ms, 0 of 21 prompts skipped (2026-11-26 07:30 to 2026-11-27 00:00 UTC). Not measured on macOS, so whether this is Windows-only is open.
Where (file:line)
hooks/MemoryTurnStart.hook.ts:62 (SOFT_BUDGET_MS), :280-288 (budget applied to the retrieval worker)
Repro on a clean tree
# Windows 11, 8.761.0 release, Git Bash. Use Claude Code normally for a day or two, then run this from
# ~/.claude. It reads only the UserPromptSubmit hook attachments Claude Code stores in projects/*.jsonl
# and prints counts, no text. Set the first window to when SOFT_BUDGET_MS was 300 on your install;
# here 300 ms ran 2026-11-24 10:45Z to 2026-11-26 07:30Z, and 2000 ms from then to 2026-11-27 00:00Z.
cat > probe.js <<'EOF'
const { readdirSync, readFileSync, statSync } = await import("node:fs");
const { join } = await import("node:path");
const W300 = [Date.parse("2026-11-24T10:45:00Z"), Date.parse("2026-11-26T07:30:00Z")], W2000 = [W300[1], Date.parse("2026-11-27T00:00:00Z")];
const files = [];
const walk = (d) => { for (const n of readdirSync(d)) { const p = join(d, n), s = statSync(p); if (s.isDirectory()) walk(p); else if (n.endsWith(".jsonl") && s.mtimeMs >= W300[0]) files.push(p); } };
walk(join(process.cwd(), "projects"));
const seen = new Set(), b = { 300: { n: 0, skip: 0, ms: [] }, 2000: { n: 0, skip: 0, ms: [] } };
for (const f of files) for (const line of readFileSync(f, "utf8").split(String.fromCharCode(10))) {
if (!line.includes("UserPromptSubmit")) continue;
let o; try { o = JSON.parse(line); } catch { continue; }
const a = o.attachment; if (o.type !== "attachment" || !a || a.hookEvent !== "UserPromptSubmit" || a.type !== "hook_success") continue;
const out = String(a.stdout || ""); if (!/<lifeos-(memory-delta|ground|memory)>/.test(out) || seen.has(o.uuid)) continue; seen.add(o.uuid);
const t = Date.parse(o.timestamp), k = t >= W300[0] && t < W300[1] ? 300 : t >= W2000[0] && t < W2000[1] ? 2000 : 0; if (!k) continue;
b[k].n++; if (typeof a.durationMs === "number") b[k].ms.push(a.durationMs); if (out.includes("retrieval skipped this turn")) b[k].skip++;
}
const med = (x) => x.length ? x.slice().sort((p, q) => p - q)[Math.floor((x.length - 1) / 2)] : null;
for (const k of [300, 2000]) console.log("SOFT_BUDGET_MS " + k + ": " + b[k].skip + " of " + b[k].n + " prompts skipped retrieval; hook wall time median " + med(b[k].ms) + " ms");
process.exit(b[300].skip > 0 ? 1 : 0);
EOF
bun -e "$(cat probe.js)" # exit 1 when any prompt skipped retrieval at 300 ms
# The notice the model receives on a skipped prompt:
# <lifeos-ground> (retrieval skipped this turn: the prompt hooks were already past their time budget ...)
Negative control
Probe: bun -e 'const { readdirSync, readFileSync, statSync } = await import("node:fs"); const { join } = await import("node:path"); const W300 = [Date.parse("2026-11-24T10:45:00Z"), Date.parse("2026-11-26T07:30:00Z")], W2000 = [W300[1], Date.parse("2026-11-27T00:00:00Z")]; const files = []; const walk = (d) => { for (const n of readdirSync(d)) { const p = join(d, n), s = statSync(p); if (s.isDirectory()) walk(p); else if (n.endsWith(".jsonl") && s.mtimeMs >= W300[0]) files.push(p); } }; walk(join(process.cwd(), "projects")); const seen = new Set(), b = { 300: { n: 0, skip: 0, ms: [] }, 2000: { n: 0, skip: 0, ms: [] } }; for (const f of files) for (const line of readFileSync(f, "utf8").split(String.fromCharCode(10))) { if (!line.includes("UserPromptSubmit")) continue; let o; try { o = JSON.parse(line); } catch { continue; } const a = o.attachment; if (o.type !== "attachment" || !a || a.hookEvent !== "UserPromptSubmit" || a.type !== "hook_success") continue; const out = String(a.stdout || ""); if (!/<lifeos-(memory-delta|ground|memory)>/.test(out) || seen.has(o.uuid)) continue; seen.add(o.uuid); const t = Date.parse(o.timestamp), k = t >= W300[0] && t < W300[1] ? 300 : t >= W2000[0] && t < W2000[1] ? 2000 : 0; if (!k) continue; b[k].n++; if (typeof a.durationMs === "number") b[k].ms.push(a.durationMs); if (out.includes("retrieval skipped this turn")) b[k].skip++; } const med = (x) => x.length ? x.slice().sort((p, q) => p - q)[Math.floor((x.length - 1) / 2)] : null; for (const k of [300, 2000]) console.log("SOFT_BUDGET_MS " + k + ": " + b[k].skip + " of " + b[k].n + " prompts skipped retrieval; hook wall time median " + med(b[k].ms) + " ms"); process.exit(b[300].skip > 0 ? 1 : 0);' · exit 1 · captured 2026-11-27T01:33:50.840Z
Red looks like: SOFT_BUDGET_MS 300: 19 of 76 prompts skipped retrieval
SOFT_BUDGET_MS 300: 19 of 76 prompts skipped retrieval; hook wall time median 769 ms
SOFT_BUDGET_MS 2000: 0 of 21 prompts skipped retrieval; hook wall time median 583 ms
Suggested fix
Applied on one install: SOFT_BUDGET_MS 300 -> 2000 (MemoryTurnStart.hook.ts:62). Skips went from 19 of 76 prompts to 0 of 21 over the windows in the probe. Cost: a prompt sent while retrieval is slow can wait up to 2 s for its notes; the hook still returns as soon as the worker answers.
A narrower option, not tried: keep 300 ms on macOS and use a larger budget on win32, or make the budget a setting.
Environment
- OS: Windows (x64)
- Harness: claude-code
- bun: 1.4.2 · git: 2.56.1.
- Doctor broken: none
- Lenguaje dominante
- TypeScript
- Estrellas
- 20k
- 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 78/100
danielmiessler/LifeOS#2985 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
danielmiessler/LifeOS#2980 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
danielmiessler/LifeOS#2977 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
danielmiessler/LifeOS#2967 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
danielmiessler/LifeOS#2966 ·
Los mantenedores suelen responder en 5 días
Todos los issues de danielmiessler/LifeOS
Issues similares
-
P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug L3 level 1 needs-review wocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
SatyamPandey-07/WorkSphere#10739 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
assistant-ui/assistant-ui#10946 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
openclaw/openclaw#206303 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día