Compare commits

...

2 Commits

Author SHA1 Message Date
2dea1d7df7 Merge branch 'active-bug' 2026-03-18 22:50:25 -07:00
de48aeb02a Replace PostToolUseFailure hook with PreToolUse for activity tracking
PostToolUseFailure incorrectly marked the session idle on transient tool
errors. PreToolUse keeps the active signal fresh throughout tool execution,
while Stop alone handles the transition to idle.
2026-03-18 22:18:38 -07:00

View File

@ -204,8 +204,8 @@ async function configureEnvironment(home: string, apiKey: string): Promise<void>
const activityBin = `/home/${USER}/.local/bin/sandlot-activity` const activityBin = `/home/${USER}/.local/bin/sandlot-activity`
const hooks = { const hooks = {
UserPromptSubmit: [{ hooks: [{ type: "command", command: `${activityBin} active` }] }], UserPromptSubmit: [{ hooks: [{ type: "command", command: `${activityBin} active` }] }],
PreToolUse: [{ hooks: [{ type: "command", command: `${activityBin} active` }] }],
Stop: [{ hooks: [{ type: "command", command: `${activityBin} idle` }] }], Stop: [{ hooks: [{ type: "command", command: `${activityBin} idle` }] }],
PostToolUseFailure: [{ hooks: [{ type: "command", command: `${activityBin} idle` }] }],
} }
const statusLine = { type: "command", command: `/home/${USER}/.local/bin/sandlot-statusline` } const statusLine = { type: "command", command: `/home/${USER}/.local/bin/sandlot-statusline` }
const settingsJson = JSON.stringify({ apiKeyHelper: "~/.claude/api-key-helper.sh", skipDangerousModePermissionPrompt: true, hooks, statusLine }) const settingsJson = JSON.stringify({ apiKeyHelper: "~/.claude/api-key-helper.sh", skipDangerousModePermissionPrompt: true, hooks, statusLine })