Skip to content

Conversation

@grutt
Copy link
Contributor

@grutt grutt commented Feb 1, 2026

Description

Improves visibility into concurrency queue state and scheduling timeouts by providing more context in the UI and event logs.

Type of change

  • New feature (non-breaking change which adds functionality)

What's Changed

  • Added real-time concurrency queue status to task detail view: For QUEUED tasks with concurrency keys, the UI now displays:

    • The concurrency key value
    • Queue position (e.g., "# 1 in queue")
    • Count of pending tasks waiting in the queue
    • Count of running tasks with the same key (and max concurrency limit)
    • Clickable popovers showing lists of pending/running tasks with links to their run details
  • Enhanced scheduling timeout event messages: When a schedule timeout occurs, the event log now specifies the cause:

    • "Scheduling timed out while waiting for an available worker" - when no worker was available
    • "Scheduling timed out while waiting for concurrency key: <expression>" - when waiting for a concurrency slot
    • "Scheduling timed out while waiting for a concurrency slot" - when waiting for concurrency (without expression context)
  • Added new API endpoint data: The V1TaskSummary response now includes an optional concurrencyStatus field with:

    • Slot-level information including key, expression, maxRuns
    • Queue position and pending/running counts
    • Lists of pending and running task IDs and display names (limited to 10 each)
image

Hatchet
Hatchet · 7 10pm · 01-31
Hatchet · 7 10pm · 01-31 (1)

@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Feb 1, 2026 0:49am

Request Review

result := transformers.ToTask(taskWithData, workflowRunExternalId, workflowVersion)
// Get concurrency status for QUEUED tasks
var concurrencyStatus []*repository.ConcurrencySlotStatus
if string(taskWithData.Status) == string(gen.V1TaskStatusQUEUED) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we want to put this on it's own end point

FROM
updated_slots;

-- name: GetConcurrencySlotStatus :many
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be smart to profile this query

Copy link
Contributor

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 end-to-end “concurrency wait visibility” by exposing per-task concurrency queue status through the API and rendering it in the task detail UI, plus clearer scheduling-timeout messages in event logs.

Changes:

  • Extend task summary API (V1TaskSummary) with optional concurrencyStatus containing queue position/counts and up to 10 pending/running tasks.
  • Add a repository query/handler plumbing to fetch concurrency slot status for QUEUED tasks.
  • Improve scheduling timeout event messages to distinguish “no worker available” vs “waiting on concurrency”.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/scheduling/v1/concurrency.go Propagates strategy expression alongside concurrency results for richer timeout messages.
internal/services/scheduler/v1/scheduler.go Emits more descriptive scheduling-timeout event messages.
pkg/repository/sqlcv1/concurrency.sql Adds GetConcurrencySlotStatus query to fetch queue state and related task lists.
pkg/repository/sqlcv1/concurrency.sql.go sqlc-generated Go for the new concurrency status query.
pkg/repository/task.go Adds GetConcurrencySlotStatus repo method and result mapping helpers.
api/v1/server/handlers/v1/tasks/get.go Fetches concurrency slot status for QUEUED tasks and passes it into the transformer.
api/v1/server/oas/transformers/v1/tasks.go Maps repository concurrency status into the OpenAPI V1TaskSummary model.
api-contracts/openapi/components/schemas/v1/task.yaml Adds concurrencyStatus and related schemas to the OpenAPI contract.
api/v1/server/oas/gen/openapi.gen.go Generated OpenAPI server types updated to include concurrency status models/fields.
pkg/client/rest/gen.go Generated REST client types updated to include concurrency status models/fields.
frontend/app/src/lib/api/generated/data-contracts.ts Frontend API contracts updated with concurrency status types.
frontend/app/src/pages/.../step-run-detail.tsx UI renders concurrency queue state with popovers linking to queued/running tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…nts/step-run-detail/step-run-detail.tsx

Co-authored-by: Copilot <[email protected]>
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.

2 participants