← Back to PRs

#8707: fix(web_search): honor configured provider at execution timeFix/web search provider

by codvik open 2026-02-04 09:18 View on GitHub →
channel: telegram agents stale
## Summary - Resolve `web_search` provider and enablement at execution time so config changes are honored - Add regression test covering dynamic disable behavior - Align Telegram token-override account inference with the same token source used by `resolveTelegramAccount` ## Testing - `pnpm exec vitest src/agents/tools/web-tools.enabled-defaults.test.ts` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the `web_search` tool so it resolves the configured provider at execution time (rather than at tool creation), ensuring late-bound config updates take effect. It also adds a regression test covering dynamic provider changes, plus tweaks to Telegram monitoring to infer `accountId` from a token override and corresponding tests. Overall the changes are small and consistent with existing patterns (config resolution helpers, vitest mocks). The main remaining edge is that only the provider (and Telegram account inference) is made dynamic, while some related decisions (e.g., tool enablement) are still evaluated at creation time, which may surprise callers who expect fully dynamic behavior. <h3>Confidence Score: 4/5</h3> - This PR is largely safe to merge and should fix the reported provider-resolution issue with low functional risk. - Changes are localized and covered by new regression tests; noted issues are mostly about consistency/edge-case behavior (dynamic config vs creation-time decisions, token matching nuances) rather than likely runtime failures. - src/agents/tools/web-search.ts and src/telegram/monitor.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs