2026-07-04 OpenRouter Interceptor Queries UX Features
What I set out to do
Add three UX features to the openrouter-interceptor Firefox extension’s sidebar: (1) a per-analysis model dropdown in the Custom Analysis modal, (2) a reload button on query cards to resend an analysis in place, and (3) character images on Network and Query cards.
What I actually did
Ran the full Superpowers flow: brainstorm → spec → plan → subagent-driven execution. Spec and plan committed under docs/superpowers/. Execution used a fresh implementer subagent per task with a two-verdict review (spec + quality) and fix loops, then a final whole-branch review, across 7 tasks / 9 commits.
Shipped:
- Shared
openrouter-modelsutil — fetch + price-sort +storage.localcache; the options page was refactored to reuse it (killed the duplicated inline fetch/sort/label logic). - Model dropdown in the Custom Analysis modal — one-off override that never rewrites the saved default.
REANALYZE_QUERYbackground handler — re-runs a stored query in place (same id), reproducing its persistedcustomPrompt, optionally on a different model; errors cleanly when the original capture was evicted (100-FIFO). Extracted sharedbuildAnalysisPrompt/runAnalysishelpers so it can’t drift fromANALYZE_CAPTURE.getCaptureAvatarutil + avatar→favicon→placeholder thumbnails on both card types.
Merged to main (fast-forward). typecheck + build + 340 Vitest unit tests green. The two added Playwright assertions are browser-based and still need a run in the real Firefox dev profile.
What was striking
The review layers each caught a real bug the plan’s own reference code carried:
- Response race in
REANALYZE_QUERY— returning the livequeryobject while fire-and-forgetrunAnalysismutatedquery.status; the caller could seecompletedinstead ofpending. Fixed by snapshotting{ ...query }.ANALYZE_CAPTUREwas safe because it callssendResponsesynchronously first. - Lit
.value-on-<select>desync — Lit commits the parent.valuebefore option children exist, so the dropdown could display a different model than state, and clicking the already-highlighted option fires nochange. Fixed with per-option?selectedbinding. - Missing reload cooldown — the final review flagged that reload had no debounce (unlike analyze), so rapid clicks meant multiple billed OpenRouter calls + leaked poll intervals. Fixed by reusing the existing 2s cooldown and disabling Reload while pending.
Good reminder that “the plan has complete code” doesn’t mean the code is correct — the adversarial review passes earn their keep.
Top 3 tomorrow
- Run
npm test(Playwright) in the Firefox dev profile to exercise the two new visual assertions. - Manually sanity-check the reload flow end-to-end against a live capture (model switch + evicted-capture error toast).
- Consider a one-line test for the untested
REANALYZE_QUERY“no system prompt in capture” branch.
Related
Extension project (no vault project note yet). Related prior OpenRouter work is the homelab LLM proxy, which is a separate effort.