Skip to content

Add error_generator test worker and handle_error decorator#136

Open
arjunrajlab wants to merge 2 commits intomasterfrom
claude/add-error-generator-test-worker
Open

Add error_generator test worker and handle_error decorator#136
arjunrajlab wants to merge 2 commits intomasterfrom
claude/add-error-generator-test-worker

Conversation

@arjunrajlab
Copy link
Copy Markdown
Collaborator

Summary

  • New error_generator test worker with checkbox options to trigger various error conditions: sendWarning, sendError, HTTP 500/503/504 crashes, OOM, immediate crash, and crash-after-progress. Used for developing/testing frontend error reporting.
  • New @handle_error decorator in annotation_utilities/progress.py that catches unhandled exceptions and sends user-friendly sendError() messages before re-raising (e.g. "Servers busy. Try again in a few minutes." for 503/504, "Out of memory. Check logs for details." for MemoryError).
  • See Add @handle_error decorator to all workers #135 for rolling the decorator out to all workers.

Test plan

  • Build: docker compose build test-worker-base && ./build_test_workers.sh error_generator
  • Deploy and run the error generator worker with each checkbox enabled
  • Verify frontend shows friendly error messages (not raw tracebacks)
  • Verify the worker still exits non-zero (shows "X" in frontend)

🤖 Generated with Claude Code

arjunrajlab and others added 2 commits March 25, 2026 20:28
Add a new test worker that generates various error conditions (warnings,
errors, HTTP 500/503/504, OOM, crashes) via checkboxes for testing
frontend error reporting.

Add a @handle_error decorator to annotation_utilities that catches
unhandled exceptions and sends user-friendly sendError() messages
before re-raising. See #135 for adding this to all workers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 994b852823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +177
sendProgress(step / total_steps * 0.9, 'Error Generator',
f'Simulating HTTP 500 ({step}/{total_steps})')
# Show some progress first, like a real worker would
for i in range(3):
frac = 0.05 * (i + 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use monotonic progress values for HTTP simulations

This branch emits sendProgress(step / total_steps * 0.9, ...) and then immediately emits smaller fixed fractions (0.05, 0.10, 0.15), so with common inputs (e.g., only Simulate HTTP 500 selected) progress jumps from 90% back down to 5%. That regression can confuse frontend progress handling and makes error-flow testing noisy; the same pattern is repeated in the 503/504 branches as well.

Useful? React with 👍 / 👎.

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