Repository navigation
chore(anthropic): log hygiene, drop obsolete pdfs beta header, remove dead stream branches - #3976
Closed
hpiclaranet wants to merge 1 commit into
Closed
hpiclaranet wants to merge 1 commit into
hpiclaranet wants to merge 1 commit into
Conversation
Closed
6 of 15 tasks
… dead stream branches
hpiclaranet
force-pushed
the
fix/anthropic-hygiene-logging-034
branch
from
October 10, 2026 09:34
86bcdcc to
4e416e3
Compare
3 of 5 tasks
Member
|
Thank you for your contribution, @hpiclaranet! This PR currently has merge conflicts with |
6 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebased onto current main (
7584b133, anthropic 0.3.34 via #3919 "Claude Opus 5.5") — supersedes #3725 with the same change set (#3725 was closed with a pointer to this PR). Version bumped to 0.3.35.Three low-risk hygiene fixes in the Anthropic provider, verified against the installed
anthropicSDK (1.4.0) and current official documentation:main.py+ the SDK'splugin_logger_handler), so every user prompt, system prompt, and response was written to daemon stdout on every invocation. They are now DEBUG behind a module-level_debug_logging_enabled()guard — and the expensive_sanitize_for_logging()deep-copy of the request payload is also skipped when DEBUG is off. (Response and streamed-chunk logs remain unredacted when DEBUG is on.)pdfs-2024-09-25beta header removed — PDF (document) support is GA; the current official docs show PDF requests with no beta header. The document block itself is unchanged and continues to be sent.redacted_thinkingdelta branches removed from the stream handler. The SDK'sRawContentBlockDeltaunion isTextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta— there is no redacted-thinking delta type, so bothelif chunk.delta.type == "redacted_thinking"branches could never execute. Redacted thinking arrives viacontent_block_start(aRedactedThinkingBlock), which is still handled; the two close-tag conditions simplify fromin ("thinking", "redacted_thinking")to== "thinking". Theinput_json_delta/tool-use handling from fix(anthropic): stream tag duplication, 529 mapping, image fetch hardening #3907 is preserved.Release Notes
pdfs-2024-09-25beta header for PDF input (PDF support is GA)Change Type
Screenshots / Videos
Not applicable — logging levels, request headers, and dead code removal, covered by unit tests.
LLM Plugin Checklist
Areas affected by this change (check all that apply)
Version
versioninmanifest.yaml(not the one undermeta) — 0.3.34 → 0.3.35 (0.3.34 taken by feat(anthropic): add Claude Opus 5.5 #3919)dify_plugin>=0.10.2is declared inpyproject.tomland locked inuv.lock(>=0.3.0 satisfied; upper bound left open as inherited from main — same as sibling plugins)Testing
uvvenv aligned withmanifest.yaml,pyproject.toml, anduv.lock(no Dify platform deployment in this run): full anthropic suite passes on the rebased head (4e416e34, main7584b133, SDK 1.4.0) — 137 passed, 16 skipped (the 16 are live-API tests, noANTHROPIC_API_KEYset; includes the Opus 5.5 tests from feat(anthropic): add Claude Opus 5.5 #3919).ruff checkreports zero findings on the changed files.Known limitations (pre-existing, out of scope here):
anthropic_api_urlcredential that still required the legacypdfs-2024-09-25header would not receive it — no such requirement exists in any official endpoint.claude-3-5-sonnet-20240620max-tokens beta header assignment uses direct assignment rather than comma-join composition (pre-existing; that model does not combine with the other beta features).datafields; response and stream chunks are logged as-is); keep DEBUG off in production.