feat(integrations): add Resemble Detect + Intelligence block#4925
feat(integrations): add Resemble Detect + Intelligence block#4925devshahofficial wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The block is API-key auth ( Also adds Reviewed by Cursor Bugbot for commit 49299ad. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c2e3d83. Configure here.
| data = await pollResource(baseOf(params), `/intelligence/${it.uuid}`, authHeaders(params), params.maxWaitSeconds || 120) | ||
| } catch { | ||
| /* poll path may vary; return submit payload */ | ||
| } |
There was a problem hiding this comment.
Wrong intelligence poll URL
Medium Severity
When media intelligence is still in a non-terminal state, polling uses /intelligence/{uuid} instead of the documented /intelligences/{uuid} GET route. Poll failures are caught and ignored, so the tool can return success: true with the initial submit payload instead of finished analysis.
Reviewed by Cursor Bugbot for commit c2e3d83. Configure here.
| let last = await getJson(`${base}${path}`, headers) | ||
| while (true) { | ||
| const s = (rItem(last).status || '').toString().toLowerCase() | ||
| if (!s || TERMINAL.has(s)) return last |
There was a problem hiding this comment.
Polling stops without status field
Medium Severity
pollResource treats a missing status as finished (!s), but watermark apply results signal in-progress work via watermarked_media: null without a status field. The fallback poll after apply can exit on the first GET and return success: true while the asset is still processing.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c2e3d83. Configure here.
| while (true) { | ||
| const s = (rItem(last).status || '').toString().toLowerCase() | ||
| if (!s || TERMINAL.has(s)) return last | ||
| if (Date.now() >= deadline) return last |
There was a problem hiding this comment.
Timeout returns incomplete success
High Severity
After maxWaitSeconds, pollResource returns the last non-terminal API payload without error. Detect and other tools always expose that as success: true, so long-running jobs can look completed while still processing and missing scores or media URLs.
Reviewed by Cursor Bugbot for commit c2e3d83. Configure here.
Greptile SummaryThis PR adds a Resemble AI integration block covering deepfake detection, media intelligence, and watermarking. It introduces four
Confidence Score: 3/5The registry wiring and block definition are safe, but the intelligence and watermark-apply tools can silently return a pending/incomplete payload when polling fails, making the failure invisible to callers. When apps/sim/tools/resemble/intelligence.ts and apps/sim/tools/resemble/watermark_apply.ts — both contain the silent catch-and-return pattern; apps/sim/tools/resemble/utils.ts for the early-exit on missing status. Important Files Changed
Reviews (1): Last reviewed commit: "feat(integrations): add Resemble Detect ..." | Re-trigger Greptile |
| try { | ||
| data = await pollResource(baseOf(params), `/intelligence/${it.uuid}`, authHeaders(params), params.maxWaitSeconds || 120) | ||
| } catch { | ||
| /* poll path may vary; return submit payload */ | ||
| } |
There was a problem hiding this comment.
Poll failure silently returns a pending payload as success
When pollResource throws (e.g., the result endpoint returns 404, or a network error occurs), the catch block discards the error and the function returns the submit-phase payload — typically { status: "processing", uuid: "..." } — wrapped as { success: true }. Callers have no way to distinguish "analysis complete" from "polling failed and the job is still running."
The same pattern appears in watermark_apply.ts (lines 39–43). Contrast with detect.ts, which intentionally lets the pollResource error propagate so callers can react to it.
| import { authHeaders, baseOf, pollResource, rItem, sanitize } from '@/tools/resemble/utils' | ||
| import type { ToolConfig } from '@/tools/types' | ||
|
|
||
| const TERMINAL = new Set(['completed', 'failed', 'error', 'cancelled', 'success']) |
There was a problem hiding this comment.
Duplicate
TERMINAL set — divergence risk
utils.ts already defines an identical TERMINAL set on line 2, but it is not exported. intelligence.ts re-declares it locally, so if a new terminal status is ever added to utils.ts (e.g., "timeout"), the pre-poll check here will be silently missed. Exporting TERMINAL from utils.ts and importing it here eliminates the drift risk.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| // Intelligence options | ||
| { | ||
| id: 'mediaType', | ||
| title: 'Media Type', | ||
| type: 'dropdown', | ||
| options: [ | ||
| { label: 'Auto', id: 'auto' }, | ||
| { label: 'Audio', id: 'audio' }, | ||
| { label: 'Video', id: 'video' }, | ||
| { label: 'Image', id: 'image' }, | ||
| ], | ||
| value: () => 'auto', | ||
| condition: { field: 'operation', value: 'resemble_intelligence' }, |
There was a problem hiding this comment.
structuredJson parameter has no corresponding UI control
intelligenceTool declares a structuredJson boolean param that controls whether the API returns structured JSON fields. Because no subBlock exists for it in the block definition, the value is always undefined in the UI, which causes the body builder to evaluate p.structuredJson !== false as true — permanently fixing it to structured mode. Users who need raw/unstructured output from the Intelligence operation cannot opt out from the block UI.
| while (true) { | ||
| const s = (rItem(last).status || '').toString().toLowerCase() | ||
| if (!s || TERMINAL.has(s)) return last |
There was a problem hiding this comment.
No-status response exits the poll loop immediately
if (!s || TERMINAL.has(s)) return last exits when status is absent. Some intermediate async responses (e.g., queued state before a status key is populated) would cause pollResource to return the still-incomplete payload without retrying. A separate guard like if (TERMINAL.has(s)) return last (and leaving the no-status case to either continue or throw) would be safer.
Four tools (detect / intelligence / watermark detect+apply) + a Resemble block. Bearer auth; async detection polls to completion. Registered in tool/block registries with a ResembleIcon.
c2e3d83 to
49299ad
Compare


Resemble Detect + Intelligence block
Adds a
Resembleblock + tool bundle for Resemble AI mediasafety: deepfake detection, media intelligence, and watermarking. Scope is
Detect + Intelligence only (no TTS / voice cloning).
What it adds
apps/sim/tools/resemble/— fourToolConfigs:resemble_detect,resemble_intelligence,resemble_watermark_detect,resemble_watermark_apply(+ sharedutils.ts,types.ts).apps/sim/blocks/blocks/resemble.ts— block with an operation dropdown and per-op inputs.tools/registry.tsandblocks/registry.ts;ResembleIconadded tocomponents/icons.tsx.Implementation
AuthMode.ApiKey), Bearer header. OptionalbaseUrloverride.transformResponsepolls/detect/{uuid}to completion(bounded by
maxWaitSeconds). Watermark usesPrefer: wait.Testing
The HTTP core (Bearer auth,
{success,item}envelope, submit→poll, watermark) mirrors aclient verified live against the Resemble API (detection, intelligence, watermark all green).