Skip to content

feat: nightly hardening - bounded you.com response parsing#69

Open
mouse-value-add wants to merge 2 commits into
brainsparker:mainfrom
mouse-value-add:chore/nightly-hardening-20260529-youcom-response-size-cap
Open

feat: nightly hardening - bounded you.com response parsing#69
mouse-value-add wants to merge 2 commits into
brainsparker:mainfrom
mouse-value-add:chore/nightly-hardening-20260529-youcom-response-size-cap

Conversation

@mouse-value-add

Copy link
Copy Markdown
Contributor

Problem

The You.com provider decoded successful JSON responses directly from without a size cap. A malformed or hostile upstream payload could force unbounded response reads and excessive memory pressure.

Approach

  • Added a hard response decode limit () in .
  • Switched JSON decoding to .
  • Added to verify oversized payload handling is surfaced as a transient error.

Verification

  • Ran: ok github.com/frugalsh/frugal/internal/provider/youcom (cached)
    ok github.com/frugalsh/frugal/internal/search (cached)
    ok github.com/frugalsh/frugal/internal/mcp/tools (cached)
  • Result: all tests passed.

Risks

  • Very large but valid You.com payloads above 2 MiB will now fail decode and retry/fallback instead of being processed.

Rollback plan

  • Revert this PR commit to remove the size cap and restore prior decode behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant