Skip to content

Conversation

andreasjansson
Copy link
Member

@andreasjansson andreasjansson commented May 28, 2025

Important

Add prediction_index to improve error logging and tracking in prediction tasks across multiple modules.

  • Error Handling:
    • Add prediction_index to cog_safe_push() in main.py to track prediction tasks.
    • Modify run_tasks() in main.py to log errors with prediction_index.
    • Update predict() in predict.py to include prediction_index in logs.
  • Task Classes:
    • Add prediction_index attribute to CheckOutputsMatch, RunTestCase, and FuzzModel in tasks.py.
    • Log prediction_index in run() methods of these classes for better error tracking.
  • Misc:
    • Update logging statements across main.py, predict.py, and tasks.py to include prediction_index for improved error context.

This description was created by Ellipsis for fa8a261. You can customize this summary. It will automatically update as commits are pushed.

@andreasjansson andreasjansson requested a review from Copilot May 28, 2025 18:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a prediction_index to task runs and predictions so that logs and error messages are prefixed with an index for easier tracing.

  • Introduce prediction_index on Task subclasses and propagate it into predict calls.
  • Prefix verbose logs and raised errors with the index when supplied.
  • Update main.py to assign and increment prediction_index for each task and adjust error handling to report indices.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cog_safe_push/tasks.py Added prediction_index field; prefixed log.v and raise calls with index
cog_safe_push/predict.py Extended predict signature to accept prediction_index and prefix logs
cog_safe_push/main.py Initialized/incremented prediction_index for tasks and updated error aggregation to include indices
Comments suppressed due to low confidence (2)

cog_safe_push/tasks.py:177

  • This if error is not None block is redundant and unreachable because any non-None error would have triggered an earlier check; consider removing this duplicate error check.
if error is not None:

cog_safe_push/predict.py:236

  • [nitpick] There are no tests verifying that prediction_index is correctly propagated and prefixed in logs; consider adding unit tests to assert the behavior when prediction_index is set and unset.
prefix = f"[{prediction_index}] " if prediction_index is not None else ""

andreasjansson and others added 2 commits May 28, 2025 20:45
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant