Repository navigation
Commit a83d4cf
authored
fix(extensions): reject hook commands that are not strings (#5146)
* fix(extensions): reject hook commands that are not strings
`ExtensionManifest` only checked that a hook's `command` was truthy, so
`command: [speckit.x.hello]` or a mapping passed validation. `extension add`
then crashed in `HookExecutor.register_hooks` with
`TypeError: unhashable type: 'list'`, after the extension directory and the
agent skill had already been written.
Apply the rule extension events already use (#17): a hook command must be a
non-blank string, so the manifest is rejected with a `ValidationError`
before anything is installed.
Refs #5080
Assisted-by: Codex CLI (model: gpt-6.1-sol, autonomous)
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* fix(extensions): point the hook command comment at validate_events()
`#17` read as a GitHub issue reference, but that issue is about Gemini CLI.
Refs #5080
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)1 parent 246b9d0 commit a83d4cf
3 files changed
Lines changed: 54 additions & 2 deletions
File tree
- src/specify_cli/extensions
- tests
- specify_cli/extensions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
436 | 440 | | |
437 | | - | |
| 441 | + | |
438 | 442 | | |
439 | 443 | | |
440 | 444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
43 | 71 | | |
44 | 72 | | |
45 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
881 | 901 | | |
882 | 902 | | |
883 | 903 | | |
| |||
0 commit comments