LifeOSHooks stamp ages out in a live session: native hooks run beside the plugin again after 7 days
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 92/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bun, json, typescript
調査の方向性
まず LIFEOS/TOOLS/HookBridge.ts の mergeStampCaps と、スタンプの mtime の使用方法を確認し、次に hooks/lib/function-hooks.ts の TTL チェックを調査する。issue の 8 日間のスタンプで再現し、bridge を実行した後に hooks/MemoryTurnStart.hook.ts を実行する。完了の基準は、スタンプが更新され、ネイティブのメモリ hook が沈黙したままになり、bridge の emission ID の保持を含む TTL の動作をリグレッションテストが確認することである。
索引モデルが issue の本文から書いたものです。
説明
What happens
In an interactive session armed by the LifeOSHooks plugin, the native command hooks stand down only while hookCovers(sid, cap) is true (hooks/lib/function-hooks.ts). That needs the session stamp's file mtime to be younger than STAMP_TTL_MS (7 days).
LIFEOS/TOOLS/HookBridge.ts prompt-context calls mergeStampCaps(sid, PROMPT_MODULE_CAPS) on every covered prompt, but mergeStampCaps returns early when the caps are unchanged:
if (merged.length === have.length && merged.every((c, i) => have[i] === c)) return; // unchanged: leave the file alone
So the mtime freezes at the session's first prompt, which contradicts the function's own docstring ("mtime is refreshed (the TTL clock)"). Seven days after a session arms, in a session that stays open or is resumed, hookCovers goes false. From then on, every native hook that checks it runs again beside the plugin, which is the double path the stamp exists to prevent. For memory, the native MemoryTurnStart composes a second emission on each prompt, about 150 ms after the plugin's, and overwrites the memory queue's emissionId. An ack keyed to the plugin's emission then never matches, so the queue stops draining and re-sends its first chunks on every prompt.
Seen on v8.761.0; main at 94bd8f25 has the same code. On one install, three long-lived sessions stalled this way, each starting after its 7-day mark and not before.
Repro
With a temp config dir (CLAUDE_CONFIG_DIR=$(mktemp -d)):
- Write
LIFEOS/MEMORY/STATE/function-hooks/S.jsonfor sessionSwithcaps: ["prompt-context","turn-complete","band","voice"], andtouch -tit 8 days back. - Pipe a
UserPromptSubmitinput forSintobun LIFEOS/TOOLS/HookBridge.ts prompt-context. It exits 0 withcovered: true, and the stamp's mtime is unchanged. - Pipe the same input into
bun hooks/MemoryTurnStart.hook.ts. It prints a full<lifeos-memory>block where it should print nothing, andMEMORY/STATE/memory-inject/S.queue.jsonnow carries the native emission's id.
Suggested fix
Refresh the mtime on the unchanged path:
if (merged.length === have.length && merged.every((c, i) => have[i] === c)) {
const now = new Date();
utimesSync(p, now, now); // the bridge calls this every covered prompt, so a live session never ages out
return;
}
A dead session or a crashed plugin stops calling the bridge, so the TTL still hands the work back to the native hooks for them. With this change step 2 refreshes the stamp and step 3 prints nothing. A test that plants an 8-day stamp, runs one turn through the bridge and then the native hook, and asserts the native hook stays silent and the queue keeps the bridge's emission fails without the line and passes with it.
Side note
The native hooks are covered even on the first prompt after a long idle: the plugin awaits prompt-context before next() runs them, and the bridge refreshes the stamp before it returns. The composers inside prompt-context run before that refresh, though, so on the first prompt after a lapse they still read the stale stamp and emit their fallback form once (for example the memory-delta block that asks the model to type the line). The next prompt is normal.
- 主要言語
- TypeScript
- スター
- 20k
- フォーク
- 2.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
danielmiessler/LifeOS のほかの issue
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts fileオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
danielmiessler/LifeOS#3123 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
danielmiessler/LifeOS#3122 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
danielmiessler/LifeOS#3121 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
danielmiessler/LifeOS#3120 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
danielmiessler/LifeOS#3055 ·
メンテナーはふだん 5 日以内に返信
danielmiessler/LifeOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
eliasstravik/herdr-projects#1700 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
Koenkk/zigbee2mqtt#33890 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Skill Workshop skill diet should use the configured utility model, not always the primaryオープンclawsweeper:fix-shape-clear clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🐚 platinum hermit P2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
openclaw/openclaw#210348 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
can1357/oh-my-pi#21349 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信