Repository navigation
Fix recurring agent tool failures: proxy timeouts, report identifiers, page fetch errors, skill names - #1780
bearsyankees wants to merge 6 commits into
Conversation
…, page fetch errors, skill names - Proxy tools: raise the SDK's 10s GraphQL operation timeout to 60s, list requests without raw bodies, and report timeouts instead of an empty error. - Reports: drop placeholder CVE values and move a CWE id out of the CVE field. - web_get_contents: return the per-URL failure reason and retry once only when the failure may be transient. - Skills: resolve a wrong category or a typo when exactly one skill matches. - stop_agent: an already finished agent is a successful no-op.
… timeout after connect - A request to the proxy now and then gets no answer while the same request succeeds right afterwards, so read-only calls are sent once more. Calls that send traffic are not repeated. - The SDK rebuilds its GraphQL client on connect, which reset the timeout. - A rejected query (invalid HTTPQL) is reported once, not twice.
[Medium impact] The PR appears safe to merge with the two previously reported, non-blocking retry deadline issues still open. FindingsFix with agent prompt### Issue 1
strix/tools/proxy/tools.py:79-84
`_call` now gives each attempt 60 seconds, but `view_request`, `list_sitemap`, `view_sitemap_entry`, and `scope_rules` still have 60-second tool deadlines. When a request stalls until the new timeout, the tool deadline arrives before the retry can finish, bypassing the intended recovery and clearer error. Give these reads a shorter per-attempt timeout or increase the outer deadline enough for both attempts and time spent waiting for the shared lock.
### Issue 2
strix/tools/web_search/tool.py:175-176
`_exa_page_text` can now make two calls, each with a 300-second HTTP timeout, while `web_get_contents` still stops waiting after 330 seconds. A slow empty response followed by a slow successful retry can therefore lose its result. Because the work runs through `asyncio.to_thread`, that HTTP call can also keep running after the tool returns a timeout. Bound both attempts to one total time budget that fits inside the tool deadline.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR makes scan tools more forgiving of common input mistakes and improves recovery from slow external services.
No new findings were established. Both previous findings remain outstanding: proxy retries and page-fetch retries can exceed their tools’ deadlines. Reviews (2) · Last reviewed commit: "Retry read-only proxy calls once after a..." · Reviewed by Greptile |
| attempts = 2 if read_only else 1 | ||
| for attempt in range(1, attempts + 1): | ||
| async with _CAIDO_CALL_LOCK: | ||
| caido_api.extend_graphql_timeout(client, timeout) | ||
| try: | ||
| return await fn(client) |
There was a problem hiding this comment.
Proxy retries lose their window.
_call now gives each attempt 60 seconds, but view_request, list_sitemap, view_sitemap_entry, and scope_rules still have 60-second tool deadlines. When a request stalls until the new timeout, the tool deadline arrives before the retry can finish, bypassing the intended recovery and clearer error. Give these reads a shorter per-attempt timeout or increase the outer deadline enough for both attempts and time spent waiting for the shared lock.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/tools/proxy/tools.py
Line: 79-84
Comment:
**Proxy retries lose their window.** `_call` now gives each attempt 60 seconds, but `view_request`, `list_sitemap`, `view_sitemap_entry`, and `scope_rules` still have 60-second tool deadlines. When a request stalls until the new timeout, the tool deadline arrives before the retry can finish, bypassing the intended recovery and clearer error. Give these reads a shorter per-attempt timeout or increase the outer deadline enough for both attempts and time spent waiting for the shared lock.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Doesn't block merge. When a read-only proxy call stalls until its 60-second GraphQL timeout, the tool's 60-second deadline can end the call before _call retries or returns its clearer error. The caller sees a timeout and can request the read again; the failed read leaves proxy records unchanged. The affected tools have 60-second deadlines and pass read_only=True to _call.
There was a problem hiding this comment.
Agreed—this is a resilience gap, not a merge blocker. The 60-second tool deadline can still preempt _call's retry for the affected reads, but a timed-out read leaves proxy records unchanged and can be requested again. I’d keep this as a non-blocking follow-up rather than require a change for this PR.
| for _ in range(2): | ||
| body = _exa_post(api_key, "https://api.exa.ai/contents", {"urls": urls, "text": True}) |
There was a problem hiding this comment.
Page retries exceed the deadline.
_exa_page_text can now make two calls, each with a 300-second HTTP timeout, while web_get_contents still stops waiting after 330 seconds. A slow empty response followed by a slow successful retry can therefore lose its result. Because the work runs through asyncio.to_thread, that HTTP call can also keep running after the tool returns a timeout. Bound both attempts to one total time budget that fits inside the tool deadline.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/tools/web_search/tool.py
Line: 175-176
Comment:
**Page retries exceed the deadline.** `_exa_page_text` can now make two calls, each with a 300-second HTTP timeout, while `web_get_contents` still stops waiting after 330 seconds. A slow empty response followed by a slow successful retry can therefore lose its result. Because the work runs through `asyncio.to_thread`, that HTTP call can also keep running after the tool returns a timeout. Bound both attempts to one total time budget that fits inside the tool deadline.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Doesn't block merge. When the first page fetch returns no content slowly and the second succeeds after the 330-second tool deadline, the caller gets a timeout instead of the fetched text. _exa_page_text allows two HTTP calls of up to 300 seconds each, while web_get_contents runs them in a thread under that deadline. The timeout is visible, so the caller can request the pages again; the lost result does not alter saved work.
There was a problem hiding this comment.
Agreed—since the timeout is visible and the caller can retry without losing saved work, this doesn’t block merge. The deadline mismatch remains a retryable reliability issue, but I’ll withdraw the blocker framing.
…tool-failures # Conflicts: # strix/skills/__init__.py
Summary
Fixes tool failures that recur across scans.
list_requests failed: Source:. The timeout is now set explicitly (and reapplied afterconnect(), which rebuilds the GraphQL client).list_requestsuses a metadata-only query and no longer downloads the raw request and response of every row. A timeout is reported as a timeout. Read-only calls are sent once more after a timeout, with a 20-second limit per attempt so both attempts fit inside the tool deadline; the default limit is restored after each call. Calls that send traffic (repeat_request) and invalid HTTPQL filters are not retried.null,N/A,-) are treated as absent, and a CWE id in the CVE field moves to the CWE field when that field is empty.web_get_contents. When no page is fetched, the error gives the per-URL reason and no longer says "Try again". One retry when the failure may be transient; both attempts share one time budget that fits inside the tool deadline.technologies/nextjs) resolves when the name itself is an exact, unambiguous skill name. A misspelled name (tooling/nuklei) is still rejected, and the error now suggests the closest names.stop_agent. Stopping an agent that has already finished is a successful no-op.Tests are in
tests/test_harness_tool_failures.py.Link to Devin session: https://app.devin.ai/sessions/12149bec39f84d02a389080ebc42b1fa
Open in Devin Desktop: https://app.devin.ai/desktop/session/12149bec39f84d02a389080ebc42b1fa?variant=devin
Requested by: @bearsyankees