You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f0e81b9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/plugins/sdk-runtime.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,21 @@ Provider and channel execution paths must use the active runtime config snapshot
54
54
55
55
## Reusable runtime utilities
56
56
57
+
Model-picker integrations use two focused runtime subpaths. Import the typed
58
+
`ModelPickerAction` and `ModelPickerCapabilityProfile` contracts from
59
+
`openclaw/plugin-sdk/interactive-runtime`. Import
60
+
`applySessionModelSelection(...)` and its result types from
61
+
`openclaw/plugin-sdk/model-session-runtime`; this is the live-session mutation
62
+
seam, including its authoritative conflict check and post-commit effects. The
63
+
lower-level session-entry model helpers are not a picker persistence API.
64
+
65
+
Model-picker actions carry only bounded snapshot and catalog tokens. Channel
66
+
actor identity, source-message binding, and serialized callback data stay in
67
+
the channel's private authenticated envelope. Channel codecs opt into resolving
68
+
these actions with `{ modelPicker: true }`; channels without a picker
69
+
capability continue to fail closed instead of treating the action as an opaque
70
+
callback.
71
+
57
72
Use inbound `botLoopProtection` facts for bot-authored inbound messages. Core applies the shared in-memory sliding-window guard before session record and dispatch, without tying the policy to one channel. The guard tracks `(scopeId, conversationId, participant pair)` keys, counts both directions of a pair together, applies a cooldown once the window budget is exceeded, and prunes inactive entries opportunistically.
58
73
59
74
Channel plugins that expose this behavior to operators should prefer the shared `channels.defaults.botLoopProtection` shape for baseline budgets, then layer channel/provider-specific overrides on top. The shared config uses seconds because it is user-facing:
@@ -372,13 +398,13 @@ export async function applyInlineDirectiveOverrides(params: {
372
398
modelSelection.isDefault
373
399
? `Model reset to default (${labelWithAlias}).`
374
400
: `Model set to ${labelWithAlias} for this session.`,
375
-
persisted.thinkingRemap
376
-
? `Thinking level set to ${persisted.thinkingRemap.to} (${persisted.thinkingRemap.from} not supported for ${persisted.thinkingRemap.provider}/${persisted.thinkingRemap.model}).`
401
+
applied.thinkingRemap
402
+
? `Thinking level set to ${applied.thinkingRemap.to} (${applied.thinkingRemap.from} not supported for ${applied.thinkingRemap.provider}/${applied.thinkingRemap.model}).`
377
403
: undefined,
378
-
persisted.runtimeChange?.kind==="clear"
404
+
applied.runtimeChange?.kind==="clear"
379
405
? "Runtime reset to configured policy."
380
-
: persisted.runtimeChange?.kind==="set"
381
-
? `Runtime set to ${persisted.runtimeChange.runtime} for this session.`
406
+
: applied.runtimeChange?.kind==="set"
407
+
? `Runtime set to ${applied.runtimeChange.runtime} for this session.`
382
408
: undefined,
383
409
modelResolution.profileOverride
384
410
? `Auth profile set to ${modelResolution.profileOverride}.`
0 commit comments