Skip to content

Commit ce9b656

Browse files
authored
freehire-search: identify this project in the User-Agent (#633)
The old value linked to freehire.me, which named the API rather than the caller, so the API's operators could not reach this project before a limit or field change. Use the owner/project form freehire's API docs ask for, with this repo as the contact URL.
1 parent 30158c0 commit ce9b656

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎.agents/skills/freehire-search/cli/src/helpers.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export function writeError(error: string, code: string): void {
1616
process.stderr.write(JSON.stringify({ error, code }) + "\n")
1717
}
1818

19-
const UA = "freehire-search-skill/1.0 (+https://freehire.me)"
19+
// Names this project, the shape freehire's API docs ask for (owner/project/version
20+
// plus a contact URL), so the API's operators can reach the maintainer before a
21+
// limit or a field changes. The old value linked to freehire.me itself, which
22+
// identified the API, not the caller.
23+
const UA = "MadsLorentzen/ai-job-search/1.0 (+https://github.com/MadsLorentzen/ai-job-search; freehire-search)"
2024

2125
/** The shared API response envelope: {data, meta, error}. */
2226
export interface Envelope<T> {

‎.agents/skills/freehire-search/url-reference.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ points users to (`?q=<role>` scopes the counts). Example:
138138
serves HTML, which `cleanHtml` (`cli/src/helpers.ts`) strips into readable text.
139139
Search descriptions arrive already rendered by the API and are passed through
140140
verbatim — stripping them again would undo the Markdown structure.
141-
- Fetch uses a browser-ish User-Agent, `Accept: application/json`, and exponential
142-
backoff with jitter on 429/5xx (max 6 retries). A connection error (API
141+
- Fetch sends `User-Agent: MadsLorentzen/ai-job-search/1.0 (+https://github.com/MadsLorentzen/ai-job-search; freehire-search)`
142+
and `Accept: application/json`, and uses exponential backoff with jitter on 429/5xx (max 6 retries). A connection error (API
143143
unreachable) fails fast with a clear message — no retry, since it is not
144144
transient server load — which is the graceful-degradation contract: an outage
145145
degrades this source quickly instead of hanging the caller.

0 commit comments

Comments
 (0)