From 19b509d3b14bb20815be4aebd55a0588ad8e51a1 Mon Sep 17 00:00:00 2001 From: Kris Oei <87241105+KrisOei@users.noreply.github.com> Date: Wed, 30 Sep 2026 15:17:15 -0700 Subject: [PATCH 1/5] feat(search): forward optional agent task context --- skills/firecrawl-search/SKILL.md | 3 +++ src/__tests__/commands/search.test.ts | 21 +++++++++++++++++++++ src/commands/search.ts | 3 +++ src/index.ts | 9 +++++++++ src/types/search.ts | 6 ++++++ 5 files changed, 42 insertions(+) diff --git a/skills/firecrawl-search/SKILL.md b/skills/firecrawl-search/SKILL.md index 578badaa97..5819d76541 100644 --- a/skills/firecrawl-search/SKILL.md +++ b/skills/firecrawl-search/SKILL.md @@ -18,6 +18,9 @@ For structured records, filterable listings, transcripts, or datasets, first che # Basic search firecrawl search "your query" -o .firecrawl/result.json --json +# Optional task context, when known; reuse the same opaque ID only within one task +firecrawl search "React memo docs" --objective "Find official rerender guidance" --session-id task_123 --client-model claude-sonnet-4-6 --json + # Search and scrape full page content from results firecrawl search "your query" --scrape -o .firecrawl/scraped.json --json diff --git a/src/__tests__/commands/search.test.ts b/src/__tests__/commands/search.test.ts index 632e9d5384..d82a4e714c 100644 --- a/src/__tests__/commands/search.test.ts +++ b/src/__tests__/commands/search.test.ts @@ -120,6 +120,27 @@ describe('executeSearch', () => { ); }); + it('forwards optional task context with the search request', async () => { + mockHttpPost.mockResolvedValue(mockSearchResponse({ web: [] })); + + await executeSearch({ + query: 'React memo docs', + objective: 'Find official guidance on preventing unnecessary rerenders', + sessionId: 'task_123', + clientModel: 'claude-sonnet-4-6', + }); + + expect(mockHttpPost).toHaveBeenCalledWith( + '/v2/search', + expect.objectContaining({ + objective: + 'Find official guidance on preventing unnecessary rerenders', + sessionId: 'task_123', + clientModel: 'claude-sonnet-4-6', + }) + ); + }); + it('should pass apiUrl to getClient when provided', async () => { mockHttpPost.mockResolvedValue(mockSearchResponse({ web: [] })); diff --git a/src/commands/search.ts b/src/commands/search.ts index d3346864ec..807634b3a3 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -32,6 +32,9 @@ export async function executeSearch( limit: options.limit ?? DEFAULT_SEARCH_LIMIT, integration: 'cli', }; + if (options.objective) searchParams.objective = options.objective; + if (options.sessionId) searchParams.sessionId = options.sessionId; + if (options.clientModel) searchParams.clientModel = options.clientModel; searchParams.toolDetail = options.toolDetail ?? 'compact'; if (options.domainTools !== undefined) searchParams.domainTools = options.domainTools; diff --git a/src/index.ts b/src/index.ts index 99801e2f76..8836218098 100644 --- a/src/index.ts +++ b/src/index.ts @@ -925,6 +925,12 @@ function createSearchCommand(): Command { ) .argument('', 'Search query, or alexandria for semantic tool search') .argument('[tool-query]', 'Query for search alexandria') + .option('--objective ', 'Broader task goal behind this search') + .option('--session-id ', 'Opaque ID to link searches in one agent task') + .option( + '--client-model ', + 'Model issuing and consuming the results, if known' + ) .option( '--limit ', 'Maximum number of results (default: 5, max: 100)', @@ -1060,6 +1066,9 @@ function createSearchCommand(): Command { const searchOptions = { query, + objective: options.objective, + sessionId: options.sessionId, + clientModel: options.clientModel, toolDetail: options.toolDetail, domainTools: options.domainTools ?? diff --git a/src/types/search.ts b/src/types/search.ts index c8a094d65c..67829e5796 100644 --- a/src/types/search.ts +++ b/src/types/search.ts @@ -12,6 +12,12 @@ export interface SearchOptions { toolDetail?: 'compact' | 'summary' | 'full'; /** Search query (required) */ query: string; + /** Optional broader task goal for this search */ + objective?: string; + /** Opaque identifier shared by searches in the same agent task */ + sessionId?: string; + /** Model issuing and consuming this search, if known */ + clientModel?: string; /** API key for Firecrawl */ apiKey?: string; /** API URL for Firecrawl */ From cfe87184ac1264f8cb77bbd83490a0a3306e05dc Mon Sep 17 00:00:00 2001 From: Kris Oei <87241105+KrisOei@users.noreply.github.com> Date: Wed, 30 Sep 2026 15:27:10 -0700 Subject: [PATCH 2/5] test(search): cover omitted task context --- skills/firecrawl-search/SKILL.md | 2 +- src/__tests__/commands/search.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/skills/firecrawl-search/SKILL.md b/skills/firecrawl-search/SKILL.md index 5819d76541..3a6ac42a35 100644 --- a/skills/firecrawl-search/SKILL.md +++ b/skills/firecrawl-search/SKILL.md @@ -19,7 +19,7 @@ For structured records, filterable listings, transcripts, or datasets, first che firecrawl search "your query" -o .firecrawl/result.json --json # Optional task context, when known; reuse the same opaque ID only within one task -firecrawl search "React memo docs" --objective "Find official rerender guidance" --session-id task_123 --client-model claude-sonnet-4-6 --json +firecrawl search "React memo docs" --objective "Find official rerender guidance" --session-id task_123 --client-model claude-sonnet-4-6 -o .firecrawl/search-react-memo.json --json # Search and scrape full page content from results firecrawl search "your query" --scrape -o .firecrawl/scraped.json --json diff --git a/src/__tests__/commands/search.test.ts b/src/__tests__/commands/search.test.ts index d82a4e714c..86075455bf 100644 --- a/src/__tests__/commands/search.test.ts +++ b/src/__tests__/commands/search.test.ts @@ -101,6 +101,10 @@ describe('executeSearch', () => { integration: 'cli', toolDetail: 'compact', }); + const body = mockHttpPost.mock.calls[0][1]; + expect(body).not.toHaveProperty('objective'); + expect(body).not.toHaveProperty('sessionId'); + expect(body).not.toHaveProperty('clientModel'); }); it('should allow highlights to be disabled', async () => { From 37312335f5f5a75a35f8bc68f90989c8276e832e Mon Sep 17 00:00:00 2001 From: Kris Oei <87241105+KrisOei@users.noreply.github.com> Date: Thu, 1 Oct 2026 08:29:22 -0700 Subject: [PATCH 3/5] refactor(search): drop session ID flag --- skills/firecrawl-search/SKILL.md | 4 ++-- src/__tests__/commands/search.test.ts | 3 --- src/commands/search.ts | 1 - src/index.ts | 2 -- src/types/search.ts | 2 -- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/skills/firecrawl-search/SKILL.md b/skills/firecrawl-search/SKILL.md index 3a6ac42a35..e4c136dc6e 100644 --- a/skills/firecrawl-search/SKILL.md +++ b/skills/firecrawl-search/SKILL.md @@ -18,8 +18,8 @@ For structured records, filterable listings, transcripts, or datasets, first che # Basic search firecrawl search "your query" -o .firecrawl/result.json --json -# Optional task context, when known; reuse the same opaque ID only within one task -firecrawl search "React memo docs" --objective "Find official rerender guidance" --session-id task_123 --client-model claude-sonnet-4-6 -o .firecrawl/search-react-memo.json --json +# Optional task context, when known +firecrawl search "React memo docs" --objective "Find official rerender guidance" --client-model claude-sonnet-4-6 -o .firecrawl/search-react-memo.json --json # Search and scrape full page content from results firecrawl search "your query" --scrape -o .firecrawl/scraped.json --json diff --git a/src/__tests__/commands/search.test.ts b/src/__tests__/commands/search.test.ts index 86075455bf..246e102017 100644 --- a/src/__tests__/commands/search.test.ts +++ b/src/__tests__/commands/search.test.ts @@ -103,7 +103,6 @@ describe('executeSearch', () => { }); const body = mockHttpPost.mock.calls[0][1]; expect(body).not.toHaveProperty('objective'); - expect(body).not.toHaveProperty('sessionId'); expect(body).not.toHaveProperty('clientModel'); }); @@ -130,7 +129,6 @@ describe('executeSearch', () => { await executeSearch({ query: 'React memo docs', objective: 'Find official guidance on preventing unnecessary rerenders', - sessionId: 'task_123', clientModel: 'claude-sonnet-4-6', }); @@ -139,7 +137,6 @@ describe('executeSearch', () => { expect.objectContaining({ objective: 'Find official guidance on preventing unnecessary rerenders', - sessionId: 'task_123', clientModel: 'claude-sonnet-4-6', }) ); diff --git a/src/commands/search.ts b/src/commands/search.ts index 807634b3a3..d13436ce49 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -33,7 +33,6 @@ export async function executeSearch( integration: 'cli', }; if (options.objective) searchParams.objective = options.objective; - if (options.sessionId) searchParams.sessionId = options.sessionId; if (options.clientModel) searchParams.clientModel = options.clientModel; searchParams.toolDetail = options.toolDetail ?? 'compact'; if (options.domainTools !== undefined) diff --git a/src/index.ts b/src/index.ts index 8836218098..5b973d7805 100644 --- a/src/index.ts +++ b/src/index.ts @@ -926,7 +926,6 @@ function createSearchCommand(): Command { .argument('', 'Search query, or alexandria for semantic tool search') .argument('[tool-query]', 'Query for search alexandria') .option('--objective ', 'Broader task goal behind this search') - .option('--session-id ', 'Opaque ID to link searches in one agent task') .option( '--client-model ', 'Model issuing and consuming the results, if known' @@ -1067,7 +1066,6 @@ function createSearchCommand(): Command { const searchOptions = { query, objective: options.objective, - sessionId: options.sessionId, clientModel: options.clientModel, toolDetail: options.toolDetail, domainTools: diff --git a/src/types/search.ts b/src/types/search.ts index 67829e5796..ebf52aa5d8 100644 --- a/src/types/search.ts +++ b/src/types/search.ts @@ -14,8 +14,6 @@ export interface SearchOptions { query: string; /** Optional broader task goal for this search */ objective?: string; - /** Opaque identifier shared by searches in the same agent task */ - sessionId?: string; /** Model issuing and consuming this search, if known */ clientModel?: string; /** API key for Firecrawl */ From ee5e9c2c11a3bc636c42ebb0aba62c801b11239a Mon Sep 17 00:00:00 2001 From: Kris Oei <87241105+KrisOei@users.noreply.github.com> Date: Thu, 1 Oct 2026 09:03:49 -0700 Subject: [PATCH 4/5] refactor(search): drop model flag and skill example --- skills/firecrawl-search/SKILL.md | 3 --- src/__tests__/commands/search.test.ts | 3 --- src/commands/search.ts | 1 - src/index.ts | 5 ----- src/types/search.ts | 2 -- 5 files changed, 14 deletions(-) diff --git a/skills/firecrawl-search/SKILL.md b/skills/firecrawl-search/SKILL.md index e4c136dc6e..578badaa97 100644 --- a/skills/firecrawl-search/SKILL.md +++ b/skills/firecrawl-search/SKILL.md @@ -18,9 +18,6 @@ For structured records, filterable listings, transcripts, or datasets, first che # Basic search firecrawl search "your query" -o .firecrawl/result.json --json -# Optional task context, when known -firecrawl search "React memo docs" --objective "Find official rerender guidance" --client-model claude-sonnet-4-6 -o .firecrawl/search-react-memo.json --json - # Search and scrape full page content from results firecrawl search "your query" --scrape -o .firecrawl/scraped.json --json diff --git a/src/__tests__/commands/search.test.ts b/src/__tests__/commands/search.test.ts index 246e102017..89fc9a00be 100644 --- a/src/__tests__/commands/search.test.ts +++ b/src/__tests__/commands/search.test.ts @@ -103,7 +103,6 @@ describe('executeSearch', () => { }); const body = mockHttpPost.mock.calls[0][1]; expect(body).not.toHaveProperty('objective'); - expect(body).not.toHaveProperty('clientModel'); }); it('should allow highlights to be disabled', async () => { @@ -129,7 +128,6 @@ describe('executeSearch', () => { await executeSearch({ query: 'React memo docs', objective: 'Find official guidance on preventing unnecessary rerenders', - clientModel: 'claude-sonnet-4-6', }); expect(mockHttpPost).toHaveBeenCalledWith( @@ -137,7 +135,6 @@ describe('executeSearch', () => { expect.objectContaining({ objective: 'Find official guidance on preventing unnecessary rerenders', - clientModel: 'claude-sonnet-4-6', }) ); }); diff --git a/src/commands/search.ts b/src/commands/search.ts index d13436ce49..c1fc4eef9b 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -33,7 +33,6 @@ export async function executeSearch( integration: 'cli', }; if (options.objective) searchParams.objective = options.objective; - if (options.clientModel) searchParams.clientModel = options.clientModel; searchParams.toolDetail = options.toolDetail ?? 'compact'; if (options.domainTools !== undefined) searchParams.domainTools = options.domainTools; diff --git a/src/index.ts b/src/index.ts index 5b973d7805..cb2594efde 100644 --- a/src/index.ts +++ b/src/index.ts @@ -926,10 +926,6 @@ function createSearchCommand(): Command { .argument('', 'Search query, or alexandria for semantic tool search') .argument('[tool-query]', 'Query for search alexandria') .option('--objective ', 'Broader task goal behind this search') - .option( - '--client-model ', - 'Model issuing and consuming the results, if known' - ) .option( '--limit ', 'Maximum number of results (default: 5, max: 100)', @@ -1066,7 +1062,6 @@ function createSearchCommand(): Command { const searchOptions = { query, objective: options.objective, - clientModel: options.clientModel, toolDetail: options.toolDetail, domainTools: options.domainTools ?? diff --git a/src/types/search.ts b/src/types/search.ts index ebf52aa5d8..fce2605381 100644 --- a/src/types/search.ts +++ b/src/types/search.ts @@ -14,8 +14,6 @@ export interface SearchOptions { query: string; /** Optional broader task goal for this search */ objective?: string; - /** Model issuing and consuming this search, if known */ - clientModel?: string; /** API key for Firecrawl */ apiKey?: string; /** API URL for Firecrawl */ From 8e815e008b2e3d08d0d7846b11ffd88f58130c20 Mon Sep 17 00:00:00 2001 From: Kris Oei <87241105+KrisOei@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:20:00 -0700 Subject: [PATCH 5/5] feat(search): restore optional client model flag --- src/__tests__/commands/search.test.ts | 3 +++ src/commands/search.ts | 1 + src/index.ts | 5 +++++ src/types/search.ts | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/__tests__/commands/search.test.ts b/src/__tests__/commands/search.test.ts index 89fc9a00be..246e102017 100644 --- a/src/__tests__/commands/search.test.ts +++ b/src/__tests__/commands/search.test.ts @@ -103,6 +103,7 @@ describe('executeSearch', () => { }); const body = mockHttpPost.mock.calls[0][1]; expect(body).not.toHaveProperty('objective'); + expect(body).not.toHaveProperty('clientModel'); }); it('should allow highlights to be disabled', async () => { @@ -128,6 +129,7 @@ describe('executeSearch', () => { await executeSearch({ query: 'React memo docs', objective: 'Find official guidance on preventing unnecessary rerenders', + clientModel: 'claude-sonnet-4-6', }); expect(mockHttpPost).toHaveBeenCalledWith( @@ -135,6 +137,7 @@ describe('executeSearch', () => { expect.objectContaining({ objective: 'Find official guidance on preventing unnecessary rerenders', + clientModel: 'claude-sonnet-4-6', }) ); }); diff --git a/src/commands/search.ts b/src/commands/search.ts index c1fc4eef9b..d13436ce49 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -33,6 +33,7 @@ export async function executeSearch( integration: 'cli', }; if (options.objective) searchParams.objective = options.objective; + if (options.clientModel) searchParams.clientModel = options.clientModel; searchParams.toolDetail = options.toolDetail ?? 'compact'; if (options.domainTools !== undefined) searchParams.domainTools = options.domainTools; diff --git a/src/index.ts b/src/index.ts index cb2594efde..5b973d7805 100644 --- a/src/index.ts +++ b/src/index.ts @@ -926,6 +926,10 @@ function createSearchCommand(): Command { .argument('', 'Search query, or alexandria for semantic tool search') .argument('[tool-query]', 'Query for search alexandria') .option('--objective ', 'Broader task goal behind this search') + .option( + '--client-model ', + 'Model issuing and consuming the results, if known' + ) .option( '--limit ', 'Maximum number of results (default: 5, max: 100)', @@ -1062,6 +1066,7 @@ function createSearchCommand(): Command { const searchOptions = { query, objective: options.objective, + clientModel: options.clientModel, toolDetail: options.toolDetail, domainTools: options.domainTools ?? diff --git a/src/types/search.ts b/src/types/search.ts index fce2605381..ebf52aa5d8 100644 --- a/src/types/search.ts +++ b/src/types/search.ts @@ -14,6 +14,8 @@ export interface SearchOptions { query: string; /** Optional broader task goal for this search */ objective?: string; + /** Model issuing and consuming this search, if known */ + clientModel?: string; /** API key for Firecrawl */ apiKey?: string; /** API URL for Firecrawl */