From 5b4c7b61292b261cda58c9983bd9976a84ee9f66 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 18 Nov 2026 10:15:44 -0800 Subject: [PATCH 1/3] fix(integrations): validate ashby --- apps/sim/tools/ashby/ashby.test.ts | 13 +++++++++++++ apps/sim/tools/ashby/get_job.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/sim/tools/ashby/ashby.test.ts b/apps/sim/tools/ashby/ashby.test.ts index e46da7cc0cc..4842a5dc725 100644 --- a/apps/sim/tools/ashby/ashby.test.ts +++ b/apps/sim/tools/ashby/ashby.test.ts @@ -6,6 +6,7 @@ import { changeApplicationStageTool } from '@/tools/ashby/change_application_sta import { deleteApplicationTool } from '@/tools/ashby/delete_application' import { getApplicationTool } from '@/tools/ashby/get_application' import { getCandidateTool } from '@/tools/ashby/get_candidate' +import { getJobTool } from '@/tools/ashby/get_job' import { getJobPostingTool } from '@/tools/ashby/get_job_posting' import { listApplicationsTool } from '@/tools/ashby/list_applications' import { listCandidatesTool } from '@/tools/ashby/list_candidates' @@ -263,6 +264,18 @@ describe('ashby request bodies', () => { expect(body).not.toHaveProperty('includeUnpublishedJobPostingsIds') }) + it('get_job sends the job.info spelling of the unpublished posting IDs flag', () => { + // job.info rejects unknown keys (additionalProperties: false), so the + // singular `includeUnpublishedJobPostingIds` never reached Ashby as intended. + const body = requestBody(getJobTool, { + apiKey: 'k', + jobId: ' j ', + includeUnpublishedJobPostingIds: true, + }) + expect(body).toMatchObject({ id: 'j', includeUnpublishedJobPostingsIds: true }) + expect(body).not.toHaveProperty('includeUnpublishedJobPostingIds') + }) + it('change_application_source sends sourceId when one is provided', () => { // Ashby requires the key to be present; omitting it is a 400 rather than // the intended write. diff --git a/apps/sim/tools/ashby/get_job.ts b/apps/sim/tools/ashby/get_job.ts index 3a0454c1931..1d907f9eae7 100644 --- a/apps/sim/tools/ashby/get_job.ts +++ b/apps/sim/tools/ashby/get_job.ts @@ -39,7 +39,7 @@ export const getJobTool: ToolConfig = { id: params.jobId.trim(), expand: ['openings', 'location', 'compensation'], ...(params.includeUnpublishedJobPostingIds !== undefined - ? { includeUnpublishedJobPostingIds: params.includeUnpublishedJobPostingIds } + ? { includeUnpublishedJobPostingsIds: params.includeUnpublishedJobPostingIds } : {}), }), }, From 56acc4c494801c5d2cbcee5f24b98c5a3e0dc889 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 18 Nov 2026 10:20:03 -0800 Subject: [PATCH 2/3] fix(integrations): type the ashby test helpers against the tool's own params --- apps/sim/tools/ashby/ashby.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/tools/ashby/ashby.test.ts b/apps/sim/tools/ashby/ashby.test.ts index 4842a5dc725..d99d6a214ed 100644 --- a/apps/sim/tools/ashby/ashby.test.ts +++ b/apps/sim/tools/ashby/ashby.test.ts @@ -26,12 +26,12 @@ import type { ToolConfig } from '@/tools/types' const respond = (body: unknown) => new Response(JSON.stringify(body), { status: 200 }) -function requestBody(tool: ToolConfig, params: unknown): Record { +function requestBody(tool: ToolConfig, params: unknown): Record { const build = tool.request?.body as (p: unknown) => Record return build(params) } -async function transform(tool: ToolConfig, body: unknown) { +async function transform(tool: ToolConfig, body: unknown) { const run = tool.transformResponse as (r: Response) => Promise<{ output: Record }> return run(respond(body)) } From 268cdc096b2181e8205b4cc110fa2790c7628f5c Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 18 Nov 2026 11:42:25 -0800 Subject: [PATCH 3/3] fix(integrations): send ashby get_job's flag only when it is a boolean and shrink the test-types baseline --- apps/sim/tools/ashby/ashby.test.ts | 17 ++++++++++++++--- apps/sim/tools/ashby/get_job.ts | 2 +- scripts/check-test-types.baseline.json | 3 +-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/sim/tools/ashby/ashby.test.ts b/apps/sim/tools/ashby/ashby.test.ts index d99d6a214ed..ac16621988f 100644 --- a/apps/sim/tools/ashby/ashby.test.ts +++ b/apps/sim/tools/ashby/ashby.test.ts @@ -22,16 +22,18 @@ import { setCustomFieldValuesTool } from '@/tools/ashby/set_custom_field_values' import { transferApplicationTool } from '@/tools/ashby/transfer_application' import { updateCandidateTool } from '@/tools/ashby/update_candidate' import { ashbyAuthHeaders } from '@/tools/ashby/utils' -import type { ToolConfig } from '@/tools/types' const respond = (body: unknown) => new Response(JSON.stringify(body), { status: 200 }) -function requestBody(tool: ToolConfig, params: unknown): Record { +function requestBody( + tool: { request?: { body?: unknown } }, + params: unknown +): Record { const build = tool.request?.body as (p: unknown) => Record return build(params) } -async function transform(tool: ToolConfig, body: unknown) { +async function transform(tool: { transformResponse?: unknown }, body: unknown) { const run = tool.transformResponse as (r: Response) => Promise<{ output: Record }> return run(respond(body)) } @@ -274,6 +276,15 @@ describe('ashby request bodies', () => { }) expect(body).toMatchObject({ id: 'j', includeUnpublishedJobPostingsIds: true }) expect(body).not.toHaveProperty('includeUnpublishedJobPostingIds') + for (const untouched of [null, '']) { + expect( + requestBody(getJobTool, { + apiKey: 'k', + jobId: 'j', + includeUnpublishedJobPostingIds: untouched, + }) + ).toEqual({ id: 'j', expand: ['openings', 'location', 'compensation'] }) + } }) it('change_application_source sends sourceId when one is provided', () => { diff --git a/apps/sim/tools/ashby/get_job.ts b/apps/sim/tools/ashby/get_job.ts index 1d907f9eae7..b30bc21d236 100644 --- a/apps/sim/tools/ashby/get_job.ts +++ b/apps/sim/tools/ashby/get_job.ts @@ -38,7 +38,7 @@ export const getJobTool: ToolConfig = { body: (params) => ({ id: params.jobId.trim(), expand: ['openings', 'location', 'compensation'], - ...(params.includeUnpublishedJobPostingIds !== undefined + ...(typeof params.includeUnpublishedJobPostingIds === 'boolean' ? { includeUnpublishedJobPostingsIds: params.includeUnpublishedJobPostingIds } : {}), }), diff --git a/scripts/check-test-types.baseline.json b/scripts/check-test-types.baseline.json index 1cb383e238b..da9f1aff787 100644 --- a/scripts/check-test-types.baseline.json +++ b/scripts/check-test-types.baseline.json @@ -2574,8 +2574,7 @@ "TS2345": 25 }, "apps/sim/tools/ashby/ashby.test.ts": { - "TS2339": 3, - "TS2345": 50 + "TS2339": 3 }, "apps/sim/tools/assistant-execution.test.ts": { "TS2554": 2