Skip to content

Commit 88bebe8

Browse files
committed
fix(integrations): keep retired Quiver models valid, skip Telos-rejected sampling fields, allow slashes in Thrive refs
1 parent 45809a2 commit 88bebe8

14 files changed

Lines changed: 90 additions & 37 deletions

File tree

‎apps/docs/content/docs/integrations/quiver.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Generate SVG images from text prompts using QuiverAI
3636
| `instructions` | string | No | Style or formatting guidance for the SVG output |
3737
| `references` | file | No | Reference images to guide SVG generation \(up to 4\) |
3838
| `n` | number | No | Number of SVGs to generate \(1-16, default 1\) |
39-
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
40-
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
39+
| `temperature` | number | No | Sampling temperature \(0-2, default 1\). Not sent for Arrow 2 Telos, which rejects it |
40+
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\). Not sent for Arrow 2 Telos, which rejects it |
4141
| `max_output_tokens` | number | No | Maximum output tokens \(1-65536\) |
42-
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |
42+
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\). Not sent for Arrow 2 Telos, which rejects it |
4343

4444
#### Output
4545

@@ -66,10 +66,10 @@ Convert raster images into vector SVG format using QuiverAI
6666
| --------- | ---- | -------- | ----------- |
6767
| `model` | string | Yes | The model to use for vectorization \(e.g., "arrow-2"\) |
6868
| `image` | file | Yes | The raster image to vectorize into SVG |
69-
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
70-
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
69+
| `temperature` | number | No | Sampling temperature \(0-2, default 1\). Not sent for Arrow 2 Telos, which rejects it |
70+
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\). Not sent for Arrow 2 Telos, which rejects it |
7171
| `max_output_tokens` | number | No | Maximum output tokens \(1-65536\) |
72-
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |
72+
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\). Not sent for Arrow 2 Telos, which rejects it |
7373
| `auto_crop` | boolean | No | Automatically crop the image before vectorizing |
7474
| `target_size` | number | No | Square resize target in pixels \(128-4096\) |
7575

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { validateValueForSubBlockType } from '@/lib/workflows/editing/validation'
3+
import { QuiverBlock, QuiverV2Block, QuiverV3Block } from '@/blocks/blocks/quiver'
4+
5+
describe('Quiver model dropdown', () => {
6+
it.each([QuiverBlock, QuiverV2Block, QuiverV3Block])(
7+
'accepts retired Arrow 1.x ids that saved $type blocks still store',
8+
(block) => {
9+
const modelConfig = block.subBlocks.find((subBlock) => subBlock.id === 'model')
10+
if (!modelConfig) throw new Error('Quiver model subBlock missing')
11+
for (const model of ['arrow-preview', 'arrow-1', 'arrow-1.0', 'arrow-1.1', 'arrow-1.1-max']) {
12+
expect(
13+
validateValueForSubBlockType(modelConfig, model, 'model', block.type, 'quiver-1').valid
14+
).toBe(true)
15+
}
16+
}
17+
)
18+
})

‎apps/sim/blocks/blocks/quiver.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
normalizeFileInput,
88
withSavedCredential,
99
} from '@/blocks/utils'
10+
import { RETIRED_QUIVER_MODELS } from '@/tools/quiver/models'
1011

1112
const REFERENCE_IMAGES_FIELD = ['referenceFiles', 'referenceInput'] as const
1213
const IMAGE_FIELD = ['imageFile', 'imageInput'] as const
@@ -61,6 +62,7 @@ export const QuiverBlock = {
6162
options: [
6263
{ label: 'Arrow 2', id: 'arrow-2' },
6364
{ label: 'Arrow 2 Telos', id: 'arrow-2-telos' },
65+
...RETIRED_QUIVER_MODELS.map((id) => ({ label: 'Arrow 2', id, hidden: true })),
6466
],
6567
value: () => 'arrow-2',
6668
condition: { field: 'operation', value: ['text_to_svg', 'image_to_svg'] },

‎apps/sim/lib/internal/quiver/operations.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,25 @@ describe('Quiver operations', () => {
156156
])
157157
})
158158

159+
it('omits the sampling fields Arrow 2 Telos rejects', async () => {
160+
const sampling = { temperature: 0.4, top_p: 0.9, presence_penalty: 0.2, max_output_tokens: 10 }
161+
await executeQuiverImageToSvg(
162+
{ apiKey: 'secret', model: 'arrow-2-telos', image: rawFile, ...sampling },
163+
context
164+
)
165+
await executeQuiverImageToSvg(
166+
{ apiKey: 'secret', model: 'arrow-2', image: rawFile, ...sampling },
167+
context
168+
)
169+
170+
const [telosBody, arrowBody] = mocks.requestQuiverSvg.mock.calls.map(([, , body]) => body)
171+
expect(telosBody).not.toHaveProperty('temperature')
172+
expect(telosBody).not.toHaveProperty('top_p')
173+
expect(telosBody).not.toHaveProperty('presence_penalty')
174+
expect(telosBody).toMatchObject({ max_output_tokens: 10 })
175+
expect(arrowBody).toMatchObject(sampling)
176+
})
177+
159178
it('fails closed on incomplete private model-input provenance', async () => {
160179
const headers = new Headers({
161180
[PRIVATE_MODEL_INPUT_PROVENANCE_HEADER]: RESOLVED_SECRET_PROVENANCE_METADATA_V1,

‎apps/sim/lib/internal/quiver/operations.ts‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { processFilesToUserFiles } from '@/lib/uploads/utils/file'
1717
import { downloadFileFromStorage } from '@/lib/uploads/utils/file.server'
1818
import type { RawFileInput } from '@/lib/uploads/utils/file-schemas'
1919
import { assertToolFileAccess } from '@/app/api/files/authorization'
20+
import { RETIRED_QUIVER_MODELS } from '@/tools/quiver/models'
2021
import type { QuiverSvgResponse } from '@/tools/quiver/types'
2122

2223
const logger = createLogger('QuiverOperations')
@@ -32,20 +33,19 @@ type ApiImage = { url: string } | { base64: string }
3233

3334
export type QuiverSvgOutput = QuiverSvgResponse & { success: true }
3435

35-
/**
36-
* Arrow 1.x model IDs Quiver retired on 2026-10-16 (they now return 404 `model_not_found`).
37-
* Saved blocks still carry them, so they are sent as `arrow-2`, the documented replacement.
38-
*/
39-
const RETIRED_QUIVER_MODELS = new Set([
40-
'arrow-preview',
41-
'arrow-1',
42-
'arrow-1.0',
43-
'arrow-1.1',
44-
'arrow-1.1-max',
45-
])
46-
4736
function resolveModel(model: string): string {
48-
return RETIRED_QUIVER_MODELS.has(model) ? 'arrow-2' : model
37+
return (RETIRED_QUIVER_MODELS as readonly string[]).includes(model) ? 'arrow-2' : model
38+
}
39+
40+
/** Arrow 2 Telos rejects these sampling fields with a 400 even when they hold the default. */
41+
function addSamplingParams(
42+
body: Record<string, unknown>,
43+
input: Pick<QuiverTextToSvgInput, 'temperature' | 'top_p' | 'presence_penalty'>
44+
): void {
45+
if (body.model === 'arrow-2-telos') return
46+
if (input.temperature != null) body.temperature = input.temperature
47+
if (input.top_p != null) body.top_p = input.top_p
48+
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty
4949
}
5050

5151
function fail(message: string, status: number, body?: Record<string, unknown>): never {
@@ -242,10 +242,8 @@ export async function executeQuiverTextToSvg(
242242
if (input.instructions) body.instructions = input.instructions
243243
if (references.length > 0) body.references = references.slice(0, 4)
244244
if (input.n != null) body.n = input.n
245-
if (input.temperature != null) body.temperature = input.temperature
246-
if (input.top_p != null) body.top_p = input.top_p
245+
addSamplingParams(body, input)
247246
if (input.max_output_tokens != null) body.max_output_tokens = input.max_output_tokens
248-
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty
249247

250248
const result = await requestQuiverSvg('generations', input.apiKey, body, context.signal)
251249
context.signal?.throwIfAborted()
@@ -274,10 +272,8 @@ export async function executeQuiverImageToSvg(
274272
validateProvenance(input, context)
275273
const image = await resolveImage(input.image, context)
276274
const body: Record<string, unknown> = { model: resolveModel(input.model), image }
277-
if (input.temperature != null) body.temperature = input.temperature
278-
if (input.top_p != null) body.top_p = input.top_p
275+
addSamplingParams(body, input)
279276
if (input.max_output_tokens != null) body.max_output_tokens = input.max_output_tokens
280-
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty
281277
if (input.auto_crop != null) body.auto_crop = input.auto_crop
282278
if (input.target_size != null) body.target_size = input.target_size
283279

‎apps/sim/tools/generated/tool-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/quiver/image_to_svg.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ export const quiverImageToSvgTool = {
3838
type: 'number',
3939
required: false,
4040
visibility: 'user-or-llm',
41-
description: 'Sampling temperature (0-2, default 1)',
41+
description:
42+
'Sampling temperature (0-2, default 1). Not sent for Arrow 2 Telos, which rejects it',
4243
},
4344
top_p: {
4445
type: 'number',
4546
required: false,
4647
visibility: 'user-or-llm',
47-
description: 'Nucleus sampling probability (0-1, default 1)',
48+
description:
49+
'Nucleus sampling probability (0-1, default 1). Not sent for Arrow 2 Telos, which rejects it',
4850
},
4951
max_output_tokens: {
5052
type: 'number',
@@ -56,7 +58,8 @@ export const quiverImageToSvgTool = {
5658
type: 'number',
5759
required: false,
5860
visibility: 'user-or-llm',
59-
description: 'Token penalty for prior output (-2 to 2, default 0)',
61+
description:
62+
'Token penalty for prior output (-2 to 2, default 0). Not sent for Arrow 2 Telos, which rejects it',
6063
},
6164
auto_crop: {
6265
type: 'boolean',

‎apps/sim/tools/quiver/models.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Arrow 1.x model IDs Quiver retired on 2026-10-16 (they now return 404 `model_not_found`).
3+
* Saved blocks still store them, so the block keeps them as hidden options and the operation
4+
* sends them as `arrow-2`, the documented replacement.
5+
*/
6+
export const RETIRED_QUIVER_MODELS = [
7+
'arrow-preview',
8+
'arrow-1',
9+
'arrow-1.0',
10+
'arrow-1.1',
11+
'arrow-1.1-max',
12+
] as const

‎apps/sim/tools/quiver/text_to_svg.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ export const quiverTextToSvgTool = {
5656
type: 'number',
5757
required: false,
5858
visibility: 'user-or-llm',
59-
description: 'Sampling temperature (0-2, default 1)',
59+
description:
60+
'Sampling temperature (0-2, default 1). Not sent for Arrow 2 Telos, which rejects it',
6061
},
6162
top_p: {
6263
type: 'number',
6364
required: false,
6465
visibility: 'user-or-llm',
65-
description: 'Nucleus sampling probability (0-1, default 1)',
66+
description:
67+
'Nucleus sampling probability (0-1, default 1). Not sent for Arrow 2 Telos, which rejects it',
6668
},
6769
max_output_tokens: {
6870
type: 'number',
@@ -74,7 +76,8 @@ export const quiverTextToSvgTool = {
7476
type: 'number',
7577
required: false,
7678
visibility: 'user-or-llm',
77-
description: 'Token penalty for prior output (-2 to 2, default 0)',
79+
description:
80+
'Token penalty for prior output (-2 to 2, default 0). Not sent for Arrow 2 Telos, which rejects it',
7881
},
7982
},
8083

‎apps/sim/tools/thrive/delete_user.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const deleteUserTool: ToolConfig<ThriveDeleteUserParams, ThriveDeleteResp
4141

4242
request: {
4343
url: (params) =>
44-
`${getThriveBaseUrl(params.host, 'v2')}/users/ref/${safeUrlPathSegment(params.ref, 'ref')}`,
44+
`${getThriveBaseUrl(params.host, 'v2')}/users/ref/${safeUrlPathSegment(params.ref, 'ref', { allowSeparators: true })}`,
4545
method: 'DELETE',
4646
headers: (params) => getThriveHeaders(params.tenantId, params.apiKey),
4747
},

0 commit comments

Comments
 (0)