Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
60589e8
agent threads: thread id and grant on the worker and the HTTP preamble
theomonnom Oct 8, 2026
b054167
generated protobuf
github-actions[bot] Oct 8, 2026
b820d54
agentdb: tag batch results with their statement index
theomonnom Oct 8, 2026
df2a6b0
agent: add run_started and run_ended to AgentSessionEvent
theomonnom Oct 6, 2026
e52801b
Merge #1841 (subject, times, CreateThreadDatabase, MergeThread); prea…
theomonnom Oct 8, 2026
be4c975
Merge remote-tracking branch 'origin/theo/agent-threads-runtime' into…
theomonnom Oct 8, 2026
39b5da9
generated protobuf
github-actions[bot] Oct 8, 2026
9910278
Merge remote-tracking branch 'origin/theo/agent-threads-api' into the…
theomonnom Oct 8, 2026
d5ad07d
Merge #1841: the wire grant is scope, ids and flags
theomonnom Oct 8, 2026
bdb68e6
Merge remote-tracking branch 'origin/theo/agent-threads-runtime' into…
theomonnom Oct 8, 2026
88b2915
Merge remote-tracking branch 'origin/theo/agent-threads-api' into the…
theomonnom Oct 8, 2026
9e07f67
generated protobuf
github-actions[bot] Oct 8, 2026
58b8997
Revert "agentdb: tag batch results with their statement index"
theomonnom Oct 8, 2026
701c4e8
Revert "agent: add run_started and run_ended to AgentSessionEvent"
theomonnom Oct 8, 2026
7329238
generated protobuf
github-actions[bot] Oct 8, 2026
1639dbc
Merge remote-tracking branch 'origin/theo/agent-threads-api' into the…
theomonnom Oct 8, 2026
dedb260
Merge remote-tracking branch 'origin/theo/agent-threads-runtime' into…
theomonnom Oct 8, 2026
94e43b4
agent threads: drop UpdateThreadStatus
theomonnom Oct 8, 2026
86e999c
generated protobuf
github-actions[bot] Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/agent-threads-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"github.com/livekit/protocol": minor
"@livekit/protocol": minor
---

Agent threads on the agent runtime: `Job.thread_id` and `AgentHttp.StreamPreamble.thread_id` / `thread_grant` (`AgentHttp.AgentThreadGrant`). `auth.AgentThreadGrant.ToProto` converts the claim for the preamble.
17 changes: 17 additions & 0 deletions auth/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,23 @@ func (s *AgentThreadGrant) Clone() *AgentThreadGrant {
return &clone
}

// ToProto is the grant as the node forwards it to the worker in
// AgentHttp.StreamPreamble.thread_grant; nil stays nil.
func (s *AgentThreadGrant) ToProto() *livekit.AgentHttp_AgentThreadGrant {
if s == nil {
return nil
}
return &livekit.AgentHttp_AgentThreadGrant{
Scope: s.Scope,
ThreadIds: append([]string{}, s.ThreadIDs...),
List: s.List,
Create: s.Create,
Write: s.Write,
Read: s.Read,
Delete: s.Delete,
}
}

func (s *AgentThreadGrant) MarshalLogObject(e zapcore.ObjectEncoder) error {
if s == nil {
return nil
Expand Down
2 changes: 1 addition & 1 deletion livekit/agent/livekit_agent_thread.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

198 changes: 168 additions & 30 deletions livekit/livekit_agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion protobufs/livekit_agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ message Job {
string deployment = 11;
map<string, string> attributes = 12 [(logger.sensitivity) = SENSITIVITY_PII];
bool enable_redaction = 13;
// the thread ("AT_...") this job continues; empty when dispatch made none
string thread_id = 14 [(logger.name) = "threadID"];
}

message JobState {
Expand Down Expand Up @@ -297,7 +299,26 @@ message AgentHttp {
string client_addr = 6 [(logger.sensitivity) = SENSITIVITY_PII];
// "http" or "https" as the end client saw it; not derivable worker-side
string scheme = 7;
// NEXT_ID: 8
// the thread ("AT_...") the node resolved for this request; empty when
// none, and the worker resolves it from the body
string thread_id = 8 [(logger.name) = "threadID"];
// the verified agentThread claim of the caller's token, which never
// reaches the worker; the worker enforces it on the addressed thread
AgentThreadGrant thread_grant = 9;
// NEXT_ID: 10
}

// auth.AgentThreadGrant on the wire: threads by scope or by id, with
// per-action flags
message AgentThreadGrant {
reserved 1, 9;
string scope = 2;
repeated string thread_ids = 3 [(logger.name) = "threadIDs"];
bool list = 4;
bool create = 5;
bool write = 6;
bool read = 7;
bool delete = 8;
}

// why a stream was reset before any HTTP bytes flowed. This travels as the
Expand Down
Loading