@vellumai/assistant 0.8.9 → 0.8.10-dev.202606092334.09948c8

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.
Files changed (161) hide show
  1. package/AGENTS.md +1 -1
  2. package/examples/plugins/echo/README.md +3 -3
  3. package/node_modules/@vellumai/skill-host-contracts/src/tool-types.ts +2 -0
  4. package/openapi.yaml +38 -12
  5. package/package.json +1 -1
  6. package/scripts/sync-llm-catalog.ts +2 -0
  7. package/src/__tests__/agent-loop-exit-reason.test.ts +21 -15
  8. package/src/__tests__/approval-cascade.test.ts +1 -0
  9. package/src/__tests__/build-persisted-content.test.ts +75 -1
  10. package/src/__tests__/compaction-events.test.ts +1 -0
  11. package/src/__tests__/config-managed-gemini-defaults.test.ts +2 -46
  12. package/src/__tests__/context-overflow-reducer.test.ts +264 -124
  13. package/src/__tests__/context-window-manager-overflow-rung.test.ts +351 -0
  14. package/src/__tests__/conversation-abort-tool-results.test.ts +1 -0
  15. package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +11 -0
  16. package/src/__tests__/conversation-agent-loop-overflow.test.ts +90 -49
  17. package/src/__tests__/conversation-agent-loop.test.ts +113 -64
  18. package/src/__tests__/conversation-confirmation-signals.test.ts +1 -0
  19. package/src/__tests__/conversation-fork-crud.test.ts +110 -0
  20. package/src/__tests__/conversation-process-callsite.test.ts +1 -0
  21. package/src/__tests__/conversation-provider-retry-repair.test.ts +48 -48
  22. package/src/__tests__/conversation-queue.test.ts +1 -0
  23. package/src/__tests__/conversation-runtime-assembly.test.ts +119 -8
  24. package/src/__tests__/conversation-slash-queue.test.ts +1 -0
  25. package/src/__tests__/conversation-slash-unknown.test.ts +1 -0
  26. package/src/__tests__/conversation-speed-override.test.ts +1 -0
  27. package/src/__tests__/conversation-surfaces-app-control.test.ts +4 -1
  28. package/src/__tests__/conversation-tool-setup-app-refresh.test.ts +91 -142
  29. package/src/__tests__/conversation-tool-setup-skill-attribution.test.ts +116 -0
  30. package/src/__tests__/conversation-tool-setup-test-helpers.ts +98 -0
  31. package/src/__tests__/conversation-workspace-cache-state.test.ts +1 -0
  32. package/src/__tests__/conversation-workspace-injection.test.ts +1 -0
  33. package/src/__tests__/conversation-workspace-tool-tracking.test.ts +1 -0
  34. package/src/__tests__/corrected-target.test.ts +93 -0
  35. package/src/__tests__/credential-execution-feature-gates.test.ts +3 -5
  36. package/src/__tests__/credential-security-invariants.test.ts +1 -0
  37. package/src/__tests__/embedding-managed-proxy-selection.test.ts +6 -40
  38. package/src/__tests__/external-plugin-loader.test.ts +0 -1
  39. package/src/__tests__/guardian-routing-invariants.test.ts +91 -0
  40. package/src/__tests__/history-repair-hook.test.ts +2 -0
  41. package/src/__tests__/host-app-control-proxy.test.ts +45 -0
  42. package/src/__tests__/llm-catalog-parity.test.ts +4 -0
  43. package/src/__tests__/memory-retrieval-hook.test.ts +29 -15
  44. package/src/__tests__/notification-decision-strategy.test.ts +3 -3
  45. package/src/__tests__/persistence-secret-redaction.test.ts +78 -0
  46. package/src/__tests__/plugin-bootstrap.test.ts +82 -73
  47. package/src/__tests__/plugin-tool-contribution.test.ts +7 -4
  48. package/src/__tests__/plugin-types.test.ts +0 -8
  49. package/src/__tests__/provider-catalog-visibility.test.ts +1 -9
  50. package/src/__tests__/retry-thinking-adaptive-only.test.ts +245 -0
  51. package/src/__tests__/server-history-render.test.ts +39 -0
  52. package/src/__tests__/skills.test.ts +123 -0
  53. package/src/__tests__/title-generate-hook.test.ts +2 -0
  54. package/src/__tests__/tool-audit-listener.test.ts +51 -0
  55. package/src/__tests__/tool-executor-lifecycle-events.test.ts +32 -0
  56. package/src/__tests__/tool-start-timestamp.test.ts +218 -0
  57. package/src/agent/loop.ts +26 -39
  58. package/src/api/events/tool-result.ts +9 -0
  59. package/src/api/events/tool-use-start.ts +7 -0
  60. package/src/api/responses/conversation-message.ts +91 -14
  61. package/src/approvals/guardian-request-resolvers.ts +26 -0
  62. package/src/cli/commands/channel-verification-sessions.ts +6 -6
  63. package/src/cli/commands/inference-providers.ts +0 -8
  64. package/src/cli/commands/plugins.ts +2 -2
  65. package/src/cli/lib/__tests__/install-from-github.test.ts +174 -18
  66. package/src/cli/lib/__tests__/plugin-catalog-cache.test.ts +1 -1
  67. package/src/cli/lib/__tests__/plugin-details.test.ts +1 -1
  68. package/src/cli/lib/__tests__/plugin-marketplace.test.ts +1 -1
  69. package/src/cli/lib/__tests__/search-plugins.test.ts +11 -11
  70. package/src/cli/lib/install-from-github.ts +130 -19
  71. package/src/cli/lib/plugin-catalog-cache.ts +1 -1
  72. package/src/cli/lib/plugin-details.ts +4 -4
  73. package/src/cli/lib/plugin-marketplace.ts +2 -2
  74. package/src/cli/lib/search-plugins.ts +6 -6
  75. package/src/config/bundled-skills/skill-management/SKILL.md +89 -1
  76. package/src/config/env-registry.ts +12 -0
  77. package/src/config/feature-flag-registry.json +0 -80
  78. package/src/config/loader.ts +5 -22
  79. package/src/config/seed-inference-profiles.ts +1 -1
  80. package/src/config/skills.ts +101 -47
  81. package/src/context/strip-injections.ts +7 -4
  82. package/src/daemon/conversation-agent-loop-handlers.ts +102 -6
  83. package/src/daemon/conversation-agent-loop.ts +126 -270
  84. package/src/daemon/conversation-runtime-assembly.ts +44 -8
  85. package/src/daemon/conversation-tool-setup.ts +9 -1
  86. package/src/daemon/conversation.ts +13 -0
  87. package/src/daemon/external-plugins-bootstrap.ts +33 -87
  88. package/src/daemon/handlers/config-channels.ts +11 -2
  89. package/src/daemon/handlers/shared.ts +9 -1
  90. package/src/daemon/handlers/skills.ts +6 -2
  91. package/src/daemon/host-app-control-proxy.ts +72 -57
  92. package/src/daemon/message-protocol.ts +0 -7
  93. package/src/daemon/message-types/skills.ts +4 -0
  94. package/src/events/tool-audit-listener.ts +7 -1
  95. package/src/memory/__tests__/tool-invocation-test-helpers.ts +69 -0
  96. package/src/memory/conversation-crud.ts +44 -1
  97. package/src/memory/db-init.ts +4 -0
  98. package/src/memory/embedding-backend.ts +5 -22
  99. package/src/memory/memory-retrospective-startup-cleanup.ts +1 -1
  100. package/src/memory/migrations/275-tool-invocations-add-skill-id.test.ts +81 -0
  101. package/src/memory/migrations/275-tool-invocations-add-skill-id.ts +20 -0
  102. package/src/memory/migrations/276-tool-invocations-created-at-id-index.test.ts +68 -0
  103. package/src/memory/migrations/276-tool-invocations-created-at-id-index.ts +20 -0
  104. package/src/memory/migrations/index.ts +2 -0
  105. package/src/memory/schema/conversations.ts +3 -0
  106. package/src/memory/tool-execution-events-store.test.ts +162 -0
  107. package/src/memory/tool-execution-events-store.ts +73 -0
  108. package/src/memory/tool-usage-store.ts +4 -3
  109. package/src/memory/v2/__tests__/injected-block-slugs.test.ts +51 -0
  110. package/src/memory/v2/activation-store.ts +50 -1
  111. package/src/memory/v2/injected-block-slugs.ts +30 -0
  112. package/src/notifications/__tests__/copy-composer.test.ts +244 -0
  113. package/src/notifications/access-request-copy.ts +298 -0
  114. package/src/notifications/adapters/slack.ts +3 -3
  115. package/src/notifications/adapters/telegram.ts +2 -1
  116. package/src/notifications/copy-composer.ts +49 -267
  117. package/src/notifications/decision-engine.ts +16 -35
  118. package/src/notifications/home-feed-side-effect.ts +1 -6
  119. package/src/platform/client.ts +1 -3
  120. package/src/platform/feature-gate.ts +3 -12
  121. package/src/plugin-api/constants.ts +2 -0
  122. package/src/plugin-api/index.ts +37 -6
  123. package/src/plugin-api/types.ts +75 -0
  124. package/src/plugins/defaults/compaction/compact.ts +39 -1
  125. package/src/plugins/defaults/compaction/context-overflow-reducer.ts +240 -32
  126. package/src/plugins/defaults/compaction/corrected-target.ts +53 -0
  127. package/src/plugins/defaults/compaction/window-manager.ts +195 -1
  128. package/src/plugins/defaults/index.ts +24 -0
  129. package/src/plugins/defaults/memory-retrieval/hooks/post-compact.ts +76 -112
  130. package/src/plugins/defaults/memory-retrieval/hooks/{user-prompt-submit-temp.ts → user-prompt-submit.ts} +36 -67
  131. package/src/plugins/defaults/memory-retrieval/package.json +14 -0
  132. package/src/plugins/external-api.ts +1 -1
  133. package/src/plugins/types.ts +5 -51
  134. package/src/providers/inference/__tests__/base-url-route-validation.test.ts +1 -2
  135. package/src/providers/model-catalog.ts +57 -1
  136. package/src/providers/registry.ts +0 -8
  137. package/src/providers/retry.ts +35 -7
  138. package/src/runtime/routes/__tests__/acp-routes.test.ts +151 -0
  139. package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +0 -62
  140. package/src/runtime/routes/__tests__/plugins-routes.test.ts +4 -4
  141. package/src/runtime/routes/acp-routes.test.ts +106 -0
  142. package/src/runtime/routes/acp-routes.ts +248 -2
  143. package/src/runtime/routes/browser-tabs-routes.ts +1 -1
  144. package/src/runtime/routes/channel-verification-routes.ts +14 -5
  145. package/src/runtime/routes/chatgpt-subscription-auth-routes.ts +0 -14
  146. package/src/runtime/routes/inbound-stages/acl-enforcement.ts +33 -34
  147. package/src/runtime/routes/inference-provider-connection-routes.ts +0 -45
  148. package/src/runtime/routes/plugins-routes.ts +3 -3
  149. package/src/runtime/verification-outbound-actions.ts +147 -2
  150. package/src/runtime/verification-templates.ts +29 -3
  151. package/src/telemetry/types.ts +25 -1
  152. package/src/telemetry/usage-telemetry-reporter.test.ts +141 -7
  153. package/src/telemetry/usage-telemetry-reporter.ts +63 -7
  154. package/src/tools/executor.ts +4 -1
  155. package/src/tools/skills/load.ts +11 -6
  156. package/src/tools/terminal/safe-env.ts +1 -0
  157. package/src/tools/types.ts +10 -0
  158. package/src/__tests__/plugin-skill-contribution.test.ts +0 -355
  159. package/src/daemon/message-types/browser.ts +0 -10
  160. package/src/notifications/__tests__/emit-signal-home-feed.test.ts +0 -187
  161. package/src/plugins/plugin-skill-contributions.ts +0 -292
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Default `user-prompt-submit-temp` hook: prepares a turn's prompt before the
3
- * first provider call by running memory-graph retrieval and then applying the
2
+ * Default `user-prompt-submit` hook: prepares a turn's prompt before the first
3
+ * provider call by running memory-graph retrieval and then applying the
4
4
  * runtime injections that assemble the turn.
5
5
  *
6
6
  * **Memory graph** via {@link ConversationGraphMemory.prepareMemory} —
@@ -22,75 +22,31 @@
22
22
  * post-compaction hook, which re-applies the same injections after a mid-loop
23
23
  * compaction.
24
24
  *
25
- * This fires at the early "prompt submitted, before context assembly" moment,
26
- * ahead of the canonical late `user-prompt-submit` hook (history repair,
27
- * title), which normalizes the assembled history after the overflow-reduction
28
- * transform that runs between the two moments. The `-temp` suffix marks this as
29
- * a transitional staging point that folds into `user-prompt-submit` once
30
- * compaction is cleared from the gap between the two call sites.
25
+ * Registered first in the `user-prompt-submit` chain, so it heads the chain
26
+ * ahead of history repair and title generation: those later hooks see the
27
+ * fully assembled, memory-injected history.
31
28
  */
32
29
 
33
- import type { PluginHookFn } from "@vellumai/plugin-api";
34
- import type { Logger } from "pino";
30
+ import type {
31
+ PluginHookFn,
32
+ UserPromptSubmitContext,
33
+ } from "@vellumai/plugin-api";
35
34
 
36
35
  import { getConfig } from "../../../../config/loader.js";
37
36
  import { findConversationOrSubagent } from "../../../../daemon/conversation-registry.js";
38
37
  import {
39
38
  applyRuntimeInjections,
40
39
  resolveTurnInboundActorContext,
40
+ resolveTurnModelProfileLabel,
41
41
  type RuntimeInjectionResult,
42
42
  } from "../../../../daemon/conversation-runtime-assembly.js";
43
- import type { ServerMessage } from "../../../../daemon/message-protocol.js";
44
43
  import type { MemoryRecalled } from "../../../../daemon/message-types/memory.js";
45
44
  import { resolveTrustClass } from "../../../../daemon/trust-context.js";
46
45
  import { updateMessageMetadata } from "../../../../memory/conversation-crud.js";
47
46
  import { recordMemoryRecallLog } from "../../../../memory/memory-recall-log-store.js";
48
- import type { Message } from "../../../../providers/types.js";
47
+ import { broadcastMessage } from "../../../../runtime/assistant-event-hub.js";
49
48
  import type { GraphMemoryResult } from "../../../types.js";
50
49
 
51
- /**
52
- * Context threaded through the `user-prompt-submit-temp` hook. The
53
- * conversation-scoped retrieval state (graph handle, abort signal, trust
54
- * class) is self-resolved from the live conversation by id; the readonly
55
- * fields here carry the event sink and the turn-start injection snapshot,
56
- * while `latestMessages` straddles input and output — the loop seeds it with
57
- * the pre-injection array and the hook overwrites it with the injected result.
58
- */
59
- export interface MemoryRetrievalHookContext {
60
- /** Event sink used by the graph retriever and `memory_recalled` emission. */
61
- readonly onEvent: (msg: ServerMessage) => void;
62
- /** Conversation the turn belongs to — keys the recall-log row. */
63
- readonly conversationId: string;
64
- /** User message the injected memory block is persisted onto. */
65
- readonly userMessageId: string;
66
- /** Turn-scoped logger for non-fatal persistence warnings. */
67
- readonly logger: Logger;
68
- /**
69
- * Working message list for the turn. Seeded by the loop with the
70
- * pre-injection messages and consumed as the retrieval input; the hook
71
- * overwrites it with the fully injected result (the memory-graph block, when
72
- * the actor is trusted, plus the runtime injections). Read back by the loop.
73
- */
74
- latestMessages: Message[];
75
- /**
76
- * Stable ID for the current request, forwarded onto the injector turn
77
- * context. The one turn-identity field the live conversation can't recover.
78
- */
79
- readonly requestId: string | undefined;
80
- /**
81
- * Whether the in-flight turn has no human present to answer clarification
82
- * questions. Resolved once at turn start and threaded in so injection uses
83
- * the turn-start snapshot rather than live state that can flip mid-turn.
84
- */
85
- readonly isNonInteractive: boolean;
86
- /**
87
- * The `model_profile:` turn-context label, or `null` when the active
88
- * inference profile is unchanged since the last notified one. Resolved once
89
- * at turn start, so it is threaded in rather than re-derived.
90
- */
91
- readonly modelProfile: string | null;
92
- }
93
-
94
50
  /**
95
51
  * Persist and broadcast the retrieval's side effects: the injected block on
96
52
  * the user message's metadata (so it survives reloads), a recall-log row, and
@@ -99,7 +55,7 @@ export interface MemoryRetrievalHookContext {
99
55
  */
100
56
  function recordRecallSideEffects(
101
57
  graphResult: GraphMemoryResult,
102
- ctx: MemoryRetrievalHookContext,
58
+ ctx: UserPromptSubmitContext,
103
59
  ): void {
104
60
  // Persist the injected block text in message metadata so it survives
105
61
  // conversation reloads (eviction, restart, fork). loadFromDb re-injects
@@ -174,7 +130,7 @@ function recordRecallSideEffects(
174
130
  recency: c.recencyBoost,
175
131
  })),
176
132
  };
177
- ctx.onEvent(memoryRecalledEvent);
133
+ broadcastMessage(memoryRecalledEvent);
178
134
  }
179
135
  }
180
136
 
@@ -189,7 +145,7 @@ function recordRecallSideEffects(
189
145
  */
190
146
  function persistInjectionBlocks(
191
147
  blocks: RuntimeInjectionResult["blocks"],
192
- ctx: MemoryRetrievalHookContext,
148
+ ctx: UserPromptSubmitContext,
193
149
  ): void {
194
150
  if (
195
151
  !blocks.unifiedTurnContext &&
@@ -243,13 +199,14 @@ function persistInjectionBlocks(
243
199
  * into `prepareMemory`.
244
200
  */
245
201
  const userPromptSubmitMemoryRetrieval: PluginHookFn<
246
- MemoryRetrievalHookContext
202
+ UserPromptSubmitContext
247
203
  > = async (ctx) => {
248
204
  // The conversation-scoped retrieval state — graph handle, abort signal, and
249
205
  // trust class — is resolved from the live conversation by id rather than
250
206
  // threaded in, mirroring how `applyRuntimeInjections` self-resolves its
251
207
  // per-turn inputs.
252
208
  const conversation = findConversationOrSubagent(ctx.conversationId);
209
+ const config = getConfig();
253
210
  const abortSignal = conversation?.abortController?.signal;
254
211
  const isTrustedActor =
255
212
  resolveTrustClass(conversation?.trustContext) === "guardian";
@@ -259,11 +216,15 @@ const userPromptSubmitMemoryRetrieval: PluginHookFn<
259
216
  );
260
217
 
261
218
  if (conversation && isTrustedActor && abortSignal) {
219
+ // Retrieval progress (`memory_status`) and the `memory_recalled` summary
220
+ // publish to the shared `broadcastMessage` hub — the sink every turn
221
+ // publisher converges to — rather than a threaded event callback. This
222
+ // keeps any raw client-emit capability off the hook contract.
262
223
  const graphResult = await conversation.graphMemory.prepareMemory(
263
224
  ctx.latestMessages,
264
- getConfig(),
225
+ config,
265
226
  abortSignal,
266
- ctx.onEvent,
227
+ broadcastMessage,
267
228
  );
268
229
 
269
230
  recordRecallSideEffects(graphResult, ctx);
@@ -300,14 +261,22 @@ const userPromptSubmitMemoryRetrieval: PluginHookFn<
300
261
  // input — the Slack chronological transcript, the unified `<turn_context>`
301
262
  // block, channel/voice/transport hints, and the turn's trust/index/call-site
302
263
  // — from the live conversation, so we hand in only the request id and
303
- // conversation id plus the fields resolved once at turn start
304
- // (`isNonInteractive`, `modelProfile`). The unified `<turn_context>` actor
305
- // input is self-resolved from the live conversation's trust context. This
306
- // first-call assembly always runs at `"full"` volume; overflow reduction only
307
- // downgrades the mode on later re-injection.
264
+ // conversation id plus the field resolved once at turn start
265
+ // (`isNonInteractive`). The `model_profile` label is rendered here from the
266
+ // turn's resolved profile key, using the call site self-resolved from the
267
+ // live conversation. The unified `<turn_context>` actor input is
268
+ // self-resolved from the live conversation's trust context. This first-call
269
+ // assembly always runs at `"full"` volume; overflow reduction only downgrades
270
+ // the mode on later re-injection.
271
+ const modelProfile = resolveTurnModelProfileLabel(
272
+ ctx.modelProfileKey,
273
+ conversation?.currentCallSite ?? "mainAgent",
274
+ config.llm,
275
+ ctx.conversationId,
276
+ );
308
277
  const injection = await applyRuntimeInjections(ctx.latestMessages, {
309
278
  isNonInteractive: ctx.isNonInteractive,
310
- modelProfile: ctx.modelProfile,
279
+ modelProfile,
311
280
  actorContext,
312
281
  mode: "full",
313
282
  requestId: ctx.requestId,
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "default-memory-retrieval",
3
+ "version": "1.0.0",
4
+ "description": "First-party default plugin running memory-graph retrieval and runtime injection at the front of the user-prompt-submit chain.",
5
+ "private": true,
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "engines": {
9
+ "node": ">=20.12.0"
10
+ },
11
+ "peerDependencies": {
12
+ "@vellumai/plugin-api": "^0.8.0"
13
+ }
14
+ }
@@ -41,7 +41,7 @@
41
41
  * absolute paths or workspace-local copies — the TypeScript compiler erases
42
42
  * them and they have no module-identity effect at runtime.
43
43
  *
44
- * See `experimental/plugins/README.md` for the full authoring contract and
44
+ * See `plugins/README.md` for the full authoring contract and
45
45
  * `assistant/examples/plugins/echo/` for a worked example.
46
46
  */
47
47
 
@@ -317,12 +317,11 @@ export interface Injector {
317
317
  }
318
318
 
319
319
  // ─── Model-visible capability slots ──────────────────────────────────────────
320
- // Concrete shapes are defined by the tool/route/skill registries. Tool
321
- // contributions (PR 31) use the canonical `Tool` interface; route
322
- // contributions (PR 32) use the `SkillRoute` shape from the skill-route
323
- // registry; skill contributions (PR 33) ship with the concrete
324
- // `PluginSkillRegistration` shape below so plugins can declare
325
- // catalog-discoverable skills today.
320
+ // Concrete shapes are defined by the tool/route registries. Tool
321
+ // contributions use the canonical `Tool` interface; route contributions use
322
+ // the `SkillRoute` shape from the skill-route registry. Skills ship on disk
323
+ // inside an installed plugin (`plugins/<name>/skills/<id>/SKILL.md`) and are
324
+ // discovered by the skill catalog loader, so they need no contribution slot.
326
325
 
327
326
  /**
328
327
  * HTTP route registration contributed by a plugin. Plugins express routes as
@@ -336,49 +335,6 @@ export interface Injector {
336
335
  */
337
336
  export type PluginRouteRegistration = SkillRoute;
338
337
 
339
- /**
340
- * A skill contributed by a plugin.
341
- *
342
- * When a plugin declares {@link Plugin.skills}, the bootstrap registers each
343
- * entry into an in-memory side catalog that {@link loadSkillCatalog} merges
344
- * into its output. The entry is then discoverable by the model's `skill_load`
345
- * / `skill_execute` flow under `source: "plugin"` — the same code paths used
346
- * for filesystem-backed skills.
347
- *
348
- * The fields mirror the subset of `SkillSummary` / `SkillDefinition` that
349
- * makes sense for an in-memory contribution. Inline commands and reference
350
- * files are out of scope for plugin skills in this PR — add them later if a
351
- * real plugin needs them.
352
- */
353
- export interface PluginSkillRegistration {
354
- /** Stable skill id (kebab-case). Must be unique across the catalog. */
355
- id: string;
356
- /**
357
- * Skill "name" as surfaced to the model. Matches the SKILL.md frontmatter
358
- * `name` field for filesystem skills.
359
- */
360
- name: string;
361
- /**
362
- * Human-readable display name shown in UI lists. Defaults to `name` when
363
- * omitted — matches the filesystem-skill default.
364
- */
365
- displayName?: string;
366
- /** One-line description shown by `skill_load` / UI. */
367
- description: string;
368
- /** Full skill body returned when `skill_load` fires for this skill. */
369
- body: string;
370
- /** Optional emoji shown beside the skill in UI surfaces. */
371
- emoji?: string;
372
- /** Optional assistant feature-flag key — when set and the flag is OFF, the skill is filtered out. */
373
- featureFlag?: string;
374
- /** Compact routing cues injected into `<available_skills>` to guide selection. */
375
- activationHints?: string[];
376
- /** Conditions under which this skill should NOT be loaded. */
377
- avoidWhen?: string[];
378
- /** IDs of child skills that this skill includes (metadata-only, not auto-activated). */
379
- includes?: string[];
380
- }
381
-
382
338
  // ─── Plugin ──────────────────────────────────────────────────────────────────
383
339
 
384
340
  /**
@@ -420,8 +376,6 @@ export interface Plugin {
420
376
  tools?: Tool[];
421
377
  /** HTTP route registrations served by the assistant. */
422
378
  routes?: PluginRouteRegistration[];
423
- /** Skill registrations loaded at startup. */
424
- skills?: PluginSkillRegistration[];
425
379
  }
426
380
 
427
381
  // ─── Errors ──────────────────────────────────────────────────────────────────
@@ -37,8 +37,7 @@ mock.module("../../../memory/db-connection.js", () => ({
37
37
  }));
38
38
 
39
39
  mock.module("../../../config/assistant-feature-flags.js", () => ({
40
- isAssistantFeatureFlagEnabled: (flag: string) =>
41
- flag === "openai-compatible-endpoints",
40
+ isAssistantFeatureFlagEnabled: () => false,
42
41
  }));
43
42
 
44
43
  mock.module("../../../config/loader.js", () => ({
@@ -41,6 +41,15 @@ export interface CatalogModel {
41
41
  longContextPricingThresholdTokens?: number;
42
42
  longContextMode?: LongContextMode;
43
43
  supportsThinking?: boolean;
44
+ /**
45
+ * When true, the model always reasons with adaptive (always-on) thinking and
46
+ * rejects an explicit `thinking: { type: "disabled" }` request (Anthropic
47
+ * 400s such calls). Clients hide the enable/disable thinking toggle for these
48
+ * models — effort stays adjustable — and the daemon drops a disabled thinking
49
+ * config (and any non-1 `temperature`, which adaptive mode also rejects)
50
+ * before dispatching. Implies `supportsThinking`.
51
+ */
52
+ adaptiveThinkingOnly?: boolean;
44
53
  supportsCaching?: boolean;
45
54
  supportsVision?: boolean;
46
55
  supportsToolUse?: boolean;
@@ -144,6 +153,24 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
144
153
  linkLabel: "Open Anthropic Console",
145
154
  },
146
155
  models: [
156
+ {
157
+ id: "claude-fable-5",
158
+ displayName: "Claude Fable 5",
159
+ contextWindowTokens: 1000000,
160
+ maxOutputTokens: 128000,
161
+ longContextPricingThresholdTokens: 200000,
162
+ supportsThinking: true,
163
+ adaptiveThinkingOnly: true,
164
+ supportsCaching: true,
165
+ supportsVision: true,
166
+ supportsToolUse: true,
167
+ pricing: {
168
+ inputPer1mTokens: 10,
169
+ outputPer1mTokens: 50,
170
+ cacheWritePer1mTokens: 12.5,
171
+ cacheReadPer1mTokens: 1,
172
+ },
173
+ },
147
174
  {
148
175
  id: "claude-opus-4-8",
149
176
  displayName: "Claude Opus 4.8",
@@ -720,6 +747,24 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
720
747
  // OpenRouter proxies anthropic/* through Anthropic's Messages API, so
721
748
  // prompt caching and cache TTL metadata pass through unchanged and
722
749
  // billing matches Anthropic's direct rates.
750
+ {
751
+ id: "anthropic/claude-fable-5",
752
+ displayName: "Claude Fable 5",
753
+ contextWindowTokens: 1000000,
754
+ maxOutputTokens: 128000,
755
+ longContextPricingThresholdTokens: 200000,
756
+ supportsThinking: true,
757
+ adaptiveThinkingOnly: true,
758
+ supportsCaching: true,
759
+ supportsVision: true,
760
+ supportsToolUse: true,
761
+ pricing: {
762
+ inputPer1mTokens: 10,
763
+ outputPer1mTokens: 50,
764
+ cacheWritePer1mTokens: 12.5,
765
+ cacheReadPer1mTokens: 1,
766
+ },
767
+ },
723
768
  {
724
769
  id: "anthropic/claude-opus-4.8",
725
770
  displayName: "Claude Opus 4.8",
@@ -1167,7 +1212,6 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
1167
1212
  setupHint:
1168
1213
  "Enter the base URL of your endpoint and at least one model identifier.",
1169
1214
  apiKeyPlaceholder: "Your provider's API key",
1170
- featureFlag: "openai-compatible-endpoints",
1171
1215
  models: [],
1172
1216
  defaultModel: "",
1173
1217
  },
@@ -1227,3 +1271,15 @@ export function getCatalogProviderForModel(
1227
1271
  );
1228
1272
  return matches.length === 1 ? matches[0]?.id : undefined;
1229
1273
  }
1274
+
1275
+ /**
1276
+ * Whether the given model only supports adaptive (always-on) thinking, driven
1277
+ * by the `adaptiveThinkingOnly` capability in the catalog. Matches the model ID
1278
+ * across every provider (a model carries the same id under each provider it is
1279
+ * offered by, e.g. `claude-fable-5` and OpenRouter's `anthropic/claude-fable-5`).
1280
+ */
1281
+ export function isAdaptiveThinkingOnlyModel(modelId: string): boolean {
1282
+ return PROVIDER_CATALOG.some((p) =>
1283
+ p.models.some((m) => m.id === modelId && m.adaptiveThinkingOnly === true),
1284
+ );
1285
+ }
@@ -28,7 +28,6 @@ const log = getLogger("provider-registry");
28
28
 
29
29
  const providers = new Map<string, Provider>();
30
30
  const routingSources = new Map<string, "user-key" | "managed-proxy">();
31
- const OPENAI_COMPATIBLE_ENDPOINTS_FLAG = "openai-compatible-endpoints";
32
31
  const NATIVE_WEB_SEARCH_PROVIDER_IDS = new Set(["anthropic", "openai"]);
33
32
 
34
33
  /** Per-connection provider cache, keyed by connection name and model. */
@@ -258,13 +257,6 @@ export async function resolveProviderFromConnection(
258
257
  config: ProvidersConfig,
259
258
  opts: { model?: string } = {},
260
259
  ): Promise<Provider | null> {
261
- if (
262
- connection.provider === "openai-compatible" &&
263
- !isProviderFeatureFlagEnabled(OPENAI_COMPATIBLE_ENDPOINTS_FLAG, config)
264
- ) {
265
- return null;
266
- }
267
-
268
260
  const model = opts.model ?? resolveModel(config, connection.provider);
269
261
  const cacheKey = getConnectionProviderCacheKey(connection, model);
270
262
  const cached = connectionProviders.get(cacheKey);
@@ -14,6 +14,7 @@ import {
14
14
  sleep,
15
15
  } from "../util/retry.js";
16
16
  import { resolveLogitBiasPreset } from "./inference/logit-bias.js";
17
+ import { isAdaptiveThinkingOnlyModel } from "./model-catalog.js";
17
18
  import {
18
19
  isThinkingConfigDisabled,
19
20
  normalizeThinkingConfigForWire,
@@ -324,6 +325,18 @@ function normalizeSendMessageOptions(
324
325
  }
325
326
  }
326
327
 
328
+ // Claude Fable always reasons with adaptive thinking and rejects an explicit
329
+ // `thinking: { type: "disabled" }` (Anthropic 400s the request). Drop a
330
+ // disabled thinking config for these models so they fall back to their
331
+ // always-on adaptive thinking; effort and other params are unaffected.
332
+ if (
333
+ typeof nextConfig.model === "string" &&
334
+ isAdaptiveThinkingOnlyModel(nextConfig.model) &&
335
+ isThinkingConfigDisabled(nextConfig.thinking)
336
+ ) {
337
+ delete nextConfig.thinking;
338
+ }
339
+
327
340
  // thinking is Anthropic-specific on the wire; OpenRouter reads it as a
328
341
  // signal for its unified reasoning parameter; Gemini reads `level` from it.
329
342
  // Strip it for other providers.
@@ -405,15 +418,30 @@ function normalizeSendMessageOptions(
405
418
  // strip `temperature` upstream; non-Anthropic OpenRouter reasoning
406
419
  // models don't have this exact constraint).
407
420
  const isThinkingTemperatureConflict = (() => {
408
- if (nextConfig.thinking == null) return false;
409
- if (isThinkingConfigDisabled(nextConfig.thinking)) return false;
421
+ const model = typeof nextConfig.model === "string" ? nextConfig.model : "";
422
+ // Claude Fable always reasons in adaptive mode, so the `temperature: 1`
423
+ // constraint applies even when no explicit `thinking` config is present
424
+ // (a disabled config was already dropped above). For every other model
425
+ // the constraint only applies when thinking is actually enabled.
426
+ if (!isAdaptiveThinkingOnlyModel(model)) {
427
+ if (nextConfig.thinking == null) {
428
+ return false;
429
+ }
430
+ if (isThinkingConfigDisabled(nextConfig.thinking)) {
431
+ return false;
432
+ }
433
+ }
410
434
  const temp = nextConfig.temperature;
411
- if (typeof temp !== "number") return false;
412
- if (temp === 1) return false;
413
- if (providerName === "anthropic") return true;
435
+ if (typeof temp !== "number") {
436
+ return false;
437
+ }
438
+ if (temp === 1) {
439
+ return false;
440
+ }
441
+ if (providerName === "anthropic") {
442
+ return true;
443
+ }
414
444
  if (providerName === "openrouter") {
415
- const model =
416
- typeof nextConfig.model === "string" ? nextConfig.model : "";
417
445
  return model.startsWith("anthropic/");
418
446
  }
419
447
  return false;
@@ -75,6 +75,7 @@ const steerOrResumeMock = mock(
75
75
  mock.module("../../../acp/index.js", () => ({
76
76
  getAcpSessionManager: () => ({
77
77
  getStatus: () => fakeInMemorySessions,
78
+ getActiveAndPendingIds: () => fakeInMemorySessions.map((s) => s.id),
78
79
  spawn: spawnMock,
79
80
  steerOrResume: steerOrResumeMock,
80
81
  }),
@@ -86,6 +87,34 @@ mock.module("../../../acp/prepare-agent-env.js", () => ({
86
87
  prepareAgentEnv: async (agentConfig: unknown) => agentConfig,
87
88
  }));
88
89
 
90
+ // The spawn route and steer's resume branch gate on a high-risk approval
91
+ // (ATL-822) before starting the host agent. These tests pin the
92
+ // resolve/install/resume flow, so the hub mock auto-resolves the freshly
93
+ // registered confirmation the same way `POST /v1/confirm` would (resolve +
94
+ // directResolve). `approvalBehavior` flips allow/deny; `confirmationRequests`
95
+ // captures the prompts. Other event types are ignored.
96
+ import * as pendingInteractions from "../../../runtime/pending-interactions.js";
97
+
98
+ let approvalBehavior: "allow" | "deny" = "allow";
99
+ const confirmationRequests: Array<Record<string, unknown>> = [];
100
+ const broadcasts: Array<Record<string, unknown>> = [];
101
+
102
+ mock.module("../../../runtime/assistant-event-hub.js", () => ({
103
+ broadcastMessage: (msg: { type?: string; requestId?: string }) => {
104
+ broadcasts.push(msg as Record<string, unknown>);
105
+ if (msg?.type !== "confirmation_request") return;
106
+ confirmationRequests.push(msg as Record<string, unknown>);
107
+ const interaction = pendingInteractions.resolve(
108
+ msg.requestId as string,
109
+ approvalBehavior === "allow" ? "approved" : "rejected",
110
+ );
111
+ interaction?.directResolve?.(approvalBehavior);
112
+ },
113
+ }));
114
+
115
+ /** Drain pending micro/macrotasks so background resume work settles. */
116
+ const flushAsync = () => new Promise((resolve) => setTimeout(resolve, 0));
117
+
89
118
  const config = await installAcpConfigStub();
90
119
  const which = installWhichStub();
91
120
 
@@ -143,6 +172,9 @@ beforeEach(() => {
143
172
  _resetAdapterInstallCacheForTests();
144
173
  config.setConfig({});
145
174
  which.setWhich((cmd) => `/usr/local/bin/${cmd}`);
175
+ approvalBehavior = "allow";
176
+ confirmationRequests.length = 0;
177
+ broadcasts.length = 0;
146
178
  });
147
179
 
148
180
  describe("GET /v1/acp/sessions — merged in-memory + history", () => {
@@ -652,3 +684,122 @@ describe("POST /v1/acp/:id/steer: resume fallback", () => {
652
684
  await expect(promise).rejects.toBeInstanceOf(NotFoundError);
653
685
  });
654
686
  });
687
+
688
+ // ---------------------------------------------------------------------------
689
+ // POST /v1/acp/:id/steer: resume crosses the host-spawn boundary, so it is
690
+ // gated by the same high-risk guardian approval as spawn (ATL-822). Steering
691
+ // a session still active in memory only redirects an already-approved live
692
+ // process and is NOT prompted.
693
+ // ---------------------------------------------------------------------------
694
+
695
+ describe("POST /v1/acp/:id/steer: resume approval gate", () => {
696
+ test("acks immediately with approvalPending, then resumes once granted", async () => {
697
+ insertHistoryRow({
698
+ id: "gone-1",
699
+ agentId: "claude",
700
+ parentConversationId: "conv-z",
701
+ status: "completed",
702
+ cwd: "/work/repo",
703
+ });
704
+ steerOrResumeImpl = async () => ({ resumed: true });
705
+
706
+ const handler = getSteerHandler();
707
+ // The ack returns before the (async) resume completes, so a slow guardian
708
+ // approval can't trip the client's short ack timeout (ATL-822 / Codex P2).
709
+ const body = await handler({
710
+ pathParams: { id: "gone-1" },
711
+ body: { instruction: "keep going" },
712
+ });
713
+ expect(body).toEqual({
714
+ acpSessionId: "gone-1",
715
+ steered: false,
716
+ approvalPending: true,
717
+ });
718
+
719
+ // The high-risk prompt is surfaced for the resume.
720
+ expect(confirmationRequests).toHaveLength(1);
721
+ const prompt = confirmationRequests[0];
722
+ expect(prompt.toolName).toBe("acp_steer");
723
+ expect(prompt.riskLevel).toBe("high");
724
+ expect(prompt.executionTarget).toBe("host");
725
+ expect(prompt.conversationId).toBe("conv-z");
726
+ expect((prompt.input as { cwd?: string }).cwd).toBe("/work/repo");
727
+
728
+ // After approval settles, the background worker performs the resume.
729
+ await flushAsync();
730
+ expect(steerOrResumeMock).toHaveBeenCalledTimes(1);
731
+ expect(steerOrResumeMock.mock.calls[0][0]).toBe("gone-1");
732
+ });
733
+
734
+ test("denied resume never reaches the session manager and reports an error event", async () => {
735
+ approvalBehavior = "deny";
736
+ insertHistoryRow({
737
+ id: "gone-2",
738
+ acpSessionId: "proto-gone-2",
739
+ parentConversationId: "conv-z",
740
+ status: "completed",
741
+ cwd: "/work/repo",
742
+ });
743
+
744
+ const handler = getSteerHandler();
745
+ const body = await handler({
746
+ pathParams: { id: "gone-2" },
747
+ body: { instruction: "do evil" },
748
+ });
749
+ expect(body).toEqual({
750
+ acpSessionId: "gone-2",
751
+ steered: false,
752
+ approvalPending: true,
753
+ });
754
+
755
+ await flushAsync();
756
+ // Denied before any host re-spawn, and the denial surfaces over SSE.
757
+ expect(steerOrResumeMock).not.toHaveBeenCalled();
758
+ expect(pendingInteractions.getAll()).toHaveLength(0);
759
+ // Keyed by the daemon/route id (what SSE consumers index by), not the
760
+ // persisted protocol id.
761
+ const errEvent = broadcasts.find((m) => m.type === "acp_session_error");
762
+ expect(errEvent?.acpSessionId).toBe("gone-2");
763
+ });
764
+
765
+ test("a legacy row without a persisted cwd is not resumable, so no prompt", async () => {
766
+ insertHistoryRow({ id: "legacy-2", status: "completed", cwd: null });
767
+ steerOrResumeImpl = async (id) => {
768
+ throw new AcpResumeError(
769
+ new Error(`ACP session "${id}" cannot be resumed.`),
770
+ );
771
+ };
772
+
773
+ const handler = getSteerHandler();
774
+ await expect(
775
+ handler({ pathParams: { id: "legacy-2" }, body: { instruction: "go" } }),
776
+ ).rejects.toBeInstanceOf(FailedDependencyError);
777
+ // No spawn would occur, so the gate stays out of the way.
778
+ expect(confirmationRequests).toHaveLength(0);
779
+ });
780
+
781
+ test("steering a session active in memory is not prompted", async () => {
782
+ fakeInMemorySessions = [
783
+ {
784
+ id: "live-2",
785
+ agentId: "claude",
786
+ acpSessionId: "proto-live-2",
787
+ parentConversationId: "conv-1",
788
+ status: "running",
789
+ startedAt: 1000,
790
+ },
791
+ ];
792
+ // A resumable row also exists, but the in-memory session wins → steer.
793
+ insertHistoryRow({ id: "live-2", status: "completed", cwd: "/work/repo" });
794
+
795
+ const handler = getSteerHandler();
796
+ const body = await handler({
797
+ pathParams: { id: "live-2" },
798
+ body: { instruction: "redirect" },
799
+ });
800
+
801
+ expect(confirmationRequests).toHaveLength(0);
802
+ expect(body).toEqual({ acpSessionId: "live-2", steered: true });
803
+ expect(steerOrResumeMock).toHaveBeenCalledTimes(1);
804
+ });
805
+ });