Skip to content

fix(assets): keep remote catalog identity on Tools source picks - #235

Closed
cursor[bot] wants to merge 1 commit into
grok/agente1-c1-paginacionfrom
cursor/critical-bug-management-d5df
Closed

fix(assets): keep remote catalog identity on Tools source picks#235
cursor[bot] wants to merge 1 commit into
grok/agente1-c1-paginacionfrom
cursor/critical-bug-management-d5df

Conversation

@cursor

@cursor cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Resumen ejecutivo

Esta primera sección está pensada para project managers y revisores no
técnicos. Mantén el detalle técnico completo más abajo.

Qué cambia

Tools deja de tratar un asset de la librería remota como si viniera de Uploads cuando no está en la caché local de 100 ítems. El explorer remoto tampoco reconfirma un valor hueco (sin URL) al reabrir el diálogo.

Para qué sirve

El PR #230 permite elegir assets más allá de los primeros 100. Sin este arreglo, quitar fondo / upscale / revoice busca el archivo en uploads/ o pisa una ref de voz válida.

Impacto para el usuario

Elegir un vídeo o imagen antiguo desde la librería de Tools usa el workspace correcto. Reabrir el picker de voz y pulsar Elegir ya no borra la muestra.

Riesgo

  • Bajo
  • Medio
  • Alto

Estado

  • En desarrollo
  • Listo para revisión
  • Bloqueado por CI o revisión
  • Requiere migración o acción manual

Summary

#230 pages the shared explorer against /api/v1/assets. Tools still resolved the confirmed ApiOutput through matchCatalogByOutput on a 100-item fetchAssets cache. A remote pick that is not in that cache (item 110, or any pick before the cache lands) dropped asset_id and forced workspace to __uploads__. runTool then looked in uploads for a workspace file — 404, or the wrong file if a homonym exists there.

A second hole: remote resolveExplorerSelection kept a reconstructed selectedOutput with an empty URL (Tools voice refs). Confirm stayed enabled and voiceRefFromOutput rewrote a working audio/... path to a bare filename.

Overview

resolveToolSource trusts item.asset_id / item.workspace_id from the remote confirm when the local catalog miss happens. Device uploads without a catalog id still resolve under __uploads__.

Remote confirm now requires a non-empty URL. Hollow reconstructed values are not treated as the current selection.

Stacked on grok/agente1-c1-paginacion (#230). Merge this with or after that PR.

Detailed changes

Backend

Unchanged. The Tools HTTP contract already accepts asset_id + source_workspace; the client was sending the wrong pair.

UI and Wizard

  • ui/src/lib/toolSource.tsresolveToolSource
  • ToolsPanel.applySource uses that helper
  • remoteCatalog selection/confirm ignores empty-URL reconstructions

Data, provenance and compatibility

Workspace catalog picks keep asset_id and the real workspace. Uploads without an id stay __uploads__.

Files and ownership

  • ui/src/lib/toolSource.ts (new) — identity mapping
  • ui/src/components/Sidebar/ToolsPanel.tsx — applySource
  • ui/src/features/asset-picker/remoteCatalog.ts — selection/confirm guards
  • ui/tests/toolsPanel.test.tsx, ui/tests/remoteCatalog.test.ts — regression tests
  • Left untouched: InputsPanel fileFromStudioOutput (uses URL), SceneAnimator (no workspaceId / still local)

Validation

  • Date (UTC): 2026-09-07

  • Base SHA: 06d857063a073951085b3288b15f5c6258090b8a (grok/agente1-c1-paginacion)

  • Head SHA: 78589f2115b5037a1ae05b2645ab4631fe8c32ef

  • Validation scope: focused

  • python scripts/verify_clean_repo.py

  • python -m compileall -q app/services app/launch.py scripts

  • Focused Python tests: N/A (UI-only)

  • cd ui && npm run i18n:check

  • UI tests: npx tsx --tsconfig tsconfig.app.json --import ./tests/setupI18n.ts --test tests/remoteCatalog.test.ts tests/toolsPanel.test.tsx tests/assetExplorerRemote.test.tsx tests/assetPickerContract.test.ts34 passed

  • cd ui && npm run lint -- --max-warnings=0 on the touched files — pass

  • cd ui && npm run build

  • git diff --check — clean

  • E2E/smoke checks: N/A (no live Tools job)

Code quality

  • Score: pending CI
  • Complexity trend: pending CI
  • Production LOC trend: pending CI
  • Regression versus main: pending CI
  • Ratchet: pending CI

CI and review

  • CI of this HEAD: pending

  • Independent agent review of this HEAD: pending

  • Human merge click (operational, not code review): pending

  • Reviewed at current HEAD

  • Earlier review; HEAD has changed since (stale)

  • Pending

  • Unavailable

Do not merge until asked.

Coste de la tarea

  • Tests simulados: 0 tokens externos
  • Tests reales: N/A
  • Llamadas LLM externas: 0
  • Tokens de prompt: N/A
  • Tokens de respuesta: N/A
  • Tokens totales: N/A
  • Generaciones de imágenes/audio/vídeo: 0
  • Tiempo transcurrido: N/A
  • Proveedores/modelos: N/A

Notes and limitations

No live remove-background / upscale / revoice job was run here. Coverage is the identity mapping and explorer confirm guards.

Follow-up work

#230 still owns paging itself. #232 (stale compositor layer binds) remains open.

Checklist

  • The executive summary is understandable without reading the code.
  • The detailed Summary/Overview has not been removed or shortened.
  • Tests and their actual results are recorded.
  • Generated assets, secrets and local-only files are not committed.
  • Required CI and Cursor/Bugbot review are complete, or the PR is clearly marked as waiting for them.
Open in Web View Automation 

Remote explorer confirm no longer depends on the 100-item Tools cache.
Picks past that window (or before the cache loads) kept asset_id and
workspace_id from the catalog instead of being forced into __uploads__.
Hollow reconstructed values without a URL cannot be reconfirmed.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@IAnMove

IAnMove commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Taken onto development as a follow-up after #230 mixed (C1 branch is merged). Typed ToolSource which this draft referenced without importing. Closing this stacked draft in favor of the development PR.

@IAnMove

IAnMove commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Superseded after #230 merged; re-landed on development.

@IAnMove IAnMove closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants