Optimize image caption flow to skip pre-success failed images and reduce redundant LLM calls#3
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/nbnbnd/astrbot_plugin_SpectreCore/sessions/43e34f76-d794-45dc-aa92-1def408b57cf Co-authored-by: nbnbnd <191479905+nbnbnd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nbnbnd/astrbot_plugin_SpectreCore/sessions/43e34f76-d794-45dc-aa92-1def408b57cf Co-authored-by: nbnbnd <191479905+nbnbnd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nbnbnd/astrbot_plugin_SpectreCore/sessions/43e34f76-d794-45dc-aa92-1def408b57cf Co-authored-by: nbnbnd <191479905+nbnbnd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update image caption logic to skip failed attempts
Optimize image caption flow to skip pre-success failed images and reduce redundant LLM calls
May 18, 2026
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.
Current image captioning retries all images in a message, including ones that repeatedly failed before. This change adds failure-aware skip logic so images that failed before the latest successful caption in the same processing window are not retried.
Failure-state caching in
ImageCacheManagerfailure_cache) keyed by image hash.set_failed(image)get_failed_timestamp(image)clear_failed(image)should_skip_failed_image(image, latest_success_timestamp, window_seconds)Caption generation control in
ImageCaptionUtilsgenerate_image_caption(...)now acceptslatest_success_timestamp.get_failed_image_skip_window_seconds).Per-message success tracking in
MessageUtilsoutline_message_list(...)now tracks the latest successful image-caption timestamp while iterating message components.Original prompt
This pull request was created from Copilot chat.