fix(logs): remaining request-derived log sites interpolate unbounded values

Author: LearningCircuitCreated Sep 27, 2026Updated Sep 27, 2026
Labelspythonseverity:suggestedfrom-review-extractionfollow-up-work-in-progress

Summary

Four log sites still eagerly interpolate request-derived values of unbounded size into log lines - the exact #6191/#6305/#6756 defect family whose named sites were all bounded.

Field Value
Severity suggested
Origin Review of #6756 (post-merge extraction)
Review section Prose reviewer notes (initial + final review)
Classification main-existing
Verified at main@43061a14ebff
Dedup distinct · 3 hits reviewed

Trigger

A request carrying a large body value (a huge strategy name, URL, query string, or a config with many blocked keys) reaches any of the four sites; the full value is stringified into the log line regardless of level.

Impact

Linear-cost eager stringification on every request (measured family behavior: a 50 MB strategy string produced a 50,000,015-char line on main before the same site was bounded), plus large or secret-shaped request data in default-enabled sinks.

Pinned evidence

  • 43061a14ebff:src/local_deep_research/web/services/research_service.py:L1040 - logger.info(f"Research strategy: {strategy}") (thread-side; the save-path lines at :364-399 were bounded by #6756, these were agreed as "a natural follow-up PR")
  • 43061a14ebff:src/local_deep_research/web/services/research_service.py:L1044 - Research parameters: provider=..., model=... eager f-string
  • 43061a14ebff:src/local_deep_research/web/routers/api.py:L246 - logger.warning(f"SSRF protection: Rejected URL {url}") (validate_url returns False rather than raising, so the full repr reaches the log - named optional in the #6756 review)
  • 43061a14ebff:src/local_deep_research/web/routers/followup.py:L264-L270 - raw query value and params keys at INFO (named optional in the #6756 review)
  • 43061a14ebff:src/local_deep_research/web/routers/research.py:L1905-L1907 - blocked_keys list interpolated at WARNING (named optional in the #6756 review)

Fix direction

Route each through brace-arg lazy formatting with the existing _log_value_preview helper from the notes router (same pattern as #6756's nine converted sites).

Targeted tests

Extend the #6756 call-path probe shape: feed a wide value at each site and assert the emitted line length stays bounded (the existing wide-body probe pattern in tests/research or tests/web).

Provenance

Extracted from review of PR #6756 (post-merge extraction). Related: #6191, #6305.

Source: LearningCircuit/local-deep-research