LifeOSHooks stamp ages out in a live session: native hooks run beside the plugin again after 7 days
Maintainer thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 92/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bun, json, typescript
Hướng nghiên cứu
Bắt đầu với mergeStampCaps trong LIFEOS/TOOLS/HookBridge.ts và cách sử dụng mtime của stamp, sau đó kiểm tra việc kiểm tra TTL trong hooks/lib/function-hooks.ts. Tái hiện vấn đề bằng stamp 8 ngày của issue và chạy bridge, sau đó chạy hooks/MemoryTurnStart.hook.ts. Hoàn tất nghĩa là stamp đã được làm mới, hook bộ nhớ gốc vẫn im lặng và một bài kiểm thử hồi quy xác minh cả hành vi TTL lẫn việc giữ nguyên emission ID của bridge.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 20k
- Fork
- 2.5k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của danielmiessler/LifeOS
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts fileĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
danielmiessler/LifeOS#3123 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
danielmiessler/LifeOS#3122 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
danielmiessler/LifeOS#3121 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#3120 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
danielmiessler/LifeOS#3055 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của danielmiessler/LifeOS
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
eliasstravik/herdr-projects#1700 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[SNZB-02DR2 / SONOFF] ???Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Koenkk/zigbee2mqtt#33890 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Skill Workshop skill diet should use the configured utility model, not always the primaryĐang mở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
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
openclaw/openclaw#210348 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
can1357/oh-my-pi#21349 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày