CodeWhale icon indicating copy to clipboard operation
CodeWhale copied to clipboard

Support custom URL for search provider

Open Artenx opened this issue 6 months ago • 3 comments

I have my own private search api, but cann't use it in codew now , the predefined provider is unavailabled.

Artenx avatar May 31 '26 12:05 Artenx

Thanks @Artenx — this is a reasonable gap. The current search config is still built around named providers, so a private/internal search API cannot be wired in cleanly yet. I am leaving this open as a focused enhancement for a custom search endpoint option.

The design question I would want to settle before implementing is the expected wire shape: whether the private API should look like one of the existing providers, an OpenAI-style tool endpoint, or a small CodeWhale-specific request/response contract. If you can share the rough request/response format your private API expects, that would make the implementation much easier to land without guessing.

Hmbown avatar May 31 '26 20:05 Hmbown

Thanks @Artenx — this is a reasonable gap. The current search config is still built around named providers, so a private/internal search API cannot be wired in cleanly yet. I am leaving this open as a focused enhancement for a custom search endpoint option.

The design question I would want to settle before implementing is the expected wire shape: whether the private API should look like one of the existing providers, an OpenAI-style tool endpoint, or a small CodeWhale-specific request/response contract. If you can share the rough request/response format your private API expects, that would make the implementation much easier to land without guessing.

Thank you so much! The private search API looks like those from existing providers. In my case, it’s a DDG‑style endpoint, with only the URL using my own domain.

Artenx avatar Jun 01 '26 01:06 Artenx

Fixed by the v0.9 integration harvest in #2767 (8cbdf95af), based on #2510.

CodeWhale now supports a DuckDuckGo-compatible private search endpoint through [search].base_url, preferred CODEWHALE_SEARCH_BASE_URL, and legacy DEEPSEEK_SEARCH_BASE_URL. The implementation applies network policy to the configured endpoint host, disables public Bing fallback when a custom endpoint is set, reports the configured host as the result source, and returns clear errors when base_url is paired with a non-DuckDuckGo provider or when the configured endpoint returns a challenge page.

Verification on the harvest included custom_duckduckgo, search_base_url, and search_provider focused tests, plus cargo check, clippy with -D warnings, format, diff, version, and co-author credit checks.

Thanks @Artenx for the report and for clarifying the DDG-style endpoint shape, and thanks @cyq1017 for the implementation in #2510. Please retest on the next v0.9 build and reopen if your private API needs a different request/response shape than DuckDuckGo-compatible HTML.

Hmbown avatar Jun 05 '26 02:06 Hmbown