Skip to content

Commit 5fd5d6f

Browse files
randclaude
andcommitted
fix(hooks): apply fail-forward to all command hooks
complexity-check and session-init now approve/continue on input errors instead of exiting with error code. Follows ADR-002 fail-forward principle. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5111459 commit 5fd5d6f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/complexity-check/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ func main() {
1414
input, err := hookio.ReadInput()
1515
if err != nil {
1616
hookio.Debug("Failed to read input: %v", err)
17-
os.Exit(1)
17+
// Fail forward - approve and continue rather than blocking
18+
hookio.Approve("")
19+
return
1820
}
1921

2022
if os.Getenv("RLM_DISABLED") == "1" {

cmd/session-init/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ func main() {
1717
input, err := hookio.ReadInput()
1818
if err != nil {
1919
hookio.Debug("Failed to read input: %v", err)
20-
os.Exit(1)
20+
// Fail forward - provide minimal context rather than blocking
21+
hookio.SessionContext("RLM: input parse error, continuing with defaults")
22+
return
2123
}
2224

2325
hookio.Debug("Session start: source=%s, cwd=%s", input.Source, input.CWD)

0 commit comments

Comments
 (0)