CLI-246 Move prompt submit hook from shell scripts#158
CLI-246 Move prompt submit hook from shell scripts#158kirill-knize-sonarsource wants to merge 1 commit intotask/kk/CLI-244-245-callback-infrastructurefrom
Conversation
SummaryWhat changed: How it works:
Why: What reviewers should knowWhere to start:
Non-obvious decisions:
Testing:
|
e5bc9f8 to
6f2f053
Compare
a3f18c4 to
5f71102
Compare
6f2f053 to
aa6bc64
Compare
5f71102 to
143d5f1
Compare
143d5f1 to
31cb0f1
Compare
aa6bc64 to
3a31a77
Compare
There was a problem hiding this comment.
Conclusion: Solid implementation. The refactoring of secrets-scan.ts is clean, the graceful-failure approach is consistent with the existing claudePreToolUse handler, and test coverage is thorough. One logic duplication worth addressing before CLI-247 lands.
|
|
||
| const prompt = payload.prompt; | ||
| if (!prompt) return; | ||
|
|
||
| const auth = await resolveAuth().catch(() => null); | ||
| if (!auth) return; // not authenticated — allow gracefully | ||
|
|
||
| const binaryPath = resolveSecretsBinaryPath(); |
There was a problem hiding this comment.
Logic duplication: The auth/binary guard block here (lines 40–47) is structurally identical to the same block in claude-pre-tool-use.ts lines 48–52, and CLI-247 will add a third handler with the same pattern.
If the guard semantics ever change (e.g. a new auth type treated as unauthenticated, or a new binary resolution strategy), all handlers must be updated in sync with no compiler help.
Consider extracting a shared helper before CLI-247 adds a third copy:
async function resolveCallbackDeps(): Promise<{ auth: ResolvedAuth; binaryPath: string } | null>Each handler would call it once and return early on null, keeping handler-specific logic separated from the shared guard.
- Mark as noise
31cb0f1 to
140c6be
Compare
3a31a77 to
c4b4665
Compare
140c6be to
020d2e9
Compare
e44c9d3 to
d117a3a
Compare
020d2e9 to
7460ff8
Compare
7460ff8 to
6f7f1ea
Compare
b83cb4f to
8617798
Compare
f4cbc21 to
468e45c
Compare
6f7f1ea to
ebd83a5
Compare
00173a3 to
9191141
Compare
6fb3822 to
db836c4
Compare
db836c4 to
56c1321
Compare
56c1321 to
cb918b8
Compare
cb918b8 to
356de02
Compare
9191141 to
129cc50
Compare
356de02 to
1c1f6fd
Compare
1c1f6fd to
e9aa81f
Compare
|



No description provided.