Skip to content

Conversation

@ric-yu
Copy link
Contributor

@ric-yu ric-yu commented Jan 7, 2026

Summary

  • Adds a new cancelled status to the /api/jobs endpoint for jobs that were interrupted/cancelled by the user
  • Previously, both failed and cancelled jobs were returned with status: 'failed', making it impossible to distinguish between them
  • Now cancelled jobs return status: 'cancelled' while actual errors return status: 'failed'

Changes

  • Added JobStatus.CANCELLED = 'cancelled' constant
  • Updated normalize_history_item() to detect execution_interrupted messages and return cancelled status
  • Updated get_all_jobs() to support filtering by cancelled status
  • Added unit test for cancelled job normalization

API Usage

GET /api/jobs?status=cancelled       # Only cancelled jobs
GET /api/jobs?status=failed          # Only failed jobs (actual errors)
GET /api/jobs?status=failed,cancelled # Both

Test plan

  • Unit tests pass (pytest tests/execution/test_jobs.py - 28/28 passing)
  • Manual test: interrupt a running job and verify it shows status: 'cancelled'
  • Manual test: trigger an error and verify it shows status: 'failed'

🤖 Generated with Claude Code

@ric-yu ric-yu marked this pull request as draft January 7, 2026 00:08
@ric-yu ric-yu force-pushed the feat/jobs-cancelled-status branch from d44c234 to 2d39630 Compare January 7, 2026 00:09
@ric-yu ric-yu marked this pull request as ready for review January 7, 2026 00:12
@yoland68
Copy link
Member

yoland68 commented Jan 7, 2026

Can I still comment?

@ric-yu
Copy link
Contributor Author

ric-yu commented Jan 7, 2026

Can I still comment?

Go for it, what's up?

@Kosinkadink
Copy link
Member

I think he was testing if things work after the transfer

@ric-yu
Copy link
Contributor Author

ric-yu commented Jan 7, 2026

I think he was testing if things work after the transfer

Makes sense. Can I merge this myself? Is there another step?

Copy link
Member

@guill guill left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants