feat: trace hosted web search in Langfuse - #318
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80d3a64f95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function usesHostedWebSearch(tools?: OpenAIClient.Responses.Tool[]): boolean { | ||
| return ( | ||
| tools?.some( | ||
| (tool) => tool.type === 'web_search' || tool.type === 'web_search_preview' |
There was a problem hiding this comment.
Include versioned hosted web-search tools
With the current Responses API, hosted web search tools can also be sent as web_search_2025_08_26, not just web_search/web_search_preview (OpenAI API reference). In that case this predicate returns false, so invocationParams never adds web_search_call.action.sources and the Langfuse tool observation records no sources even though the call used hosted web search. Include the versioned hosted web-search tool type here.
Useful? React with 👍 / 👎.
Summary
web_search_call.action.sourcesfor OpenAI and Azure Responses calls using hosted web searchweb_search_callas one child LangfusetoolobservationThis is independent from #317. It does not change web-search routing or execute an additional search.
Verification
npm test -- --runInBand src/llm/openai/llm.spec.ts src/llm/openai/contentBlocks.test.ts src/specs/langfuse-callbacks.test.ts(71 passed)npm run build