Skip to content

Fix delete/get/list_dispatch: keyword auth_header + ClientResp .data unwrap#91

Closed
trialize wants to merge 1 commit into
livekit:mainfrom
trialize:fix/agent-dispatch-auth-header-and-resp-unwrap
Closed

Fix delete/get/list_dispatch: keyword auth_header + ClientResp .data unwrap#91
trialize wants to merge 1 commit into
livekit:mainfrom
trialize:fix/agent-dispatch-auth-header-and-resp-unwrap

Conversation

@trialize

@trialize trialize commented Jun 25, 2026

Copy link
Copy Markdown

Problem

AgentDispatchServiceClient#delete_dispatch, #get_dispatch, and #list_dispatch are unusable as shipped:

  1. Positional grant → ArgumentError. All three pass the grant positionally to AuthMixin#auth_header, which only accepts the video_grant: keyword:

    headers: auth_header(VideoGrant.new(roomAdmin: true, room: room_name))

    Every call raises ArgumentError: wrong number of arguments (given 1, expected 0) from auth_mixin.rb before any request is sent. #create_dispatch is the only method that passes the keyword correctly.

  2. res.agent_dispatches off a ClientResp. #get_dispatch / #list_dispatch read res.agent_dispatches directly off the Twirp::ClientResp returned by rpc, instead of res.data.agent_dispatches — a NoMethodError that the first bug masked.

Fix

Minimal: pass video_grant: and unwrap res.data in the three methods. #create_dispatch is unchanged.

Verification

Against a live LiveKit server: create_dispatchlist_dispatch (shows the dispatch) → delete_dispatchlist_dispatch (gone), all returning cleanly. Before the fix each of the three raised ArgumentError from auth_mixin.rb.

…nwrap

delete_dispatch, get_dispatch and list_dispatch pass the grant positionally to AuthMixin#auth_header, which only accepts the `video_grant:` keyword, so every call raises ArgumentError ("wrong number of arguments (given 1, expected 0)") before reaching the server. create_dispatch is the only method that passes it correctly.

get_dispatch and list_dispatch additionally read .agent_dispatches directly off the Twirp::ClientResp returned by rpc, rather than its .data payload — a latent NoMethodError the auth_header bug masked.

Pass video_grant: and unwrap res.data in all three methods.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@trialize trialize requested a review from a team as a code owner June 25, 2026 10:46
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@trialize trialize closed this Jun 25, 2026
@trialize trialize deleted the fix/agent-dispatch-auth-header-and-resp-unwrap branch June 25, 2026 10:56
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