freehire-search: lean search uses the web endpoint; drop unread params (#631)

semantic_ratio and include_description are both reported in
meta.ignored_params. With include_description ignored, the agent endpoint
hydrates every full body from the database, and --no-description threw
that payload away client-side. Send --no-description to /api/v1/jobs/search,
which serves only the preview, and stop sending the two unread params.
This commit is contained in:
Ilya Strelov authored and GitHub committed 2026-10-18 21:38:40 +02:00
1 parent ce9b656829
commit 0f6480d32e
6 files changed
+31 -27

No files matched your search

@@ -108,8 +108,10 @@ describe("runSearch (mocked fetch)", () => {
await runSearch({ ...searchOpts, query: "backend" });
expect(new URL(mock.url()).pathname).toBe("/api/v1/agent/jobs/search");
expect(requestedParams(mock).get("include_description")).toBe("true");
expect(requestedParams(mock).get("description_format")).toBe("markdown");
// Neither is read by the API (it lists both in meta.ignored_params).
expect(requestedParams(mock).get("include_description")).toBeNull();
expect(requestedParams(mock).get("semantic_ratio")).toBeNull();
});
test("skips description hydration when includeDescription is false", async () => {
@@ -122,10 +124,11 @@ describe("runSearch (mocked fetch)", () => {
const out = captureStdout();
await runSearch({ ...searchOpts, query: "backend", includeDescription: false });
expect(requestedParams(mock).get("include_description")).toBe("false");
// The agent endpoint hydrates every body regardless of what it is asked, so
// the lean pass goes to the web search, which serves only the preview.
expect(new URL(mock.url()).pathname).toBe("/api/v1/jobs/search");
expect(requestedParams(mock).get("description_format")).toBeNull();
// The live API ignores include_description=false and sends bodies anyway
// (verified 2026-08-19), so the lean guarantee is enforced client-side.
// The preview is still a description, so the lean guarantee is enforced client-side.
const parsed = JSON.parse(out.get());
expect(parsed.results[0].description).toBeNull();
});