Add GET /enhance/prompts (recent Enhance prompts) #199

Merged
cameron merged 1 commits from feat/enhance-recent-prompts into master 2026-10-31 17:17:28 +00:00
Owner

Adds GET /enhance/prompts?templates=a,b&limit=10 so the app can offer earlier Enhance prompts again for a series of similar photos.

  • Response: {"prompts": [{"prompt","template","last_used","uses"}]}; distinct prompts (trimmed), newest use first. template and last_used come from the newest job; uses counts all jobs. Empty/null prompts are excluded; discarded and failed jobs still count.
  • templates is optional (unknown names match nothing; omitted or empty = all). limit defaults to 10, clamped 1..50.
  • One GROUP BY query in EnhanceJobDao::recent_prompts (inside trace_db_call). No new index or migration; the table is small and this is a scan.
  • Bearer auth, not library-scoped, DB only: works with ComfyUI down and, like /enhance/jobs, answers 200 (from existing rows) when Enhance is off.
  • Tests: DAO unit test and endpoint tests. CLAUDE.md endpoint list updated.

🤖 Generated with Claude Code

Adds `GET /enhance/prompts?templates=a,b&limit=10` so the app can offer earlier Enhance prompts again for a series of similar photos. - Response: `{"prompts": [{"prompt","template","last_used","uses"}]}`; distinct prompts (trimmed), newest use first. `template` and `last_used` come from the newest job; `uses` counts all jobs. Empty/null prompts are excluded; discarded and failed jobs still count. - `templates` is optional (unknown names match nothing; omitted or empty = all). `limit` defaults to 10, clamped 1..50. - One `GROUP BY` query in `EnhanceJobDao::recent_prompts` (inside `trace_db_call`). No new index or migration; the table is small and this is a scan. - Bearer auth, not library-scoped, DB only: works with ComfyUI down and, like `/enhance/jobs`, answers 200 (from existing rows) when Enhance is off. - Tests: DAO unit test and endpoint tests. CLAUDE.md endpoint list updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cameron added 1 commit 2026-10-31 16:43:37 +00:00
cameron merged commit 9f013d7b78 into master 2026-10-31 17:17:28 +00:00
cameron deleted branch feat/enhance-recent-prompts 2026-10-31 17:17:29 +00:00
Sign in to join this conversation.