Conversation
…rnal data - #472: Replace silent skips with explicit error recording in pipeline handlers - RetrieveContextHandler, ImageGenerateHandler, NotifyHandler, SearchQueryTriggerHandler now use context.record_error with code="missing_dependency" - Unified dispatcher photo handlers now return FAILED instead of COMPLETED when services are missing - #473: Add safe_json_dumps utility and replace unsafe json.dumps calls - New src/utils/json.py with safe_json_dumps handling datetime, bytes, Pydantic models - Replace 28 json.dumps calls across collection_tasks, telegram_commands, pipelines, agent_provider_service, image_provider_service, agent/manager Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ect FAILED Aligns tests with the behaviour change in #472: dispatcher now marks tasks as FAILED (not COMPLETED) when PhotoTaskService / PhotoAutoUploadService are absent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Что ещё осталось доработать из #472PR закрывает основную часть issue, но не все HIGH-риски, описанные в #472. Ниже — список того, что нужно сделать в этом PR или в follow-up. 1.
|
- PublishService._publish_to_target: early return when client_pool is None - UnifiedDispatcher._handle_content_publish: fail task when client_pool missing - React/Forward/Delete handlers: raise RuntimeError after record_error - Tests updated: pytest.raises for RuntimeError, assert missing_dependency errors Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude please review this PR. Focus only on critical issues. |
|
Claude finished @axisrow's task in 3m 43s —— View job PR Review
Critical Issues1.
|
- pipeline_executor: wrap node loop in try/finally so context.get_errors() is always captured, even when a handler raises RuntimeError - safe_json_dumps: replace repr() fallback with TypeError to prevent silent DB corruption from non-serializable objects Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 42s —— View job PR Review
Critical Issue
|
…wn types - pipeline_executor: attach node_errors to exception via exc.node_errors so callers can persist structured errors even on RuntimeError - content_generation_service: extract exc.node_errors and save to DB metadata when marking run as failed - generation_runs repo: set_status now accepts optional metadata param - safe_json_dumps: replace repr() fallback with TypeError (fail-fast) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 15s —— View job PR Review
All Previously Flagged Critical Issues Are Now Fixed
|
- FakeGenerationRunsRepo.set_status: accept optional metadata param - content_publish tests: add client_pool mock to dispatcher fixtures Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
safe_json_dumpsutility to handle non-serializable types (datetime, bytes, Pydantic models) and replaced 28 unsafejson.dumpscallsChanges
Issue #472 — Missing dependency handling
src/services/pipeline_nodes/handlers.py:RetrieveContextHandler,ImageGenerateHandler,NotifyHandler,SearchQueryTriggerHandlernow callcontext.record_error(code="missing_dependency", ...)instead of silentlogger.info/warning + returnsrc/services/unified_dispatcher.py:_handle_photo_dueand_handle_photo_autonow returnCollectionTaskStatus.FAILEDinstead ofCOMPLETEDwhen services are not configuredIssue #473 — JSON serialization safety
New file
src/utils/json.py:safe_json_dumps()function with fallback for:datetime,date→.isoformat()bytes→.hex().model_dump()repr()Replaced
json.dumpswithsafe_json_dumpsin:src/database/repositories/collection_tasks.pysrc/database/repositories/telegram_commands.pysrc/web/routes/pipelines.pysrc/services/agent_provider_service.pysrc/services/image_provider_service.pysrc/agent/manager.pyCloses
Test plan
ruff checkpassespytest tests/passes (parallel + serial)🤖 Generated with Claude Code