Skip to content

fix(ai): web_fetch reports a failed fetch as a tool failure, not as page text #894

Closed

Description

@dan-petty

Context & Rationale

#860 split the web_fetch hardening entry (docs/ROADMAP.md, at 308a71f line 878) into four PRs and delivered PR1, the per-hop egress veto, as a v0.2.24 critical fix. This is PR2. Today every failure, an SSRF block included, comes back to the model as the page's text.

Scope & Deliverables

  • Deliverable: replace the except arm; raise ToolFailed (src/devops_cli/exceptions/ai.py:200) for non-2xx and connection failures (tool_failed, runner.py:156-158); let SSRFBlockedError reach error (:164-171).
  • Acceptance criteria: every behaviour named above has a test that fails before the change; tests use httpx2.MockTransport and never touch the network; uv run devops ci passes.
  • Constraint: the per-hop veto from fix(ai): web_fetch vetoes every redirect hop, reports failures as failures and renders pages as untrusted text #860 stays the only egress check, and a failure is never returned as page text.

Strategic Alignment

Activity

  1. added
    type/bug
    scope/ai
    priority/p1-high
    on Oct 1, 2026
  2. modified the milestones: , v0.2.28 on Oct 1, 2026
  3. dan-petty-bot commented on Oct 6, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1265, merged into release/v0.2.28 as d753f3f.

    Context & Rationale

    Closes #894.
    Previously, web_fetch caught all generic exceptions and returned an error string as ordinary page text. This disguised HTTP errors and transport failures as successful tool results with status "success", confusing calling agents and eval pipelines. Furthermore, redirect violations and SSRF exceptions were swallowed into page text.

    4 file(s) changed.

    How it was verified

    Check runs at e4460b6:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Analyze (actions): pass
    • Tests & Coverage: pass
    • Static Analysis: pass
    • Analyze (python): pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-894-web-fetch-reports-tool-failed.md:

    No Acceptance Criteria section.

  4. added a commit that references this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/aitype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions