@happyvertical/smrt-chat 0.57.36 → 0.57.38

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 (38) hide show
  1. package/agents/tool-loop.md +60 -6
  2. package/dist/assistant-turn-events.d.ts +12 -4
  3. package/dist/assistant-turn-events.d.ts.map +1 -1
  4. package/dist/assistant-turn.d.ts +29 -1
  5. package/dist/assistant-turn.d.ts.map +1 -1
  6. package/dist/chunks/{ChatService-D0XuiCTk.js → ChatService-BGBAqmZq.js} +14 -3
  7. package/dist/chunks/ChatService-BGBAqmZq.js.map +1 -0
  8. package/dist/chunks/assistant-turn-events-BbZUf-Ju.js.map +1 -1
  9. package/dist/chunks/chat-stream-BHUXKIzE.js +2689 -0
  10. package/dist/chunks/chat-stream-BHUXKIzE.js.map +1 -0
  11. package/dist/collections/ChatMessageCollection.d.ts +5 -1
  12. package/dist/collections/ChatMessageCollection.d.ts.map +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +12 -5
  16. package/dist/index.js.map +1 -1
  17. package/dist/internal/agent-runtime.js +1 -1
  18. package/dist/manifest.json +2 -1
  19. package/dist/persona-conversation.d.ts +5 -0
  20. package/dist/persona-conversation.d.ts.map +1 -1
  21. package/dist/services/ChatService.d.ts +12 -1
  22. package/dist/services/ChatService.d.ts.map +1 -1
  23. package/dist/smrt-knowledge.json +5 -5
  24. package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.d.ts +6 -2
  25. package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.d.ts.map +1 -1
  26. package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.js +4 -1
  27. package/dist/sveltekit.d.ts +13 -2
  28. package/dist/sveltekit.d.ts.map +1 -1
  29. package/dist/sveltekit.js +7 -3
  30. package/dist/sveltekit.js.map +1 -1
  31. package/dist/tool-loop.d.ts +47 -9
  32. package/dist/tool-loop.d.ts.map +1 -1
  33. package/dist/voice.d.ts +4 -0
  34. package/dist/voice.d.ts.map +1 -1
  35. package/package.json +21 -21
  36. package/dist/chunks/ChatService-D0XuiCTk.js.map +0 -1
  37. package/dist/chunks/chat-stream-D6B3InMe.js +0 -2601
  38. package/dist/chunks/chat-stream-D6B3InMe.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"persona-conversation.d.ts","sourceRoot":"","sources":["../src/persona-conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAIjB,KAAK,eAAe,EACpB,KAAK,cAAc,EAEpB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2EAA2E;IAC3E,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,q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2
2
  import type { AgentSession } from '../models/AgentSession.js';
3
3
  import type { ChatMessage } from '../models/ChatMessage.js';
4
4
  import type { ChatThread } from '../models/ChatThread.js';
5
- import type { ChatMessageType, ChatParticipantRole, ChatRoomStatus, ChatRoomType } from '../types.js';
5
+ import type { ChatMessageRole, ChatMessageType, ChatParticipantRole, ChatRoomStatus, ChatRoomType } from '../types.js';
6
6
  /**
7
7
  * Parameters for emitting an agent-authored (assistant/tool) message. Used only
8
8
  * by the internal {@link sendAgentReply} bridge below — NOT a public surface.
@@ -340,6 +340,11 @@ export declare class ChatService {
340
340
  tenantId: string;
341
341
  limit?: number;
342
342
  before?: string;
343
+ /**
344
+ * Keep only these roles, in SQL, so `limit` counts them alone (#4458).
345
+ * Omitted or empty reads every role.
346
+ */
347
+ roles?: readonly ChatMessageRole[];
343
348
  }): Promise<ChatMessage[]>;
344
349
  /**
345
350
  * Load a room only if the AUTHENTICATED CALLER is an active member (S5 #1392).
@@ -401,12 +406,18 @@ export declare class ChatService {
401
406
  * the thread's room. Messages are returned oldest-first (chronological).
402
407
  * Replaces direct `messages.list({ where: { threadId } })` reach-ins that
403
408
  * could read another tenant's/room's thread history by raw id.
409
+ *
410
+ * `roles` (non-empty) keeps only those roles, in SQL, so `limit` counts
411
+ * them alone: a history builder passes the roles it replays and gets the
412
+ * newest `limit` of those, however many tool rows sit between (#4458).
413
+ * Omitted or empty reads every role.
404
414
  */
405
415
  getThreadMessages(params: {
406
416
  threadId: string;
407
417
  actorProfileId: string;
408
418
  tenantId: string;
409
419
  limit?: number;
420
+ roles?: readonly ChatMessageRole[];
410
421
  }): Promise<ChatMessage[]>;
411
422
  /**
412
423
  * A stored message and the replies linked to it (`replyToMessageId`),
@@ -1 +1 @@
1
- {"version":3,"file":"ChatService.d.ts","sourceRoot":"","sources":["../../src/services/ChatService.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAYlC,OAAO,KAAK,EAAE,YA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AE,gBAAgB,wBAGzB"}
@@ -3,16 +3,16 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-chat",
6
- "packageVersion": "0.57.36",
6
+ "packageVersion": "0.57.38",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "0b2615511988e6b6d7ebe12065346e6e5e36bc0d0b622e162c532ca24e01840c",
11
- "packageJson": "64003eeb0f0cd2c98cf8828ff1a0c1bc8c3c73c9d2aec2df11d7dfb43365d63c",
10
+ "manifest": "e0c611367adbc4f6691455d121e732a6dfe65d121ca32407d1c9f3a1b9558894",
11
+ "packageJson": "8bfecf1eea08c5c67192eb6278c496f61ab06890e2359646dceee3d705f9fa82",
12
12
  "agents": "070c6bd790c209515457c27e6ad34e9d1c4e5e7b5787e3c7c28f4bf85a808013",
13
13
  "moduleDoc:agents/dev-workbench.md": "f07a428519e8cca4a46371da0a3b33b9c8d3102f1d9056e4c8efba3c0b702048",
14
14
  "moduleDoc:agents/overview-tools.md": "752a4afb6b57a2e9224f3c65a98b0deb23cda87371f01ac0566f0887e9bb12da",
15
- "moduleDoc:agents/tool-loop.md": "7976d80521c4212a3eb7e66f9bb4abb6192c00bacf4e4722571280a175cc8d07",
15
+ "moduleDoc:agents/tool-loop.md": "03a73bdf49f2d0376500947bc866ddf5e2a3f9896755a66fa85ec8d8292bcae3",
16
16
  "moduleDoc:agents/token-streaming.md": "e92a28a8702d111a3751a86b8cdff30cb5146cc115fed86c227402bef1c683fd",
17
17
  "moduleDoc:agents/assistant-questions.md": "a0371870b3bc99e313d8287912208f3e315bab7dc4ee138214895031ae79a5b0",
18
18
  "moduleDoc:agents/recipes.md": "89c2c86e4e26cea9ba10d917f8ad71c23a71d4fd8eaacf638a6cd252e2376c07",
@@ -4528,7 +4528,7 @@
4528
4528
  {
4529
4529
  "path": "agents/tool-loop.md",
4530
4530
  "module": "tool-loop",
4531
- "content": "# Tool loop termination and tool-call hygiene\n\n`runToolLoop()` (`src/tool-loop.ts`) runs one bounded\n`tool_call → observe → respond` turn. Both `runPersonaConversationTurn()` and\n`runAssistantTurn()` go through it, so every rule below holds for both.\n\n## Termination\n\n- Rounds that execute tools are capped by `maxSteps`\n (`DEFAULT_MAX_STEPS = 8`; `initialSteps` counts earlier legs of a resumed\n turn). `maxTotalTokens` (with `initialTokens`) and `deadline` end the turn\n early with `stoppedReason: 'budget'`.\n- **Forced final call (#4378).** At the cap, or once the budget is spent, the\n next round is offered no tools (`tools: undefined`, `toolChoice: 'none'`),\n and any tool calls the model still emits are discarded. That call alone gets\n the fixed `TOOL_LOOP_ANSWER_NOW_INSTRUCTION` as a temporary `user`\n instruction. If the transcript already ends with a user turn, it is added\n to a copy of that turn's text or multimodal content instead of introducing\n consecutive user roles that strict templates reject. Otherwise it is a new\n user message. It never enters the returned `messages` transcript; input\n messages, stored conversations, and continuations stay unchanged.\n\n## Blank answers and timeouts (#4379)\n\n- **Retry once, within budget.** A final round with blank content and no\n usable tool calls (none made, or discarded on a no-tools round) is retried\n once without tools, with `TOOL_LOOP_ANSWER_NOW_INSTRUCTION` appended to\n that call only, and `emptyRetried: true`. The retry is skipped when the\n token budget (`maxTotalTokens`) or `deadline` is already spent: the turn\n goes straight to `empty`. The forced final call itself is one uncapped\n call, so a spent budget still gets one answer attempt; only the retry is\n budget-gated. Each blank round emits an `empty_round` step event (no model\n text; `retry` says whether a retry follows). `runAssistantTurn` does not\n show it as a dock step.\n- **Report.** Still blank: `stoppedReason: 'empty'`, `content: ''`. A model\n call that throws a timeout (`AI_TIMEOUT`, `TIMEOUT`, `REQUEST_TIMEOUT`,\n `TimeoutError`, or an `AbortError` the caller's signal did not cause) ends\n `stoppedReason: 'timeout'` instead of failing or passing as an empty\n success; other errors still throw. When the final round was the forced\n no-tools call, `capReason` (`max_steps` | `budget`) keeps that cause\n alongside `empty`/`timeout`.\n- **Quiet stream ends (older SDKs).** SDKs <= 0.108.0 can end a timed-out\n stream quietly: no text, no tool calls, no finish reason. That shape is a\n suspected timeout only for an AI boundary that has already reported a\n finish reason in this process (so its absence is anomalous), and only when\n the retry ends the same way; then the turn is `timeout`. A boundary that\n never reports finish reasons, or a blank reply that has one, is `empty`.\n The \"has reported\" flag is kept per AI client object for the process\n lifetime, so one client that routes to providers with and without finish\n reasons can mislabel an `empty` turn as `timeout` (or the reverse).\n- **Timeouts are configurable, not derived.** `requestTimeoutMs` is\n forwarded as the per-call `timeout` (default: the provider's 120 s). It is\n not derived from `deadline`/`maxTurnMs`: those only stop new tool rounds\n and gate the retry.\n- **Fallback text.** Both callers store `resolveTurnReply(result,\n fallback)`: the content trimmed at its outer edges only (both paths\n alike; persona replies were stored untrimmed before), or\n `emptyAnswerFallback` / `DEFAULT_EMPTY_ANSWER_FALLBACK` when blank.\n `runPersonaConversationTurn` returns it as `reply` (plus `replyFallback`);\n voice and the chat stream use it. `runAssistantTurn` replaces its old\n `'Done.'`. The plain chat-stream path retries a blank stream once, then\n sends the fallback, or `CHAT_STREAM_TIMEOUT_ERROR` only under the\n quiet-end rule above.\n- **Stored metadata.** Every authored assistant reply carries\n `replyMetadataFor(result, reply)`: `metadata.stoppedReason` (enum),\n `metadata.capReason` when set, and `metadata.fallback` (`empty` |\n `timeout`) when the content is the fallback. Hosts read the stop reason\n from `turn.result.stoppedReason` (persona), `AssistantTurnResult` / the\n `done` event's `stoppedReason` and `capReason` (assistant), or the stored\n message's metadata. `isFallbackReply(message)` tells a fallback apart; the\n assistant route's and voice's history builders skip fallback replies so\n they are never replayed to the model as answers. The chat-stream paths\n (plain and persona) take history from the browser, which sends no\n metadata, so they recognise an assistant message whose text exactly\n equals the configured or default fallback text. All three replay the\n fixed `FALLBACK_HISTORY_PLACEHOLDER` in its place rather than dropping\n it: a drop would leave two user messages in a row, which strict chat\n templates (Gemma, Anthropic) reject. Hosts should hide feedback\n controls (thumbs, corrections) on a message where `isFallbackReply` is\n true: there is no model answer to rate.\n- **Dock.** The `done` event's `capReason` reaches the dock, which offers\n Continue for a capped turn even when it ended `empty` or `timeout`.\n- **Reasoning.** `AIResponse.reasoning` (newer SDKs, sdk#1459) is read\n defensively, capped at `MAX_TOOL_LOOP_REASONING_CHARS` code points, passed\n to `onReasoning` (forwarded by both callers; a throw is ignored) and\n returned as `result.reasoning` (the retry's, else the first round's).\n Reasoning can quote documents and tool results: send it only to logs with\n the same protection as the conversation. It is never persisted and never\n the answer unless the host opts in with `answerFromReasoning` — which\n stores raw chain-of-thought as the reply (`contentFromReasoning: true`).\n- **Budgets on the persona path.** `runPersonaConversationTurn` forwards\n `maxTotalTokens`, `deadline`, `toolChoice` and `requestTimeoutMs`\n (`runAssistantTurn` exposes them as `maxTurnTokens`/`maxTurnMs`).\n\n## Observation bounds\n\n- A server tool observation is serialized and capped at\n `MAX_SERVER_TOOL_OBSERVATION_CHARS` (16,000, the same bound as\n `MAX_CLIENT_TOOL_RESULT_CHARS` for browser results) before it enters the\n transcript (#4378). A longer one is cut and gets the fixed\n `SERVER_TOOL_OBSERVATION_TRUNCATED_MARKER`, which says the result is\n incomplete and tells the model to narrow the request (filter, fewer fields,\n a smaller page, or a count). The marker carries no tool output.\n- The cut never splits a surrogate pair (it keeps one unit fewer instead);\n browser results (`appendClientToolResults`) are cut the same way.\n- Only the model's copy is capped: `ToolInvocation.observation` (handed to\n `onInvocation`, persisted as tool messages, audited) keeps the full value.\n- A tool returning `undefined` observes `null`; an unserializable result\n observes `{\"error\":\"unserializable_result\"}` instead of throwing.\n\n## Argument hygiene (#4378)\n\nArguments the model sends are never dropped silently; each case below is an\n`invalid_request` observation the model can correct and retry. Messages are\nvalue-free: they name the accepted shape, never the model's values.\n\n- **Malformed JSON.** Raw arguments that do not parse to a JSON object\n (malformed JSON, an array, a scalar) fail with code\n `TOOL_ARGUMENTS_MALFORMED`; the tool does not run and the invocation's\n `args` is `{}`. Blank or `null` arguments are a no-argument call. A browser\n tool call with malformed arguments is answered in the transcript and never\n suspends the turn.\n- **Manifest `read`.** Accepts only `id` (string), `where` (object of\n equality filters), `limit` (integer >= 1) and `offset` (integer >= 0). This\n is stricter than before, where these were dropped or defaulted silently:\n an unknown key such as `filter`, a numeric `id`, a non-object `where`, and\n a fractional, zero or string `limit` (or a negative or fractional `offset`)\n now fail with a retryable `invalid_request` (`TOOL_ARGUMENTS_INVALID`)\n instead of listing every row. The offered schema says\n `additionalProperties: false` with `integer` `limit`/`offset` minimums.\n- **`data.query`** (`@happyvertical/smrt-agents`). With a `request` object,\n the only other top-level key allowed is `surfaceId`; a sibling such as\n `filter` fails with `DataSurfaceRequestError` reason\n `DATA_QUERY_ARGUMENTS_UNEXPECTED`, naming only misplaced grammar keys. The\n flat form (request keys beside `surfaceId`, no `request`) still works.\n- **`surfaceId` placement** (`data.query`, `data.inspect`). A\n `request.surfaceId` string is lifted to the top level and removed from\n `request`; a `query` object standing in for `request`, or one that is\n `request`'s only key, is unwrapped (its keys are then validated as usual,\n so nothing is dropped; unwrapping was chosen over rejecting because the\n intent is unambiguous). Two different ids are\n `DATA_QUERY_SURFACE_ID_CONFLICT`; no id at all is a 400\n `DATA_QUERY_SURFACE_ID_REQUIRED` with an example. Only an id naming no\n visible surface gets the generic \"not available\" denial. A filter `kind`\n that is an operator (`in`) or a logical word (`or`) gets a targeted hint.\n- **Valid examples.** Every `data.query` request error ends with a one-line\n `Valid example: {\"surfaceId\":…,\"request\":{…}}` for that surface, in the\n failed request's mode (count, rows or facets), built from the surface id\n and caller-visible field ids with `<value>` placeholders — never the\n caller's own values. Row examples cap page size at the surface’s\n `maxPageLimit`.\n\n## Dedupe of identical read-only calls (#4382)\n\nWithin one `runToolLoop` call, a server call that repeats an earlier one —\nsame tool, same arguments after canonicalization (object keys sorted) — is\nnot executed again. Its invocation has `deduped: true`, mirrors the earlier\n`ok`/`error`, and observes the fixed `TOOL_CALL_DEDUPED_NOTE` instead of a\nsecond copy of the result.\n\n- Only read-only, idempotent tools qualify: manifest `read`, and\n `data.discover`, `data.inspect`, `data.query`. Mutating tools,\n `agents.invoke`, other extra tools and browser tools never do; nor do\n malformed-argument calls.\n- **Invalidation.** Any resolved server call that is not on that allow-list\n (a write, `agents.invoke`, any other extra tool), whatever its result,\n clears every remembered read, so a read after a write always runs fresh.\n- A repeat of a rejected or refused call observes\n `TOOL_CALL_DEDUPED_REJECTED_NOTE` (repeating it will not work; fix the\n arguments) instead of the plain pointer note.\n- An earlier `execution_error` is not reused: a transient server failure\n may be retried. Arguments over 4,000 canonical characters are never keyed.\n- The cache holds at most `MAX_DEDUPED_CALLS_PER_TURN` (64) calls and lives\n only inside that `runToolLoop` call: never across turns (an assistant\n resume leg starts a fresh cache).\n- Deduped calls count toward the step cap: a round of repeats is still a\n round, so a model stuck repeating a call still stops at `maxSteps`.\n- The audit sink gets `action: 'chat.tool_call_deduped'` (not a fresh\n execution or failure); the persona path's tool row carries\n `toolCallData.deduped: true`.\n\n## Failed calls are persisted (#4383)\n\nEvery tool invocation records `modelContent`, the exact (capped) text the\nmodel was shown. `toolFailureRecord(invocation)` turns a failed, rejected or\ndenied call into a bounded record: `name`, `args` (over\n`MAX_TOOL_FAILURE_ARGS_CHARS` = 2,000 serialized characters they become\n`{ truncated: true }`; unserializable ones `{ unserializable: true }`;\nmalformed-JSON calls carry `{}`), `status` (`rejected` | `error`),\n`errorKind`, `errorCode` (the error's own stable `A-Z0-9_` code, else the\nkind) and `shown`. Like a successful call's row it carries the arguments\nand shown text, so it is not value-free. A deduped repeat has no record.\n\n- `runPersonaConversationTurn` authors each failed call as a `tool_result`\n row: content = `shown`, `toolCallData` `{ name, args, status, errorCode }`,\n `metadata` `{ toolStatus, errorKind, errorCode }`.\n- `runAssistantTurn` now does the same **by default** when an `author` is\n set — a behaviour change: before, failed calls were never persisted.\n `author.authorFailedInvocation` overrides the row or returns `null` to\n skip it; `authorInvocation` sees successful calls only (never a failed or\n deduped-failed one). A failed row's write error is not a dock step.\n- `runToolLoop` sends the audit sink `action: 'chat.tool_call_failed'` with\n only `toolFailureAuditMetadata(record)`: `name`, `status`, `errorKind`,\n `errorCode`, `argsChars`, `shownChars` — never the arguments or the shown\n text, which can hold user data or raw server errors. A sink throw never\n fails the turn.\n- A browser tool call with malformed arguments is recorded the same way (an\n invocation, an audit entry, `onInvocation`), besides being answered in\n the transcript.\n- Gap: a call to a tool the session does not allow-list cannot be a tool row\n — `sendAgentReply`'s authoring gate refuses the name, and that gate is\n unchanged — so it reaches the audit sink only.\n\n## Tool errors\n\nA thrown tool error is classified by `classifyToolError`: permission denials\nand 401/403 are `not_permitted` (reported as a rejection); a `ValidationError`\nor 400/404/409/422 is `invalid_request` (observation: the actionable message,\n`publicMessage` first, its `code`, and a fix-and-retry hint); everything else,\nincluding 429, is `execution_error`. An `execution_error` observation\ncarries the error's message, its stable `code` when it has one (e.g.\n`DATA_SURFACE_QUERY_FAILED`), and the fixed `TOOL_EXECUTION_ERROR_HINT`:\nthe failure is the server's, so the model should not resend the same call\nbut answer with what it has or tell the user (#4378).\n"
4531
+ "content": "# Tool loop termination and tool-call hygiene\n\n`runToolLoop()` (`src/tool-loop.ts`) runs one bounded\n`tool_call → observe → respond` turn. Both `runPersonaConversationTurn()` and\n`runAssistantTurn()` go through it, so every rule below holds for both.\n\n## Termination\n\n- Rounds that execute tools are capped by `maxSteps`\n (`DEFAULT_MAX_STEPS = 8`; `initialSteps` counts earlier legs of a resumed\n turn). `maxTotalTokens` (with `initialTokens`) and `deadline` end the turn\n early with `stoppedReason: 'budget'`.\n- **Forced final call (#4378).** At the cap, once the budget is spent, or\n after repeated calls (below, #4391), the next round is offered no tools (`tools: undefined`, `toolChoice: 'none'`),\n and any tool calls the model still emits are discarded. That call alone gets\n the fixed `TOOL_LOOP_ANSWER_NOW_INSTRUCTION` as a temporary `user`\n instruction. If the transcript already ends with a user turn, it is added\n to a copy of that turn's text or multimodal content instead of introducing\n consecutive user roles that strict templates reject. Otherwise it is a new\n user message. It never enters the returned `messages` transcript; input\n messages, stored conversations, and continuations stay unchanged.\n\n## Blank answers and timeouts (#4379)\n\n- **Retry once, within budget.** A final round with blank content and no\n usable tool calls (none made, or discarded on a no-tools round) is retried\n once without tools, with `TOOL_LOOP_ANSWER_NOW_INSTRUCTION` appended to\n that call only, and `emptyRetried: true`. The retry is skipped when the\n token budget (`maxTotalTokens`) or `deadline` is already spent: the turn\n goes straight to `empty`. The forced final call itself is one uncapped\n call, so a spent budget still gets one answer attempt; only the retry is\n budget-gated. Each blank round emits an `empty_round` step event (no model\n text; `retry` says whether a retry follows). `runAssistantTurn` does not\n show it as a dock step.\n- **Report.** Still blank: `stoppedReason: 'empty'`, `content: ''`. A model\n call that throws a timeout (`AI_TIMEOUT`, `TIMEOUT`, `REQUEST_TIMEOUT`,\n `TimeoutError`, or an `AbortError` the caller's signal did not cause) ends\n `stoppedReason: 'timeout'` instead of failing or passing as an empty\n success; other errors still throw. When the final round was the forced\n no-tools call, `capReason` (`max_steps` | `budget` | `repeated_calls`)\n keeps that cause alongside `empty`/`timeout`.\n- **Quiet stream ends (older SDKs).** SDKs <= 0.108.0 can end a timed-out\n stream quietly: no text, no tool calls, no finish reason. That shape is a\n suspected timeout only for an AI boundary that has already reported a\n finish reason in this process (so its absence is anomalous), and only when\n the retry ends the same way; then the turn is `timeout`. A boundary that\n never reports finish reasons, or a blank reply that has one, is `empty`.\n The \"has reported\" flag is kept per AI client object for the process\n lifetime, so one client that routes to providers with and without finish\n reasons can mislabel an `empty` turn as `timeout` (or the reverse).\n- **Timeouts are configurable, not derived.** `requestTimeoutMs` is\n forwarded as the per-call `timeout` (default: the provider's 120 s). It is\n not derived from `deadline`/`maxTurnMs`: those only stop new tool rounds\n and gate the retry.\n- **Fallback text.** Both callers store `resolveTurnReply(result,\n fallback)`: the content trimmed at its outer edges only (both paths\n alike; persona replies were stored untrimmed before), or\n `emptyAnswerFallback` / `DEFAULT_EMPTY_ANSWER_FALLBACK` when blank.\n `runPersonaConversationTurn` returns it as `reply` (plus `replyFallback`);\n voice and the chat stream use it. `runAssistantTurn` replaces its old\n `'Done.'`. The plain chat-stream path retries a blank stream once, then\n sends the fallback, or `CHAT_STREAM_TIMEOUT_ERROR` only under the\n quiet-end rule above.\n- **Provider errors (#4454).** A model call that throws is not answered by\n default (an `error` event, nothing stored). `runAssistantTurn` /\n `mountAssistantRoutes` take `providerErrorFallback`: text, or\n `(code, error) => text | undefined` (blank or `undefined` declines and the\n turn fails as before). The text is stored as the assistant row with\n `metadata.fallback: 'provider_error'` (so `isFallbackReply` is true and\n history skips it), the turn ends `stoppedReason: 'provider_error'`, and the\n error still goes to `onError`. A cancelled turn is never answered this way.\n- **Stored metadata.** Every authored assistant reply carries\n `replyMetadataFor(result, reply)`: `metadata.stoppedReason` (enum),\n `metadata.capReason` when set, and `metadata.fallback` (`empty` |\n `timeout` | `provider_error`) when the content is the fallback. Hosts read the stop reason\n from `turn.result.stoppedReason` (persona), `AssistantTurnResult` / the\n `done` event's `stoppedReason` and `capReason` (assistant), or the stored\n message's metadata. `isFallbackReply(message)` tells a fallback apart; the\n assistant route's and voice's history builders skip fallback replies so\n they are never replayed to the model as answers. The chat-stream paths\n (plain and persona) take history from the browser, which sends no\n metadata, so they recognise an assistant message whose text exactly\n equals the configured or default fallback text. All three replay the\n fixed `FALLBACK_HISTORY_PLACEHOLDER` in its place rather than dropping\n it: a drop would leave two user messages in a row, which strict chat\n templates (Gemma, Anthropic) reject. Hosts should hide feedback\n controls (thumbs, corrections) on a message where `isFallbackReply` is\n true: there is no model answer to rate.\n- **History budget (#4458).** `historyLimit` counts replayed turns, not\n raw rows, so persisted tool rows (`authorInvocation`, failed calls) never\n take a slot. The assistant route and voice pass `roles` to\n `getThreadMessages` / `getRoomMessages`, which filter in SQL: the read\n returns at most `limit` rows whatever the thread holds. A fallback reply\n is one replayed turn (its marker). The chat-stream paths cap the\n browser's array at `MAX_CHAT_STREAM_MESSAGES` kept messages, scanning\n back at most 10× that many entries. Threads holding only replayed roles\n see the same history as before.\n- **Dock.** The `done` event's `capReason` reaches the dock, which offers\n Continue for a `max_steps`/`budget` capped turn even when it ended `empty`\n or `timeout` (never for `repeated_calls`, #4391).\n- **Reasoning.** `AIResponse.reasoning` (newer SDKs, sdk#1459) is read\n defensively, capped at `MAX_TOOL_LOOP_REASONING_CHARS` code points, passed\n to `onReasoning` (forwarded by both callers; a throw is ignored) and\n returned as `result.reasoning` (the retry's, else the first round's).\n Reasoning can quote documents and tool results: send it only to logs with\n the same protection as the conversation. It is never persisted and never\n the answer unless the host opts in with `answerFromReasoning` — which\n stores raw chain-of-thought as the reply (`contentFromReasoning: true`).\n- **Budgets on the persona path.** `runPersonaConversationTurn` forwards\n `maxTotalTokens`, `deadline`, `toolChoice` and `requestTimeoutMs`\n (`runAssistantTurn` exposes them as `maxTurnTokens`/`maxTurnMs`).\n\n## Observation bounds\n\n- A server tool observation is serialized and capped at\n `MAX_SERVER_TOOL_OBSERVATION_CHARS` (16,000, the same bound as\n `MAX_CLIENT_TOOL_RESULT_CHARS` for browser results) before it enters the\n transcript (#4378). A longer one is cut and gets the fixed\n `SERVER_TOOL_OBSERVATION_TRUNCATED_MARKER`, which says the result is\n incomplete and tells the model to narrow the request (filter, fewer fields,\n a smaller page, or a count). The marker carries no tool output.\n- The cut never splits a surrogate pair (it keeps one unit fewer instead);\n browser results (`appendClientToolResults`) are cut the same way.\n- Only the model's copy is capped: `ToolInvocation.observation` (handed to\n `onInvocation`, persisted as tool messages, audited) keeps the full value.\n- A tool returning `undefined` observes `null`; an unserializable result\n observes `{\"error\":\"unserializable_result\"}` instead of throwing.\n\n## Argument hygiene (#4378)\n\nArguments the model sends are never dropped silently; each case below is an\n`invalid_request` observation the model can correct and retry. Messages are\nvalue-free: they name the accepted shape, never the model's values.\n\n- **Malformed JSON.** Raw arguments that do not parse to a JSON object\n (malformed JSON, an array, a scalar) fail with code\n `TOOL_ARGUMENTS_MALFORMED`; the tool does not run and the invocation's\n `args` is `{}`. Blank or `null` arguments are a no-argument call. A browser\n tool call with malformed arguments is answered in the transcript and never\n suspends the turn.\n- **Manifest `read`.** Accepts only `id` (string), `where` (object of\n equality filters), `limit` (integer >= 1) and `offset` (integer >= 0). This\n is stricter than before, where these were dropped or defaulted silently:\n an unknown key such as `filter`, a numeric `id`, a non-object `where`, and\n a fractional, zero or string `limit` (or a negative or fractional `offset`)\n now fail with a retryable `invalid_request` (`TOOL_ARGUMENTS_INVALID`)\n instead of listing every row. The offered schema says\n `additionalProperties: false` with `integer` `limit`/`offset` minimums.\n- **`data.query`** (`@happyvertical/smrt-agents`). With a `request` object,\n the only other top-level key allowed is `surfaceId`; a sibling such as\n `filter` fails with `DataSurfaceRequestError` reason\n `DATA_QUERY_ARGUMENTS_UNEXPECTED`, naming only misplaced grammar keys. The\n flat form (request keys beside `surfaceId`, no `request`) still works.\n- **`surfaceId` placement** (`data.query`, `data.inspect`). A\n `request.surfaceId` string is lifted to the top level and removed from\n `request`; a `query` object standing in for `request`, or one that is\n `request`'s only key, is unwrapped (its keys are then validated as usual,\n so nothing is dropped; unwrapping was chosen over rejecting because the\n intent is unambiguous). Two different ids are\n `DATA_QUERY_SURFACE_ID_CONFLICT`; no id at all is a 400\n `DATA_QUERY_SURFACE_ID_REQUIRED` with an example. Only an id naming no\n visible surface gets the generic \"not available\" denial. A filter `kind`\n that is an operator (`in`) or a logical word (`or`) gets a targeted hint.\n- **Valid examples.** Every `data.query` request error ends with a one-line\n `Valid example: {\"surfaceId\":…,\"request\":{…}}` for that surface, in the\n failed request's mode (count, rows or facets), built from the surface id\n and caller-visible field ids with `<value>` placeholders — never the\n caller's own values. Row examples cap page size at the surface’s\n `maxPageLimit`.\n\n## Dedupe of identical read-only calls (#4382)\n\nWithin one `runToolLoop` call, a server call that repeats an earlier one —\nsame tool, same arguments after canonicalization (object keys sorted) — is\nnot executed again. Its invocation has `deduped: true`, mirrors the earlier\n`ok`/`error`, and observes the fixed `TOOL_CALL_DEDUPED_NOTE` instead of a\nsecond copy of the result.\n\n- Only read-only, idempotent tools qualify: manifest `read`, and\n `data.discover`, `data.inspect`, `data.query`. Mutating tools,\n `agents.invoke`, other extra tools and browser tools never do; nor do\n malformed-argument calls.\n- **Invalidation.** Any resolved server call that is not on that allow-list\n (a write, `agents.invoke`, any other extra tool), whatever its result,\n clears every remembered read, so a read after a write always runs fresh.\n- A repeat of a rejected or refused call observes\n `TOOL_CALL_DEDUPED_REJECTED_NOTE` (repeating it will not work; fix the\n arguments) instead of the plain pointer note.\n- An earlier `execution_error` is not reused: a transient server failure\n may be retried. Arguments over 4,000 canonical characters are never keyed.\n- The cache holds at most `MAX_DEDUPED_CALLS_PER_TURN` (64) calls and lives\n only inside that `runToolLoop` call: never across turns (an assistant\n resume leg starts a fresh cache).\n- Deduped calls count toward the step cap: a round of repeats is still a\n round, so a model stuck repeating a call still stops at `maxSteps`.\n- The note points at the earlier result and says to change the arguments\n (for example, add a filter), because a repeat returns the same result.\n\n## Repeated calls end the tool phase (#4391)\n\nA model stuck on one call (an unfiltered count, sent again and again) used\nto burn every step to `maxSteps`. Now, once a single dedupe key (same tool,\nsame canonical arguments) has been deduped `maxRepeatedCalls` times in one\n`runToolLoop` call, the rest of that round still runs — every tool call gets\nits tool result — and the next model call is the forced no-tools call with\n`TOOL_LOOP_ANSWER_NOW_INSTRUCTION` plus, on this path only (and its blank\nretry), `TOOL_LOOP_REPEATED_CALLS_INSTRUCTION`: if the results do not match\nwhat was asked (a total where a filtered count was asked), say the figure\ncould not be got rather than presenting the result as the answer.\n\n- **Option.** `maxRepeatedCalls` on `runToolLoop`, `runAssistantTurn`,\n `runPersonaConversationTurn` and `mountAssistantRoutes`. Default\n `DEFAULT_MAX_REPEATED_CALLS` (2); `0` (or less) turns it off; otherwise it\n is floored and capped at `MAX_REPEATED_CALLS_LIMIT` (16). Non-numbers use\n the default.\n- **What counts.** Only deduped repeats, counted per key: a different\n argument is a different key, mutating and other non-dedupable calls never\n count, and a non-read-only call clears the counts with the dedupe cache.\n Counts live inside one `runToolLoop` call; an assistant resume leg starts\n at zero.\n- **Report.** `stoppedReason: 'repeated_calls'` and `capReason:\n 'repeated_calls'`; `capReason` stays when the forced call then ends `empty`\n or `timeout`. When the step cap or budget is reached in the same round,\n `repeated_calls` wins: more steps would only repeat the call. Stored\n replies carry it in `metadata.stoppedReason`/`metadata.capReason`, like the\n other caps; the `done` event carries both.\n- **Dock: no Continue.** The dock records `run.stoppedReason:\n 'repeated_calls'` but does not offer Continue (`waitingFor` stays null):\n the model already had the result it kept asking for, so another leg would\n repeat the call. Continue stays for `max_steps` and `budget` only. Hosts\n with their own UI should do the same.\n- The audit sink gets `action: 'chat.tool_call_deduped'` (not a fresh\n execution or failure); the persona path's tool row carries\n `toolCallData.deduped: true`.\n\n## Failed calls are persisted (#4383)\n\nEvery tool invocation records `modelContent`, the exact (capped) text the\nmodel was shown. `toolFailureRecord(invocation)` turns a failed, rejected or\ndenied call into a bounded record: `name`, `args` (over\n`MAX_TOOL_FAILURE_ARGS_CHARS` = 2,000 serialized characters they become\n`{ truncated: true }`; unserializable ones `{ unserializable: true }`;\nmalformed-JSON calls carry `{}`), `status` (`rejected` | `error`),\n`errorKind`, `errorCode` (the error's own stable `A-Z0-9_` code, else the\nkind) and `shown`. Like a successful call's row it carries the arguments\nand shown text, so it is not value-free. A deduped repeat has no record.\n\n- `runPersonaConversationTurn` authors each failed call as a `tool_result`\n row: content = `shown`, `toolCallData` `{ name, args, status, errorCode }`,\n `metadata` `{ toolStatus, errorKind, errorCode }`.\n- `runAssistantTurn` now does the same **by default** when an `author` is\n set — a behaviour change: before, failed calls were never persisted.\n `author.authorFailedInvocation` overrides the row or returns `null` to\n skip it; `authorInvocation` sees successful calls only (never a failed or\n deduped-failed one). A failed row's write error is not a dock step.\n- `runToolLoop` sends the audit sink `action: 'chat.tool_call_failed'` with\n only `toolFailureAuditMetadata(record)`: `name`, `status`, `errorKind`,\n `errorCode`, `argsChars`, `shownChars` — never the arguments or the shown\n text, which can hold user data or raw server errors. A sink throw never\n fails the turn.\n- A browser tool call with malformed arguments is recorded the same way (an\n invocation, an audit entry, `onInvocation`), besides being answered in\n the transcript.\n- Gap: a call to a tool the session does not allow-list cannot be a tool row\n — `sendAgentReply`'s authoring gate refuses the name, and that gate is\n unchanged — so it reaches the audit sink only.\n\n## Tool errors\n\nA thrown tool error is classified by `classifyToolError`: permission denials\nand 401/403 are `not_permitted` (reported as a rejection); a `ValidationError`\nor 400/404/409/422 is `invalid_request` (observation: the actionable message,\n`publicMessage` first, its `code`, and a fix-and-retry hint); everything else,\nincluding 429, is `execution_error`. An `execution_error` observation\ncarries the error's message, its stable `code` when it has one (e.g.\n`DATA_SURFACE_QUERY_FAILED`), and the fixed `TOOL_EXECUTION_ERROR_HINT`:\nthe failure is the server's, so the model should not resend the same call\nbut answer with what it has or tell the user (#4378).\n"
4532
4532
  },
4533
4533
  {
4534
4534
  "path": "agents/token-streaming.md",
@@ -147,7 +147,9 @@ export type AssistantRunState = 'running' | 'paused' | 'waiting' | 'done' | 'fai
147
147
  * - `review`: a proposal is ready — a previewed action, a staged form value,
148
148
  * or a host hold of kind `review`;
149
149
  * - `continue`: the run stopped at its step or budget limit; the person can
150
- * ask it to continue.
150
+ * ask it to continue. A run that stopped on `repeated_calls` (#4391) is
151
+ * not offered this: it already had the answer it kept asking for, and
152
+ * another leg would repeat the call.
151
153
  */
152
154
  export interface AssistantRunWaiting {
153
155
  kind: 'confirm' | 'choice' | 'review' | 'continue';
@@ -157,7 +159,9 @@ export interface AssistantRunWaiting {
157
159
  label?: string;
158
160
  }
159
161
  /** Why a run ended. */
160
- export type AssistantRunStopReason = 'max_steps' | 'budget' | 'paused_too_long' | 'user' | 'error';
162
+ export type AssistantRunStopReason = 'max_steps' | 'budget'
163
+ /** The model kept repeating one call; it answered without tools (#4391). */
164
+ | 'repeated_calls' | 'paused_too_long' | 'user' | 'error';
161
165
  export interface AssistantRun {
162
166
  /** The send's `clientRequestId`. */
163
167
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-assistant-dock-controller.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/create-assistant-dock-controller.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGzB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAGV,eAAe,EACf,iBAAiB,EAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAEnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAG7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAEhB,sBAAsB,EACtB,kBAAkB,EAElB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC;AAEb,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,0BAA0B,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACxC;AAED,sEAAsE;AACtE,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC7E;;;;uEAImE;IACnE,KAAK,CACH,OAAO,EAAE,wBAAwB,EACjC,cAAc,E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AE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,gFAAgF;IAChF,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAC9E;;;;OAIG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,aAAa,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;+EAC2E;IAC3E,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C;;iEAE6D;IAC7D,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,YAAY,IAAI,IAAI,CAAC;IACrB,WAAW,IAAI,IAAI,CAAC;IACpB;;;;;;2EAMuE;IACvE,YAAY,IAAI,IAAI,CAAC;IACrB;;;;;;gBAMY;IACZ,YAAY,IAAI,IAAI,CAAC;IACrB;;;;;;;;mCAQ+B;IAC/B,aAAa,IAAI,IAAI,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AA0BD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CAu8DzB"}
1
+ {"version":3,"file":"create-assistant-dock-controller.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/create-assistant-dock-controller.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGzB,MAAM,qCAAqC,CAAC;AAG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AIG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,aAAa,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;+EAC2E;IAC3E,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C;;iEAE6D;IAC7D,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,YAAY,IAAI,IAAI,CAAC;IACrB,WAAW,IAAI,IAAI,CAAC;IACpB;;;;;;2EAMuE;IACvE,YAAY,IAAI,IAAI,CAAC;IACrB;;;;;;gBAMY;IACZ,YAAY,IAAI,IAAI,CAAC;IACrB;;;;;;;;mCAQ+B;IAC/B,aAAa,IAAI,IAAI,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AA0BD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CA08DzB"}
@@ -1053,8 +1053,11 @@ export function createAssistantDockController(options) {
1053
1053
  {
1054
1054
  // A capped turn is continuable even when it then ended `empty`
1055
1055
  // or `timeout` (#4379): its `capReason` keeps the cap cause.
1056
+ // `repeated_calls` (#4391) is recorded but never continuable
1057
+ // (see `computeWaiting`).
1056
1058
  const cap = event.stoppedReason === 'max_steps' ||
1057
- event.stoppedReason === 'budget'
1059
+ event.stoppedReason === 'budget' ||
1060
+ event.stoppedReason === 'repeated_calls'
1058
1061
  ? event.stoppedReason
1059
1062
  : event.capReason;
1060
1063
  if (runCore && cap) {
@@ -47,7 +47,7 @@ import type { AIInterface } from '@happyvertical/ai';
47
47
  import type { PrincipalAuditSink, PrincipalTool } from '@happyvertical/smrt-agents';
48
48
  import type { DataSurfaceActionAdapter } from '@happyvertical/smrt-agents/server';
49
49
  import type { SmrtClassOptions } from '@happyvertical/smrt-core';
50
- import { type AssistantContinuationStore, type AssistantTurnErrorLogger, type AuthoredToolReply } from './assistant-turn.js';
50
+ import { type AssistantContinuationStore, type AssistantTurnErrorLogger, type AuthoredToolReply, type ProviderErrorFallback } from './assistant-turn.js';
51
51
  import type { AgentSession } from './models/AgentSession.js';
52
52
  import type { ChatMessage } from './models/ChatMessage.js';
53
53
  import type { ChatThread } from './models/ChatThread.js';
@@ -234,15 +234,26 @@ export interface MountAssistantRoutesOptions {
234
234
  /** Model used when the request names none. */
235
235
  defaultModel?: string;
236
236
  maxSteps?: number;
237
+ /** Repeated-call stop (see `AssistantTurnOptions`, #4391). */
238
+ maxRepeatedCalls?: number;
237
239
  maxTurnTokens?: number;
238
240
  maxTurnMs?: number;
239
241
  /** Per-model-call timeout in ms (see `AssistantTurnOptions`, #4379). */
240
242
  requestTimeoutMs?: number;
241
243
  /** Reply stored when the turn produced no answer (#4379). */
242
244
  emptyAnswerFallback?: string;
245
+ /**
246
+ * Reply stored when a model call throws, as text or a function of the
247
+ * error `code` (see `AssistantTurnOptions`, #4454). Unset: an error event
248
+ * and nothing stored.
249
+ */
250
+ providerErrorFallback?: ProviderErrorFallback;
243
251
  maxTokens?: number;
244
252
  temperature?: number;
245
- /** Earlier messages sent with a new turn. Default 20. */
253
+ /**
254
+ * Earlier user and assistant turns sent with a new turn; persisted tool
255
+ * rows do not count (#4458). Default 20.
256
+ */
246
257
  historyLimit?: number;
247
258
  /**
248
259
  * A stored send with no reply and no recorded outcome (e.g. its process
@@ -1 +1 @@
1
- {"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../src/sveltekit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACd,MAAM,4BAA4B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mBAAmB,CAAC;AAI3D,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,2EAA2E;AAC3E,eAAO,MAAM,mCAAmC,QAAW,CAAC;AAC5D,6BAA6B;AAC7B,eAAO,MAAM,gCAAgC,QAAc,CAAC;AAC5D,8BAA8B;AAC9B,eAAO,MAAM,sCAAsC,QAAmB,CAAC;AAKvE,8EAA8E;AAC9E,eAAO,MAAM,mCAAmC,QAAiB,CAAC;AAGlE;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,OAAO,GACd,kBAAkB,GAAG,IAAI,CAyB3B;AA0MD,0CAA0C;AAC1C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,CAQ7E;AAED,2CAA2C;AAC3C,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,GACnB,oBAAoB,CA6BtB;AA2CD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,eAAe,CAixCjB;AAaD,wCAAwC;AACxC,eAAO,MAAM,uCAAuC,QAAS,CAAC"}
package/dist/sveltekit.js CHANGED
@@ -1,5 +1,5 @@
1
- import { i as clientRequestMessageId, n as ChatService, t as ChatClientRequestConflictError } from "./chunks/ChatService-D0XuiCTk.js";
2
- import { D as createSessionContinuationStore, F as MAX_CLIENT_TOOL_RESULT_CHARS, M as FALLBACK_HISTORY_PLACEHOLDER, O as runAssistantTurn, T as createAssistantTurnResponse, X as isFallbackReply, nt as sanitizeClientToolDeclarations, q as buildManifestToolCatalog, y as ASSISTANT_TURN_GENERIC_ERROR } from "./chunks/chat-stream-D6B3InMe.js";
1
+ import { i as clientRequestMessageId, n as ChatService, t as ChatClientRequestConflictError } from "./chunks/ChatService-BGBAqmZq.js";
2
+ import { $ as isFallbackReply, D as createSessionContinuationStore, I as MAX_CLIENT_TOOL_RESULT_CHARS, N as FALLBACK_HISTORY_PLACEHOLDER, O as runAssistantTurn, T as createAssistantTurnResponse, X as buildManifestToolCatalog, at as sanitizeClientToolDeclarations, y as ASSISTANT_TURN_GENERIC_ERROR } from "./chunks/chat-stream-BHUXKIzE.js";
3
3
  import { getCurrentSessionPermissionContext, getRequestScopedDatabase } from "@happyvertical/smrt-users";
4
4
  import { getConfig, loadConfig, resolveConfiguredAIProvider, toAIClientOptions } from "@happyvertical/smrt-config";
5
5
  //#region src/sveltekit.ts
@@ -14,6 +14,7 @@ var AssistantRouteError = class extends Error {
14
14
  code;
15
15
  };
16
16
  var DEFAULT_ASSISTANT_AGENT_ID = "smrt-assistant";
17
+ var HISTORY_REPLAY_ROLES = ["user", "assistant"];
17
18
  var ASSISTANT_DOCK_SESSION_KEY = "assistant-dock";
18
19
  var MAX_ASSISTANT_REQUEST_CONTEXT_BYTES = 8 * 1024;
19
20
  var DEFAULT_ASSISTANT_MAX_BODY_BYTES = 1024 * 1024;
@@ -437,10 +438,12 @@ function mountAssistantRoutes(options = {}) {
437
438
  continuationKey: String(thread.id),
438
439
  ...model ? { model } : {},
439
440
  ...options.maxSteps !== void 0 ? { maxSteps: options.maxSteps } : {},
441
+ ...options.maxRepeatedCalls !== void 0 ? { maxRepeatedCalls: options.maxRepeatedCalls } : {},
440
442
  ...options.maxTurnTokens !== void 0 ? { maxTurnTokens: options.maxTurnTokens } : {},
441
443
  ...options.maxTurnMs !== void 0 ? { maxTurnMs: options.maxTurnMs } : {},
442
444
  ...options.requestTimeoutMs !== void 0 ? { requestTimeoutMs: options.requestTimeoutMs } : {},
443
445
  ...options.emptyAnswerFallback !== void 0 ? { emptyAnswerFallback: options.emptyAnswerFallback } : {},
446
+ ...options.providerErrorFallback !== void 0 ? { providerErrorFallback: options.providerErrorFallback } : {},
444
447
  ...options.maxTokens !== void 0 ? { maxTokens: options.maxTokens } : {},
445
448
  ...options.temperature !== void 0 ? { temperature: options.temperature } : {},
446
449
  ...principal.permissions ? { permissions: principal.permissions } : {},
@@ -750,7 +753,8 @@ function mountAssistantRoutes(options = {}) {
750
753
  threadId,
751
754
  actorProfileId: principal.profileId,
752
755
  tenantId: principal.tenantId,
753
- limit: historyLimit + 1
756
+ limit: historyLimit + 1,
757
+ roles: HISTORY_REPLAY_ROLES
754
758
  });
755
759
  for (const message of earlier) {
756
760
  if (String(message.id) === userWire.id) continue;