clawmem 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/clawmem.ts +8 -3
package/package.json
CHANGED
package/src/clawmem.ts
CHANGED
|
@@ -970,11 +970,15 @@ async function cmdSetupHooks(args: string[]) {
|
|
|
970
970
|
Stop: ["decision-extractor", "handoff-generator", "feedback-loop"],
|
|
971
971
|
};
|
|
972
972
|
|
|
973
|
+
// Use Claude Code's native timeout property instead of shell `timeout` wrapper.
|
|
974
|
+
// Shell `timeout` kills the process with SIGTERM (exit 124) which produces
|
|
975
|
+
// "Stop hook error: Failed with non-blocking status code" in Claude Code.
|
|
976
|
+
// Native timeout is handled gracefully by the hook runner.
|
|
973
977
|
const timeouts: Record<string, number> = {
|
|
974
978
|
UserPromptSubmit: 8,
|
|
975
979
|
SessionStart: 5,
|
|
976
980
|
PreCompact: 5,
|
|
977
|
-
Stop:
|
|
981
|
+
Stop: 30, // LLM-based extraction hooks need more time
|
|
978
982
|
};
|
|
979
983
|
|
|
980
984
|
for (const [event, hooks] of Object.entries(hookConfig)) {
|
|
@@ -987,12 +991,13 @@ async function cmdSetupHooks(args: string[]) {
|
|
|
987
991
|
|
|
988
992
|
const timeout = timeouts[event] || 5;
|
|
989
993
|
|
|
990
|
-
// Add new entries with timeout
|
|
994
|
+
// Add new entries with native timeout property
|
|
991
995
|
settings.hooks[event].push({
|
|
992
996
|
matcher: "",
|
|
993
997
|
hooks: hooks.map(name => ({
|
|
994
998
|
type: "command",
|
|
995
|
-
command:
|
|
999
|
+
command: `${binPath} hook ${name}`,
|
|
1000
|
+
timeout,
|
|
996
1001
|
})),
|
|
997
1002
|
});
|
|
998
1003
|
}
|