fix: JSON serialization and logging exception propagation in claude_code_llm#461
Merged
nicoloboschi merged 1 commit intomainfrom Mar 2, 2026
Merged
fix: JSON serialization and logging exception propagation in claude_code_llm#461nicoloboschi merged 1 commit intomainfrom
nicoloboschi merged 1 commit intomainfrom
Conversation
…claude_code_llm (#458, #459) - Replace json.dumps(result) with result.model_dump_json() for Pydantic models to fix TypeError during consolidation - Wrap record_llm_call tracing block in try/except so logging failures never propagate to retry handler - Fix test_llm_provider.py to use _get_raw_config() for bank-configurable enable_observations field
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
Fixes two bugs reported in issues #458 and #459 that caused every consolidation task to retry 11 times, generating thousands of wasted LLM API calls.
json.dumps(result)withresult.model_dump_json()— Pydantic models are not JSON-serializable by default, causing aTypeErroron every consolidation attemptrecord_llm_calltracing block intry/except Exception: pass— logging failures are non-critical and must never propagate to the retry handlertest_llm_provider.pyto use_get_raw_config()for the bank-configurableenable_observationsfield (same pattern astest_consolidation.py)Test plan
test_llm_provider_consolidation[claude-code-claude-sonnet-4-20250514]passes locally