What a code review from ByteDance's DeerFlow maintainers taught us NestDaddy opened pull request #8691 on 26 November to add its search index as an opt-in web_search provider for ByteDance's open-source DeerFlow deep research agent, which has 85,900 GitHub stars, and a DeerFlow maintainer returned four findings across three review rounds. The findings covered mismatched documentation tab labels, logging of upstream HTTP error bodies that could echo private agent queries, missing local validation of the API's two-character minimum query length, and tests that faked the whole HTTP client instead of using an offline httpx.MockTransport; NestDaddy rewrote its 25 tests at the transport layer and addressed every finding, with the pull request still under review. What a code review from ByteDance's DeerFlow maintainers taught us We added NestDaddy as a web search provider to ByteDance's open-source DeerFlow agent 85.9k stars . Three review rounds, four findings, four lessons for anyone building a search tool for AI agents. DeerFlow is ByteDance's open-source deep research agent. It plans a research task, searches the web, reads sources and writes a report. With 85,900 stars on GitHub , it is one of the most used agent projects in the world. DeerFlow lets operators choose their web search backend from a list of community providers. On 26 November we opened pull request 8691 https://github.com/bytedance/deer-flow/pull/8691 to add NestDaddy as one more option: an opt-in provider, configured like the other keyed providers, that sends research agents to our own search index, with fresh news blended in for current topics. Big open-source projects do not merge code because it works on your laptop. Every line gets reviewed. Over three rounds, a DeerFlow maintainer left four findings on our code. Each one was small, and each one was right. Here is what they taught us. 1. Docs are part of the code The first finding was in the documentation, not the Python. The tab labels on the providers page listed NestDaddy before another provider, while the panels underneath were in the opposite order. Click one tab, read the wrong setup. Lesson: a reviewer reads your docs the way a new user does. If the page and the code disagree, the page is the bug. We matched the label order to the panels. 2. Never write a provider's raw error into your logs Our first version logged the upstream HTTP response body when a request failed. That looks helpful while debugging. It is a leak in production: a search API's error body can echo the query, and a research agent's queries can contain private material from the user's task. Lesson: log the HTTP status or the exception class, never the body or the exception text. We changed every log line to carry only that, and added tests that fail if the body or a private detail ever reaches the log. 3. Validate what you already know will fail The NestDaddy API needs a query of at least two characters. Our tool trimmed the query and sent it anyway, so a one-character query cost a network round trip just to get an error back. Lesson: if the rule is known, enforce it before the call. The tool now rejects empty and one-character queries locally, with a clear message the agent can act on, and makes no HTTP request at all. It counts characters, not bytes, so a two-character Chinese query such as 字节 still goes through. 4. Test at the transport, not the client The last finding was about our tests. We had replaced the whole HTTP client with a fake. That checked the arguments we passed, but not what actually goes over the wire, so a bug in URL encoding or headers would have slipped through. DeerFlow's contributor guidance asks for the test double one layer lower: keep the real httpx client and give it an offline httpx.MockTransport . We rewrote the 25 tests that way. Now the real client builds the URL, percent-encodes the Unicode query q=%E5%AD%97%E8%8A%82 , sets the X-API-Key header and decodes the JSON, all without touching the network. Lesson: mock as close to the wire as you can. The closer the fake, the more real code your tests run. Why we do this NestDaddy runs its own crawler and its own search index, built for AI agents. Agents do not care about logos. They care about clean JSON, fresh results and a tool that fails safely. The best way to prove that is to put our code in front of the people who maintain the agents developers already use, and let them review it line by line. NestDaddy is already listed in LangChain's docs, the Dify Marketplace, WordPress.org and the official MCP Registry, and ships as an n8n community node. The DeerFlow pull request is still under review, with every finding addressed so far. You can follow it here: bytedance/deer-flow 8691 https://github.com/bytedance/deer-flow/pull/8691 . If you are building a research agent and want live web search and news from an index of its own, start with the Search & News API https://nestdaddy.com/serp-api .