Skip to content

fix(worker): pass the OS-detected app to backfilled captures - #22

Merged
ayushh0110 merged 1 commit into
ayushh0110:mainfrom
Venopacman:fix/backfill-app-hint
Oct 14, 2026
Merged

ayushh0110 merged 1 commit into
ayushh0110:mainfrom
Venopacman:fix/backfill-app-hint

Conversation

@Venopacman

Copy link
Copy Markdown
Contributor

Problem

_backfill_skipped() builds the CaptureResult from the app_name column. The rows it picks up were never analyzed, so app_name is NULL. The analyzer then has no OS hint and falls back to title parsing or Gemma's guess. Example: a Chrome tab was saved as ScreenMind.

Fix

One line: select COALESCE(detected_app, app_name).

Testing

New TestAnalysisWorkerBackfill inserts a pending row with detected_app_name="Telegram", runs _backfill_skipped() with _process mocked, and checks the hint. It fails on main (assert None == 'Telegram') and passes with the fix.

🤖 Generated with Claude Code

_backfill_skipped() read the app_name column to build the CaptureResult.
Rows it picks up were never analyzed, so app_name is NULL and the
analyzer got no OS hint. The final app name then fell back to title
parsing or Gemma's visual guess (e.g. a Chrome tab became "ScreenMind").

Read detected_app first and fall back to app_name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Venopacman
Venopacman marked this pull request as ready for review October 6, 2026 09:40
@ayushh0110

Copy link
Copy Markdown
Owner

hi @Venopacman thanks for the contribution

COALESCE is overkill though. This query only hits rows with status IN ('pending', 'skipped', 'failed') — these are rows where analysis never ran (or failed), so app_name is always NULL. The COALESCE fallback to app_name can never trigger. Just SELECT ... detected_app ... directly — that's the column CaptureWorker writes the OS hint to at capture time, and it's exactly what _normalize() expects as app_name_hint at L2.

@ayushh0110
ayushh0110 merged commit 5ed6650 into ayushh0110:main Oct 14, 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