fix(web): load user extract plugins before backend resolution - #72646
fix(web): load user extract plugins before backend resolution#72646Plauschi wants to merge 2 commits into
Conversation
Co-Authored-By: Hermes <noreply@nousresearch.com>
Co-Authored-By: Hermes <noreply@nousresearch.com>
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the selection-time ordering bug. Current main confirms the premise: web_extract_tool() resolves _get_extract_backend() at tools/web_tools.py:857, while its existing discovery call follows at line 866; _get_capability_backend() therefore probes a cold plugin registry at line 306. The display change also fixes the current generic "error"-key heuristic at agent/display.py:1311 for nested error: null envelopes.
Problems
check_web_api_key()is a sibling cold-registry gate: it probes configured and active providers attools/web_tools.py:1062-1081without discovery, while both web tools use it ascheck_fnat lines 1218 and 1232. A custom extract-only provider can still be omitted before this dispatcher-level fix runs.
Suggested changes
- Call the existing
_ensure_web_plugins_loaded()before the availability probes incheck_web_api_key()and cover that path with a cold-registry custom extract-provider test.
Automated hermes-sweeper review.
| # User plugins are registered lazily. A fresh standalone tool process | ||
| # can reach backend selection before the normal agent startup discovery; | ||
| # probe only after giving the configured plugin a chance to register. | ||
| _ensure_web_plugins_loaded() |
There was a problem hiding this comment.
Please apply this same idempotent discovery guard to check_web_api_key(). That function remains a pre-dispatch check_fn for both web tools and currently probes custom-provider availability against a cold registry, so an extract-only custom provider can still leave the tools unavailable before this corrected selector runs.
SummaryTwenty-four PRs address three linked causes: cold-registry discovery ordering, hardcoded provider-selection/tool gates, and non-actionable web-tool failures. #34563 and #57779 are the merged reference implementations for dispatcher discovery and registry-aware selection, while #67110, #67309, #71791, and #72646 address the remaining selection-before-discovery gap and #58359 separately addresses failure guidance. Related pull requests
Duplicates#27584, #27700, #28202, and #69144 overlap on discovery-before-dispatch, with #34563 as the merged reference; #31829, #31887, #32465, #33516, #33902, #36094, #38375, #52057, #56201, and #56761 overlap with the provider-gate class implemented by #57779. #67110, #67309, #71791, and the web-selection portion of #72646 overlap on discovery-before-selection. Suggested consolidationKeep #67309 open with a salvage path for the shared-gate ordering fix and its corrected cold-registry tests, subject to an independent run against current main. Author action on #72646: add the contributor-requested discovery guard and cold-registry test for check_web_api_key(), then split out the distinct nested error:null display fix; despite the keep_open reviews on #67110 and #71791, their diffs are narrower or incomplete relative to #67309, so they can be closed as duplicates of #67309 after preserving any useful test cases, while #58359 should remain open only after replacing the unsupported cache/browser guidance, adding focused tests, and removing the unrelated Himalaya edit. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I27683(["issue #27683 (closed)"])
subgraph Dup67110 ["PRs duplicating each other"]
P67110["PR #67110 (open)"]
P72646["PR #72646 (open)"]
end
P72646 -.->|partial| I27683
class I27683 closed
class P67110 open
class P72646 open
class P72646 target
click I27683 "https://github.com/NousResearch/hermes-agent/issues/27683"
click P67110 "https://github.com/NousResearch/hermes-agent/pull/67110"
click P72646 "https://github.com/NousResearch/hermes-agent/pull/72646"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 24 pull requests and 8 issues in this complex. Each diff was read against this issue; Assessment working set: 147 kB of PR diffs, 118 kB of issue/PR text, 64 kB of discussion (79 comments), 96 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
web_extractprocess from falling back to search-onlyddgswhenweb.extract_backendnames a user plugin"error": nullas success while preserving meaningful nested error messagesReproduction
With
web.backend=ddgs,web.extract_backend=jina-reader, and the user plugin enabled, a fresh process selectedddgsbefore plugin discovery and returned a search-only backend error. After extraction succeeded, the display detector also marked the result as failed because the response contained a nested"error": nullkey.Test plan
162 passedacross the focused web-provider and display suiteshttps://example.comthrough the userjina-readerpluginGATEWAY_EXTRACT_OKand loggedtool web_extract completed