Skip to content

Commit bdead09

Browse files
committed
fix: mainブランチとのコンフリクトを解消
SessionEnd JSON出力対応の統合時に発生した実装の不一致を修正。 変更内容: - README.md: SessionEndをJSON Output Eventsリストに移動(Legacy Exit Codeから削除) - hooks.go: runHooks関数からSessionEndケースを削除(JSON出力はRunSessionEndHooksを使用) - hooks_test.go: executeSessionEndHooks(旧版)を削除し、TestExecuteSessionEndHooksJSON(origin/main版)に置き換え これにより、SessionEnd JSON出力対応がorigin/mainの実装と完全に一致し、 mainブランチへのマージ時にコンフリクトが発生しなくなる。
1 parent 948513a commit bdead09

File tree

3 files changed

+127
-234
lines changed

3 files changed

+127
-234
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,19 +626,19 @@ All conditions return proper error messages for unknown condition types, ensurin
626626
- `output`
627627
- Print message
628628
- Default `exit_status`:
629-
- 0 for SessionStart, SessionEnd, UserPromptSubmit (non-blocking events)
629+
- 0 for SessionStart, UserPromptSubmit (non-blocking events)
630630
- 2 for Notification, PreCompact
631631
- Note: PreToolUse, Stop, PostToolUse, and SubagentStop use JSON output (exit_status ignored)
632632

633633
### Exit Status Control
634634

635-
**JSON Output Events** (SessionStart, UserPromptSubmit, PreToolUse, Stop, SubagentStop, PostToolUse):
635+
**JSON Output Events** (SessionStart, UserPromptSubmit, PreToolUse, Stop, SubagentStop, PostToolUse, SessionEnd):
636636
- Always exit with code 0
637637
- Control behavior via JSON fields (`decision`, `permissionDecision`, etc.)
638638
- Errors logged to stderr as warnings
639639
- See CLAUDE.md for detailed JSON output format
640640

641-
**Legacy Exit Code Events** (Notification, PreCompact, SessionEnd):
641+
**Legacy Exit Code Events** (Notification, PreCompact):
642642
- 0
643643
- Success, allow execution, output to stdout
644644
- 2

hooks.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ func runHooks(config *Config, eventType HookEventType) error {
5656
// TODO: Task 9 will handle JSON serialization and output
5757
_, err = executeUserPromptSubmitHooks(config, input, rawJSON)
5858
return err
59-
case SessionEnd:
60-
input, rawJSON, err := parseInput[*SessionEndInput](eventType)
61-
if err != nil {
62-
return err
63-
}
64-
_, err = executeSessionEndHooksJSON(config, input, rawJSON)
65-
return err
6659
default:
6760
return fmt.Errorf("unsupported event type: %s", eventType)
6861
}

0 commit comments

Comments
 (0)