fix: degrade malformed chat provider replies - #379
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Exact-head verification for the malformed provider boundary:
The fix is narrow: the two buyer-facing chat handlers now translate malformed provider envelope |
b606c25
into
ContextualWisdomLab:feat/naruon-calendar-projection-contract-main
|
@opencode-agent Review exact current HEAD |
* test(calendar): define clean Naruon projection contract * test(http): require bounded JSON response reads * fix(http): bound admitted JSON response bodies * feat(calendar): add bounded Naruon read projection * test(calendar): cover transport and numeric hardening * docs(contract): add strict Naruon calendar schema * feat(calendar): export Naruon projection package API * docs(adr): correct pseudo-CalDAV product language * docs(adr): record clean Naruon calendar authority boundary * docs(doctoring): trace calendar contract standards * docs(changelog): add clean calendar projection fragment * test(http): cover bounded response edge branches * test(calendar): cover RFC3339 defensive branches * docs(plan): add calendar contract TDD plan * test(calendar): reject surrounding contract whitespace * fix(calendar): reject silent contract string normalization * docs(contract): align exact string whitespace rules * test(http): require exact JSON response media type * fix(http): validate exact response media types * fix(calendar): require exact provider response media type * test(calendar): assert response media-type enforcement * docs(contract): add calendar consumer conformance fixture * test(calendar): pin consumer conformance fixture digest * fix: contain raw provider failures * fix: preserve login return URL and guard admin token * fix: degrade malformed chat provider replies (#379) * fix: degrade malformed chat provider replies * test: seed global ask malformed provider regression * fix(docs,worker): free ADR 0123 collision and stop mislabeling empty-body failures Renumber the Naruon calendar projection ADR to 0143 -- it collided with docs/adr/0123-provider-error-boundary.md, which four other open PRs already carry for an unrelated decision and which CI's ADR-uniqueness test would reject on merge. Add ADR 0123 itself for the provider-error-hiding policy this PR implements in auth.py, analysis_run_start.py, and chat_completion_content, since that policy previously shipped without a decision record. Stop process_post_content_job from blaming an empty source post body on a "provider operation failure" that retrying cannot fix; report it with its own failure code and an accurate detail instead of falling into the generic provider-failure catch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5M79L945DMyMs3sg5yJ14 * docs(adr): assign Naruon calendar ADR 0145 * Revert "fix: preserve login return URL and guard admin token" This reverts commit b566c6d. * test: prove bounded calendar transport edges * Reapply "fix: preserve login return URL and guard admin token" This reverts commit dd463ed. * fix(worker): restore diagnostic log for empty-body ingestion skip Moving the empty-body guard out of the try/except in process_post_content_job (26f25ac) stopped it from raising, so the _logger.exception call that used to record the skip never runs. Operators tailing logs lost visibility into why a post-content job requeued with post_content_source_body_missing; the failure was only discoverable via a DB query. Log a warning at the guard itself, matching the _LOGGER.warning(..., extra={...}) pattern already used in post_content_persistence.py. Addresses Devin Review comment on PR #355 (post_content_worker.py:234). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XKohNQEbNH1mpNEkvsuhKv * fix(docs): renumber Naruon calendar ADR from 0145 to 0168 Both this PR and origin/main independently claimed ADR number 0145 (psychometric-channel-weight-estimation on main). Renumber this PR's ADR to the next free number to resolve the collision caught by tests/test_documentation_hygiene.py. * fix(docs): free pre-existing ADR 0168 collision on main origin/main independently landed two unrelated ADRs under number 0168 (#349's ontology/provenance explorer and #518's leftover-map complete-case coverage), which merged into main days apart without a uniqueness check catching the collision. tests/test_documentation_hygiene.py fails on main by itself, independent of this PR. Renumber the ontology/provenance explorer ADR to 0184 (smaller cross-reference footprint, and its topic has no same-numbered migration file, unlike the leftover-map ADR which shares its number with migrations/0168_report_leftover_map_coverage.sql). Update every prose and link reference across docs, code comments, and tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5M79L945DMyMs3sg5yJ14 * fix(calendar): reconcile current main review findings * fix(ingestion): fail empty bodies without retry * fix(adr): allocate Naruon decision 0203 --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
Summary
TypeErrorresponses in post-scoped chat and Global Askget_json_listtest importValidation on exact parent head
uv run --frozen --extra dev --extra backend pytest -q backend/tests/test_api.py -k 'malformed_provider_reply'(2 passed, 103 deselected)uv run --frozen --extra dev --extra backend pytest -q tests/test_http_client.py(13 passed)git diff --checkpassedThis PR is stacked on upstream PR #355 and must merge before the parent. It does not alter the Naruon authority boundary or activate runtime integration.