Skip to content

Add JobJoinTiming to UpdateJobStatus - #1900

Merged
boks1971 merged 6 commits into
mainfrom
raja/agent-join-timing
Nov 4, 2026
Merged

boks1971 merged 6 commits into
mainfrom
raja/agent-join-timing

Conversation

@boks1971

@boks1971 boks1971 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

An agent worker cannot tell the server the time of each step of an agent join. The server sees only two points: the job offer and the agent joining the room. This PR adds a place for the worker to report the steps between those two points.

Change

UpdateJobStatus gets a new field, join_timing, of the new message JobJoinTiming. After the agent connects to the room, the worker sets it once.

Field The worker reads its clock at this point
offer_received_us the job offer arrives
accepted_us the worker accepts the job
assignment_received_us the job assignment arrives
launched_us a job process gets the job
launch_warm true: an idle process took the job. false: the worker started a new one, and launched_us also covers the agent's prewarm function
entrypoint_started_us the agent entrypoint starts
connect_called_us the agent calls connect
connected_us the agent's WebRTC connection is up

The values are instants on the worker host's monotonic clock, in microseconds. The server can subtract them from each other directly. To line them up with its own times, the server needs a clock offset, for example from the offer and accept round trip. The change only adds fields, so old servers and old workers keep working.

🤖 Generated with Claude Code

@boks1971 boks1971 self-assigned this Oct 27, 2026
@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 619a57f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
github.com/livekit/protocol Patch
@livekit/protocol Patch

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

Comment thread protobufs/livekit_agent.proto Outdated
Comment on lines +216 to +217
int64 prewarm_started_us = 6; // the agent's prewarm function, in the process that took the job
int64 prewarm_ended_us = 7;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
int64 prewarm_started_us = 6; // the agent's prewarm function, in the process that took the job
int64 prewarm_ended_us = 7;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO we can remove those two, they're going to get removed in 2.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do @theomonnom . We can add it later if it fits in a different bucket.

boks1971 and others added 6 commits November 4, 2026 13:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prewarm goes away in Agents 2.0. Fields renumbered before release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boks1971
boks1971 marked this pull request as ready for review November 4, 2026 08:08
@boks1971
boks1971 force-pushed the raja/agent-join-timing branch from 580fb99 to 619a57f Compare November 4, 2026 08:20
@boks1971
boks1971 merged commit 5e17629 into main Nov 4, 2026
8 checks passed
@boks1971
boks1971 deleted the raja/agent-join-timing branch November 4, 2026 12:41
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
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