Skip to content

Commit 78625f8

Browse files
erikhortschclaudegithub-actions[bot]
authored
agent: add agent_job_pending webhook, JS_CANCELLED status and JobState.reason (#1860)
* agent: add agent_job_pending webhook, JS_CANCELLED status and JobState.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> * generated protobuf * agent: add JSR_RETRYING job state reason Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * generated protobuf --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d5d1282 commit 78625f8

6 files changed

Lines changed: 189 additions & 84 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"github.com/livekit/protocol": patch
3+
"@livekit/protocol": patch
4+
---
5+
6+
Add `agent_job_pending` webhook event, `JS_CANCELLED` job status, and `JobState.reason` (including `JSR_RETRYING`)

‎livekit/livekit_agent.pb.go‎

Lines changed: 164 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎livekit/livekit_webhook.pb.go‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎protobufs/livekit_agent.proto‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ message JobState {
4747
string participant_identity = 6;
4848
string worker_id = 7 [(logger.name) = "workerID"];
4949
string agent_id = 8 [(logger.name) = "agentID"];
50+
// why the job has no agent, for JS_PENDING and JS_CANCELLED jobs
51+
JobStateReason reason = 9;
5052
}
5153

5254
// from Worker to Server
@@ -101,6 +103,20 @@ enum JobStatus {
101103
JS_RUNNING = 1;
102104
JS_SUCCESS = 2;
103105
JS_FAILED = 3;
106+
// the job ended before it was assigned to an agent
107+
JS_CANCELLED = 4;
108+
}
109+
110+
enum JobStateReason {
111+
JSR_UNSPECIFIED = 0;
112+
// no agent was available to accept the job
113+
JSR_NO_CAPACITY = 1;
114+
// the room closed before an agent was assigned
115+
JSR_ROOM_CLOSED = 2;
116+
// the dispatch was deleted before an agent was assigned
117+
JSR_DISPATCH_DELETED = 3;
118+
// the job failed and is being dispatched again
119+
JSR_RETRYING = 4;
104120
}
105121

106122
message SimulateJobRequest {

0 commit comments

Comments
 (0)