Repository navigation
feat(*): add deepseek as a web search and fetch provider - #1125
Conversation
gloryfromca
left a comment
There was a problem hiding this comment.
Blocking: enforce DeepSeek's 128-character search-query limit in both adapters.
I found one contract failure, marked inline. I covered the complete diff, the runtime and research request paths, credential borrowing and live revocation, sub-agent and product-launcher callers, Web UI/RPC boundaries, branch history, backward compatibility for the existing vendor and legacy-key paths, repository rules and canonical terms, and whether tests were weakened. The first-party endpoint and response shapes otherwise match DeepSeek's documentation.
Verification:
uv run pytest tests/test_agent_tools_web_fetch.py tests/test_agent_tools_web_providers.py tests/test_agents_ppt_launcher.py tests/test_agents_research_launcher.py tests/test_agents_research_tools.py tests/test_cli_onboard_commands.py tests/test_config_live.py tests/test_rpc_console.py tests/test_subagent_manager.py tests/test_tool_capabilities.py -x: 1,507 passed, 23 warnings. The initial attempt lacked the repository'sdevextra; afteruv sync --extra dev, the stated run passed.npm test -- --run src/features/settings/SetupBodies.test.tsx src/features/settings/pages/Tools.test.tsx: 41 passed.npm run type-check: passed.uv run python scripts/check_source_language.py github/main...HEAD: passed.git diff --check github/main...HEAD: passed.
|
Windows compatibility review — PR #1125 @ Scope: full base Result: no Windows-specific issue.
Verification (native Windows 11, CPython 3.12.13, isolated worktrees The three failures are the inherited POSIX-assumption onboarding tests — Limitations: no live DeepSeek endpoint was called; the settings UI was not exercised in a browser. |
8c6c6ad to
5b9f46e
Compare
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
The reported DeepSeek query-limit defect is fixed in both adapters with boundary and no-request coverage, and I resolved the original thread. I reviewed the current full PR diff, the delta and range-diff from the previously reviewed revision, request-path callers, backward compatibility, repository rules and domain terms, architecture boundaries, history, and test changes; the three original commits are unchanged after the rebase, and I found no new issue.
Verification:
uv run pytest tests/test_agent_tools_web_fetch.py tests/test_agent_tools_web_providers.py tests/test_agents_research_tools.py tests/test_config_live.py -x: 495 passed, 24 warnings.uv run pytest tests/test_agents_ppt_launcher.py tests/test_agents_research_launcher.py tests/test_cli_onboard_commands.py tests/test_rpc_console.py tests/test_subagent_manager.py tests/test_tool_capabilities.py -x: 1,017 passed.uv run python scripts/check_source_language.py github/main...HEAD: passed.git diff --check github/main...HEAD: passed.
|
Windows compatibility re-review — PR #1125 @ Scope: the head moved from the previously reviewed Result: no Windows-specific issue. The delta is a string-length check and an error message; the DeepSeek transport is unchanged ( Verification (native Windows 11, CPython 3.12.13, isolated worktree Limitations: no live DeepSeek endpoint; the settings UI was not exercised in a browser. |
|
Not a blocker -- smaller points from the same pass, separate from the two blocking threads. All changed test files pass on this head merged onto Severity of this one finding, not a verdict on the pull request. Any blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text.
|
|
Blocking: the two newly raised compatibility findings need resolution. The unchanged revision now has open blocker threads covering credential borrowing across custom/endpoints routing and product-launcher compatibility with older Raven schemas. They were raised by another reviewer, so I am not re-grading or resolving those threads. This supersedes my earlier clean stance until their author closes or downgrades them. |
5b9f46e to
e81f041
Compare
|
Non-blocking items from the same pass:
@gloryfromca the two blocking threads are answered; could you re-check once 0xKT has had a look? |
gloryfromca
left a comment
There was a problem hiding this comment.
Blocking: the two open compatibility threads still need their originating reviewer's confirmation.
Reviewed e81f041e9536 against github/main, including the revision delta/range-diff, repository rules and domain constraints, affected callers and history, backward compatibility, test changes, and the provider/launcher architecture. I found no additional defect.
The new implementation matches both reported failure modes: borrowed DeepSeek credentials now come from the resolved address/key pair and are withheld for non-DeepSeek hosts, while both launchers look up the newer borrowing helper at call time and tolerate older Raven schemas. The added regressions cover custom bases, endpoints-only and stale flat keys, live last-good behavior, and missing-helper launchers.
Verification:
uv run pytest tests/test_agent_tools_web_fetch.py tests/test_agent_tools_web_providers.py tests/test_agents_ppt_launcher.py tests/test_agents_research_launcher.py tests/test_agents_research_tools.py tests/test_cli_onboard_commands.py tests/test_config_live.py tests/test_rpc_console.py tests/test_subagent_manager.py tests/test_tool_capabilities.py -x: 1523 passed, 26 warnings- focused web settings tests: 42 passed
- web UI type-check: passed
uv run python scripts/check_source_language.py github/main...HEAD: passedgit diff --check github/main...HEAD: passed
I cannot close or re-grade the two blocker threads opened by @0xKT; both remain unresolved, so the whole-record stance stays blocking pending that reviewer's response.
|
Windows compatibility re-review — PR #1125 @ Scope: the head moved from the previously reviewed Result: no Windows-specific issue. The additions are config-dict/enumeration and onboarding text logic; the transport is still Verification (native Windows 11, CPython 3.12.13, isolated worktree The three failures are the inherited POSIX onboarding tests ( Limitations: no live DeepSeek endpoint; the settings UI was not exercised in a browser. |
e81f041 to
e1a11da
Compare
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed e1a11da291ea against github/main. The range-diff confirms all nine PR commits are patch-identical to the previously reviewed revision; this head only rebases them onto the newer main. I covered the repository rules and domain constraints, the diff and revision history, affected callers, backward compatibility, test changes, and the provider/launcher architecture.
The originating reviewer re-verified both compatibility fixes and resolved both threads. The earlier query-limit thread is also resolved, so no review thread remains open and the previous blocker stance is superseded.
Verification:
- focused Python suites: 1531 passed, 26 warnings
- focused web settings suites: 42 passed
- web UI type-check: passed
- source-language check: passed
git diff --check github/main...HEAD: passed
|
Windows compatibility re-review — PR #1125 @ Scope: the branch is rebased onto current main; the PR's own diff at this head is Result: no Windows-specific defect. The feature is a DeepSeek web search/fetch provider with config plumbing, onboarding key borrowing, and settings UI; the launcher change is an import guard, and the web calls are HTTP with no path, subprocess, permission, or encoding surface. Verification on native Windows 11, detached worktree
Coverage gaps: the full suite was not rerun; no live call to the DeepSeek endpoints was made. |
|
Rebased onto main 959cd0a and pushed e1a11da; the diff against main is unchanged in content (the four upstream commits are unrelated) and CI is re-running on the new head. @0xKT could you give this an approving review when you have a moment? You re-verified both blocking fixes at e81f041 and both threads are resolved. |
|
No blockers; this can merge as far as I am concerned. Confirmed on |
e1a11da to
f2efa9f
Compare
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed f2efa9f82eb9 against the refreshed github/main. This revision rebases the same nine PR commits over upstream PR #1102; the only integration adjustment uses that upstream change's separate search/fetch keyless-hint keys while preserving the borrowed-key notices. I found no new defect.
Covered the repository rules and domain constraints, the diff and range-diff, affected callers and history, backward compatibility, test changes, and the provider/launcher architecture. All three review threads remain resolved.
Verification:
- focused Python suites: 1531 passed, 26 warnings
- focused web settings suites: 44 passed
- web UI type-check: passed
- source-language check: passed
git diff --check github/main...HEAD: passed
|
Windows compatibility re-review — PR #1125 @ Scope: the branch is rebased onto current main, which now includes #1102; the PR's own diff at this head is Result: no Windows-specific defect. The feature is unchanged — the DeepSeek web search/fetch provider with its config plumbing, onboarding key borrowing, and settings UI — and the rebase adaptation is two i18n key names. No path, subprocess, signal, socket, permission, or encoding surface is involved. Verification on native Windows 11, detached worktree
Coverage gaps: the full suite was not rerun for this rebase; no live call to the DeepSeek endpoints was made. |
Add DeepSeek's first-party /v1/tools/search and /v1/tools/fetch endpoints as providers for web_search and web_fetch. Search renders the vendor's summary field; the tools never ask for page bodies. The DeepSeek web credential is optional: an empty tools.web.providers.deepseek.apiKey borrows providers.deepseek.apiKey, resolved live and reported by raven doctor as borrowed. The research product, the PPT launcher and the sub-agent fetch lane carry the same rule, and the settings page treats a borrowed key as configured. Endpoints are literals; no apiBase or compatibility gateway is involved.
The class-namespace gate rejected keyrow-tbox as unprefixed; settings-tbox-wide carries the domain prefix and the rule stays in the settings stylesheet.
The wizard read only tools.web.providers.<vendor>.apiKey, so a DeepSeek deployment with the key under providers.* was asked for a second one and probed with an empty string. Read the effective key (borrow included) and say so in the step's copy.
DeepSeek's Search API accepts 1-128 Unicode characters; a longer query answers HTTP 400, which this tool renders as the bare status, so the model was never told to shorten it. Check the limit before the request in both the host tool and the research mirror, and name the limit and the query's length in the error.
The limit cases pin both adapters: 129 characters sends no request, 128 is still sent. Three further cases cover the seven newly added lines the diff-coverage gate reported -- the two exception paths in borrowed_web_key and live_borrowed_web_key, and DeepSeek answering 200 with no page text.
The web endpoints are literals, so a key borrowed from the model provider must be one that provider issued for its own host: borrow through provider_connection and lend nothing when the section resolves to a gateway, another host, or an endpoint somewhere else. Endpoints are the section's own key/address groups, so an endpoint's key wins over the flat one it replaces, and a key only in endpoints is found. The live reader now distinguishes a provider the file does not name (boot still answers) from a rejected edit (the last admitted key keeps serving), as every other live reader here does. The Tools page follows the same address rule when it says the key is already set.
Both launchers can outlive the raven they run on, so the helper this PR introduced is looked up at call time: the ppt launcher no longer imports it at module top (an older raven raised ImportError before parsing arguments), and the research launcher's first vendor_key lookup answers no key instead of raising. Each has an outlive case that removes the name.
The step-5 explanation is its own gettext key; rewriting it left the zh catalogue on the old sentence, so the whole screen fell back to English. The text is now a constant the catalogue and the test share, with the new zh entry and the orphaned one removed.
The self-configuration catalogue still told the agent that web_search runs only once the vendor's own key is set. The borrowed-key tests also pin that a borrowed key counts as a credential, that an empty provider key without a web slot revokes, and that the reader dials through the configured proxy.
The research product's .env.example still listed the web vendors without deepseek, one stanza above the new RESEARCH_DEEPSEEK_API_KEY entry, and its "a name not on the list refuses to launch" line now read as excluding a vendor the launcher accepts. Add it to both halves. The changelog had no entry for the new vendor; add one under Unreleased, following the Serply and Keenable entries it sits beside. The settings page's own host table is the fourth copy of the borrow rule and only the vendor list was pinned to the schema. Pin the host map too, so a drift cannot make the page claim a key the server refuses.
f2efa9f to
e1f729b
Compare
ZuyiZhou
left a comment
There was a problem hiding this comment.
Read the core of this at e1f729b: the endpoints are literals, the borrowed key is lent only when provider_connection resolves the section to api.deepseek.com (the default section does, via the deepseek base-URL fallback), and provider_connection is still a 3-tuple after the rebase, so the broad except in the borrow helper is not hiding a signature change. The tenth commit is changelog, .env.example and a test only. Earlier rounds from gloryfromca and 0xKT are resolved. CI was still running when I approved (unit shards, ui rpc contract, Windows ACP stdio).
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed e1f729be342b against refreshed github/main. The first nine commits are patch-identical to the previously reviewed revision. The new final commit accurately documents DeepSeek in the changelog and research environment example, and adds a passing contract test that keeps the settings host table aligned with the schema. I found no new defect.
Covered repository rules and domain constraints, the diff and range-diff, affected callers and history, backward compatibility, test changes (none weakened), and the provider/launcher architecture. All three review threads remain resolved.
Verification:
- focused Python suites: 1559 passed, 27 warnings
- focused web settings suites: 44 passed
- web UI type-check: passed
- source-language check: passed
git diff --check github/main...HEAD: passed
Summary
Add DeepSeek's first-party Search and Fetch endpoints as selectable backends for web_search and web_fetch.
Type
Verification
Ran
uv sync --frozen --all-extras --python 3.12, then in that worktree venv:pytest -q: 36935 passed, 8 failed, 256 skipped, 2 xfailed. The 8 are this box's known baseline (5 ambient-proxy tests, 1 soffice conversion, 1 npm/PATH leak, 1 root-readable test); they fail identically on a clean origin/main checkout, so this branch introduces 0 failures. The 8 oncall shared-ledger xdist flakes seen in earlier runs did not reproduce here.vitest run src/features/settings/pages/Tools.test.tsx src/features/settings/SetupBodies.test.tsx: 42 passed.vitest run --no-file-parallelism scripts/gates: 239 passed.tsc --noEmit -p tsconfig.jsonand eslint on the changed settings files: clean.node scripts/gen-i18n.mjs --check: up to date after regenerating the TUI catalog.scripts/check_commit_messages.py origin/main..HEAD,scripts/check_large_files.py origin/main..HEAD,scripts/check_source_language.py origin/main..HEAD: exit 0. commitlint: exit 0. lint-imports: 10 kept, 0 broken.Risk
Security impact considered
Backward compatibility considered
Rollback path is clear for risky changes
The borrowed credential is a server-side stored key and travels only to the hardcoded api.deepseek.com endpoints; no caller chooses the destination.
DEEPSEEK_API_KEY is the vendor's env var, the same name the LLM provider uses. ~/.raven/env exports it only when the web slot is set, and clearing that slot retires only Raven's own export (marker-guarded), so a user's own export survives.
A PPT product whose host web slot is empty has the borrowed key written into its own web slot (the rendered product config is 0600); a product with its own LLM key still searches.
The research launcher now also reads the host's providers.deepseek.apiKey on its own-LLM-key branch.
No schema migration. Selecting Serper or Jina again restores the previous behavior.
A DeepSeek search query over 128 characters is now refused before the request, with the limit and the query's length in the error; the other vendors' queries are unchanged.
A borrowed web key now travels only to DeepSeek's own host; a gateway address or a foreign endpoint lends nothing, and an endpoint's key replaces the flat one it supersedes.
Both product launchers look the borrow helper up at call time, so a stamped launcher on an older raven loads and borrows nothing instead of failing its import.
A rejected providers.deepseek edit keeps the last admitted borrowed key serving; removing the provider section falls back to boot.
The zh onboarding step-5 sentence is translated again and pinned to the catalogue.
Known gap: raven-code and raven-oncall do not inherit the host's web selection at all (pre-existing), so they never select DeepSeek today.
The endpoints were exercised against recorded wire shapes, not the live API; the live instance runs this branch for manual testing.
Related Issues
Fixes #1105