Skip to content

Fall back across job sources when one can't answer - #27

Closed
rahulrathore95 wants to merge 1 commit into
AienTech:mainfrom
rahulrathore95:feat/source-fallback
Closed

rahulrathore95 wants to merge 1 commit into
AienTech:mainfrom
rahulrathore95:feat/source-fallback

Conversation

@rahulrathore95

Copy link
Copy Markdown

Summary

Split out of #22 per your request. One change: searchWithFallback() in find.ts tries the source chosen in Settings first, then every other source with a key saved (each keeps its own key, independently of which is "chosen"), in case the first is out of quota, down, or doesn't cover the query's country — instead of the whole search just failing.

A source with no key configured is skipped silently rather than counted as a failed attempt, so with only one source set up (the common case) the error message is unchanged from before this existed. A kept search's "Show more" always stays pinned to the exact source it started with, since its pagination cursor only means something there.

Shared by askSource (Find jobs, search_jobs) and the job agent's search step, which additionally excludes the Bundesagentur für Arbeit from its own fallback chain (it never searches that source unattended, #223).

Test plan

  • yarn typecheck, yarn lint, yarn test (full suite): 1685 passed, 0 failures.
  • New tests in posting-searches.db.test.ts: falls back to the next configured source on quota, names every source when all fail, unchanged behavior with a single source configured, and "Show more" staying pinned to its original source.

🤖 Generated with Claude Code

searchWithFallback() in find.ts tries the source chosen in Settings
first, then every other source with a key saved (each keeps its own
key, independently of which is "chosen"), in case the first is out
of quota, down, or doesn't cover the query's country - instead of
the whole search just failing.

A source with no key configured is skipped silently rather than
counted as a failed attempt, so with only one source set up (the
common case) the error message is unchanged from before this
existed. A kept search's "Show more" always stays pinned to the
exact source it started with, since its pagination cursor only
means something there.

Shared by askSource (Find jobs, search_jobs) and the job agent's
search step, which additionally excludes the Bundesagentur für
Arbeit from its own fallback chain (it never searches that source
unattended, #223).

Verified: yarn typecheck, yarn lint and yarn test (full suite) all
pass, 1685 tests, 0 failures.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rahulrathore95

Copy link
Copy Markdown
Author

Closing this — I'm going to keep this work on my own fork instead of submitting it back upstream. Thanks for the earlier feedback on splitting it up.

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