Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/__tests__/commands/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,24 @@ describe('executeSearch', () => {
);
});

it('forwards optional task context with the search request', async () => {
it('ignores legacy search task context', async () => {
mockHttpPost.mockResolvedValue(mockSearchResponse({ web: [] }));

await executeSearch({
const options = {
query: 'React memo docs',
objective: 'Find official guidance on preventing unnecessary rerenders',
clientModel: 'claude-sonnet-4-6',
});
};
await executeSearch(options);

expect(mockHttpPost).toHaveBeenCalledWith(
'/v2/search',
expect.objectContaining({
objective:
'Find official guidance on preventing unnecessary rerenders',
clientModel: 'claude-sonnet-4-6',
query: 'React memo docs',
})
);
expect(mockHttpPost.mock.calls[0][1]).not.toHaveProperty('objective');
expect(mockHttpPost.mock.calls[0][1]).not.toHaveProperty('clientModel');
});

it('should pass apiUrl to getClient when provided', async () => {
Expand Down
2 changes: 0 additions & 2 deletions src/commands/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export async function executeSearch(
limit: options.limit ?? DEFAULT_SEARCH_LIMIT,
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;
Expand Down
9 changes: 2 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,8 @@ function createSearchCommand(): Command {
)
.argument('<query>', 'Search query, or alexandria for semantic tool search')
.argument('[tool-query]', 'Query for search alexandria')
.option('--objective <goal>', 'Broader task goal behind this search')
.option(
'--client-model <model>',
'Model issuing and consuming the results, if known'
)
.addOption(new Option('--objective <goal>').hideHelp())
.addOption(new Option('--client-model <model>').hideHelp())
.option(
'--limit <number>',
'Maximum number of results (default: 5, max: 100)',
Expand Down Expand Up @@ -1066,8 +1063,6 @@ function createSearchCommand(): Command {

const searchOptions = {
query,
objective: options.objective,
clientModel: options.clientModel,
toolDetail: options.toolDetail,
domainTools:
options.domainTools ??
Expand Down
4 changes: 0 additions & 4 deletions src/types/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export interface SearchOptions {
toolDetail?: 'compact' | 'summary' | 'full';
/** Search query (required) */
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 */
Expand Down
Loading