Skip to content

feat(api): preprocess-images task endpoints (BE-3 part 3a)#484

Merged
Zheaoli merged 1 commit into
mainfrom
feat/preprocess-task-endpoints
May 30, 2026
Merged

feat(api): preprocess-images task endpoints (BE-3 part 3a)#484
Zheaoli merged 1 commit into
mainfrom
feat/preprocess-task-endpoints

Conversation

@Zheaoli

@Zheaoli Zheaoli commented May 30, 2026

Copy link
Copy Markdown
Collaborator

BE-3 part 3a — preprocess task API endpoints

Exposes the variant preprocessing queue engine (merged in #481) over the protected /api/v1/preprocess-tasks routes, mirroring the existing /api/v1/tasks (metadata) endpoints:

GET /preview-count, GET /runs, GET /runs/:id, POST /runs (create), POST /runs/:id/kick, POST /runs/:id/cancel, POST /tick.

  • Delegates to server/tasks/image-preprocess-service.ts.
  • Scope carries the force flag (normalizePreprocessTaskScope).
  • Maps service errors to 4xx: "Variant storage backend is not configured" / "Another preprocess task is already active" → 400/409 / "No images matched" → 400.
  • Mounted under the v1 (session-protected) group alongside tasks.

This is the drivable API that BE-3 part 3b (the /admin/tasks button) and part 3c (the preprocess:backfill CLI) will use to create + drain a backfill run, and it's what enables the real end-to-end backfill test once variant_storage is set (#483).

Verification

tsc --noEmit + eslint clean. Pure additive mirror of the reviewed hono/tasks.ts pattern.

🤖 Generated with Claude Code

Expose the variant preprocessing queue (the engine from #481) over the
protected /api/v1/preprocess-tasks routes, mirroring /api/v1/tasks:
preview-count, runs, runs/:id, runs (create), runs/:id/kick, runs/:id/cancel,
tick. Delegates to image-preprocess-service.ts; scope carries the `force`
flag; surfaces "not configured" / "already active" / "no images" as 4xx.

This is the drivable API the admin /tasks button and the CLI backfill
(following) use to create and drain a backfill run; it also enables the
real end-to-end backfill test once variant_storage is configured (#483).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
picimpact Ready Ready Preview, Comment May 30, 2026 12:11pm

@Zheaoli Zheaoli merged commit 56032a4 into main May 30, 2026
6 checks passed
@Zheaoli Zheaoli deleted the feat/preprocess-task-endpoints branch May 30, 2026 12:19
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.

1 participant