@qodercn-ai/qoderclicn 1.1.97 → 1.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,43 @@ This skill guides you through creating hooks — automated behaviors that
13
13
  trigger on specific events like tool execution, session lifecycle, file
14
14
  changes, and notifications. Hooks are configured in settings.json files.
15
15
 
16
+ ## Model switch hooks
17
+
18
+ `PreModelSwitch` runs before an explicit session model change from a command,
19
+ model picker, SDK, ACP, or remote client. `PostModelSwitch` runs after that
20
+ change is applied. Automatic fallback, startup selection, model application after
21
+ login or account switching, resume, and same-model updates do not trigger these
22
+ events.
23
+
24
+ The matcher targets the destination model. Both events receive
25
+ `session_id`, `transcript_path`, `cwd`, `hook_event_name`, `from_model`, and
26
+ `to_model`. The model fields carry catalog display names, and matchers compare the
27
+ same destination model value.
28
+
29
+ Both events are notification-only: `deny`, `ask`, `block`, exit code 2,
30
+ execution failures, and timeouts do not veto the model change. They never open
31
+ a confirmation dialog or send a model-switch confirmation request to a host.
32
+ Pre output, including `hookSpecificOutput.additionalContext` and plain stdout,
33
+ is not injected into model context. Neither event includes a switch-source field.
34
+ SDK and remote clients keep the existing `set_model` request format; configuring
35
+ these hooks does not require additional request parameters.
36
+
37
+ Execution uses the same sync/async mechanics as `PostToolUse`. By default,
38
+ Pre is awaited before applying the change and Post is awaited after applying
39
+ it. Ordinary hooks can delay completion, but cannot prevent the change.
40
+ Hooks configured with `async: true` run in the background through the existing
41
+ runner. Per-type timeout defaults and explicit `timeout` values are unchanged.
42
+ `asyncRewake` retains the existing consumer-dependent behavior.
43
+
44
+ Post handlers cannot undo a committed change. Successful plain stdout or
45
+ `hookSpecificOutput.additionalContext` is queued through the existing async-hook
46
+ context mechanism, even for a synchronous Post handler. Completed output is
47
+ consumed at the next context drain before a model turn, not injected into an
48
+ already-started request. Output completed after that drain waits for a later
49
+ turn. Outputs from multiple changes are delivered as they become available.
50
+ Failure to save the default model does not suppress Post when the session
51
+ model has already changed.
52
+
16
53
  ## When to Use Hooks
17
54
 
18
55
  Use hooks when you need:
@@ -151,6 +188,8 @@ The hook script must `exit 2` (and write its diagnostic to `stderr` /
151
188
  | `StopFailure` | Agent encounters fatal error and must stop (notification-only) |
152
189
  | `PreCompact` | Before context compaction |
153
190
  | `PostCompact` | After context compaction |
191
+ | `PreModelSwitch` | Before an explicit session model change; notification only |
192
+ | `PostModelSwitch` | After an explicit session model change; notification only |
154
193
 
155
194
  `TeammateIdle` input includes `teammate_name` and `team_name`. Exit code 2
156
195
  uses stderr as feedback. A JSON output with `decision: "deny"` or
@@ -13,6 +13,43 @@ This skill guides you through creating hooks — automated behaviors that
13
13
  trigger on specific events like tool execution, session lifecycle, file
14
14
  changes, and notifications. Hooks are configured in settings.json files.
15
15
 
16
+ ## Model switch hooks
17
+
18
+ `PreModelSwitch` runs before an explicit session model change from a command,
19
+ model picker, SDK, ACP, or remote client. `PostModelSwitch` runs after that
20
+ change is applied. Automatic fallback, startup selection, model application after
21
+ login or account switching, resume, and same-model updates do not trigger these
22
+ events.
23
+
24
+ The matcher targets the destination model. Both events receive
25
+ `session_id`, `transcript_path`, `cwd`, `hook_event_name`, `from_model`, and
26
+ `to_model`. The model fields carry catalog display names, and matchers compare the
27
+ same destination model value.
28
+
29
+ Both events are notification-only: `deny`, `ask`, `block`, exit code 2,
30
+ execution failures, and timeouts do not veto the model change. They never open
31
+ a confirmation dialog or send a model-switch confirmation request to a host.
32
+ Pre output, including `hookSpecificOutput.additionalContext` and plain stdout,
33
+ is not injected into model context. Neither event includes a switch-source field.
34
+ SDK and remote clients keep the existing `set_model` request format; configuring
35
+ these hooks does not require additional request parameters.
36
+
37
+ Execution uses the same sync/async mechanics as `PostToolUse`. By default,
38
+ Pre is awaited before applying the change and Post is awaited after applying
39
+ it. Ordinary hooks can delay completion, but cannot prevent the change.
40
+ Hooks configured with `async: true` run in the background through the existing
41
+ runner. Per-type timeout defaults and explicit `timeout` values are unchanged.
42
+ `asyncRewake` retains the existing consumer-dependent behavior.
43
+
44
+ Post handlers cannot undo a committed change. Successful plain stdout or
45
+ `hookSpecificOutput.additionalContext` is queued through the existing async-hook
46
+ context mechanism, even for a synchronous Post handler. Completed output is
47
+ consumed at the next context drain before a model turn, not injected into an
48
+ already-started request. Output completed after that drain waits for a later
49
+ turn. Outputs from multiple changes are delivered as they become available.
50
+ Failure to save the default model does not suppress Post when the session
51
+ model has already changed.
52
+
16
53
  ## When to Use Hooks
17
54
 
18
55
  Use hooks when you need:
@@ -151,6 +188,8 @@ The hook script must `exit 2` (and write its diagnostic to `stderr` /
151
188
  | `StopFailure` | Agent encounters fatal error and must stop (notification-only) |
152
189
  | `PreCompact` | Before context compaction |
153
190
  | `PostCompact` | After context compaction |
191
+ | `PreModelSwitch` | Before an explicit session model change; notification only |
192
+ | `PostModelSwitch` | After an explicit session model change; notification only |
154
193
 
155
194
  `TeammateIdle` input includes `teammate_name` and `team_name`. Exit code 2
156
195
  uses stderr as feedback. A JSON output with `decision: "deny"` or
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bundle/qoder-worker-runtime.mjs
3
- size: 34599878 bytes
4
- sha256: 184cd24a38c679ea491f10a523e75f0dd56565b08b9994e9defced9ebbc08d0f
3
+ size: 34529770 bytes
4
+ sha256: d0678c3b93da8ce789b75b6e342ecf086fc5a2bb85d28af61813205f8e242886
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bundle/qoderclicn.js
3
- size: 34726935 bytes
4
- sha256: 648f903054576906db1833101c4a630ff39565e5a0ea8ce7d4953ff7ae17cb9f
3
+ size: 34620873 bytes
4
+ sha256: e347dec85765d3e32ba2e756d3ba19a1ebb787447a27230df94228c212944310