Repository navigation
agent: add agent_job_pending webhook, JS_CANCELLED status and JobState.reason - #1860
Merged
Merged
Conversation
…e.reason agent_job_pending reports a dispatched job that is still waiting for an agent, with JobState.reason saying why (e.g. no capacity). A job that ends before any agent is assigned is reported as agent_job_ended with the new JS_CANCELLED status, and the reason distinguishes a closed room from a deleted dispatch, so it can be told apart from JS_FAILED. Generated Go/JS bindings are produced by the Generate workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 2d216e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
paulwe
approved these changes
Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Extends the agent job lifecycle webhooks to cover jobs that never reach an agent:
agent_job_pending: a new webhook event (webhook.EventAgentJobPending). It is sent while a dispatched job is still waiting for an agent and carries thejobwithstate.status = JS_PENDING.JS_CANCELLED: a newJobStatusfor a job that ended before it was assigned to an agent. It is reported throughagent_job_ended, so customers can tell "never dispatched" apart fromJS_FAILED.JobState.reason(JobStateReason): says why a job has no agent.JSR_NO_CAPACITY: used onagent_job_pending.JSR_ROOM_CLOSED/JSR_DISPATCH_DELETED: used withJS_CANCELLED.JSR_RETRYING: used onagent_job_pendingwhen a failed job is being dispatched again.WebhookEvent.eventcomment and adds a changeset.Only
.proto, hand-written Go and the changeset are committed; the Generate workflow produces the Go/JS bindings.Compatibility
JS_CANCELLEDandreasonare only set for jobs that were never assigned, so workers never receive them for their own jobs.Undefinedfor unknown statuses.Verification
protoc --descriptor_set_outonlivekit_agent.protoandlivekit_webhook.protosucceeds.go build ./webhook/passes.go build ./...passes, andgo test -racepasses for./webhook/...,./livekit/...and./observability/agentsobs/....Related: #1711
🤖 Generated with Claude Code