Repository navigation
feat(agent): lk agent private-link through the Public API when signed in - #1142
Open
Topherhindman wants to merge 3 commits into
Open
Topherhindman wants to merge 3 commits into
Topherhindman wants to merge 3 commits into
Conversation
Topherhindman
force-pushed
the
topherhindman/agent-user-auth-private-links
branch
from
November 24, 2026 05:03
8e179e2 to
31b0614
Compare
Topherhindman
force-pushed
the
topherhindman/agent-user-auth-private-links
branch
from
November 24, 2026 20:49
31b0614 to
d1d4199
Compare
Topherhindman
force-pushed
the
topherhindman/agent-user-auth-private-links
branch
from
December 1, 2026 00:29
d1d4199 to
517d0dd
Compare
Topherhindman
force-pushed
the
topherhindman/agent-user-auth-private-links
branch
from
December 1, 2026 05:07
517d0dd to
5de96e5
Compare
ListPrivateLinks returns each link with its health, which the API reads for every link itself; a link whose health it couldn't read comes without one.
Under --user-auth, lk agent private-link create, list, health-status and delete call the Public API's AgentService, which a WRITE member may call, in place of the token bridge, which needs a project admin. The Public API reads every link's health in its list call, so list makes one call where it made one for each link; a link whose health the Public API couldn't read shows an error, as one whose health cloud agents refuses does.
The Public API's CreatePrivateLink now returns privateLink as ListPrivateLinks returns each item: the link under link, and its health under status, which is unset when LiveKit couldn't read it. lk read the link from privateLink itself, so with the new shape it decoded an empty link and printed "Created private link []". CreatePrivateLink now returns a PrivateLink, as ListPrivateLinks does, and both decode it the same way. lk agent private-link create under --user-auth prints only the link, as it does with an API key, since cloud agents' CreatePrivateLink returns no health.
Topherhindman
force-pushed
the
topherhindman/agent-user-auth-private-links
branch
from
December 3, 2026 00:33
5de96e5 to
13e3ad1
Compare
Topherhindman
marked this pull request as ready for review
December 3, 2026 00:58
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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.
Under
--user-auth,lk agent private-link create,list,health-statusanddeletenow go through the Public API'sAgentServicein place of the token bridge. The bridge needsAgent.Admin, so before this only a project admin could manage private links. Now a WRITE member can, as in the dashboard.Stacked on #1141.
Commands after this PR (every
lk agentcommand that calls LiveKit Cloud)--user-authagent list,status,config,versions,dockerfile, buildlogsAgentService(#1138, #1139)agent secretsAgentService(#1139)agent restart,rollback,promoteAgentService(#1140)agent delete,update-secrets,updatewith secretsAgentService(#1140)agent create,deploy(source),init --deployAgentService(#1141)agent private-link create,list,health-status,deleteAgentService(this PR)agent create --image/--image-tar,deploy --image/--image-tarlogs,update-secrets --overwriteWhat's in it
feat(public):CreatePrivateLink,ListPrivateLinks(each link with its health, or with none when the API couldn't read it),DeletePrivateLinkandGetPrivateLinkStatus. Links and statuses decode as LiveKit's own protos, as agents do. The client was regenerated in feat(agent): lk agent create and deploy from source through the Public API when signed in #1141.feat(agent): the fourprivateLinkAPImethods inuserAuthAgentAPI.listPrivateLinksnow gets the links and their health fromprivateLinksWithHealth. With an API key it still makes one status call for each link. Under--user-authit uses the health that the Public API's one list call returns, through a small optional interface,privateLinkHealthLister.Decisions
Errorwith "LiveKit could not read its health", in the table's Reason column and inhealth_errorwith--json. That is the same shape as a status call that fails with an API key.unable to <verb> private link:prefix.private-link listas their example of a bridged command. They now useupdate-secrets --overwrite, which is still bridged.Output differences vs the API-key path
listandhealth-statusoutput in full across both modes.--user-auth. With an API key, the reason is cloud agents' error text.Open questions
agent:manage(WRITE), as the dashboard does. Should they beagent:read? (livekit/public-api-server#243)CreatePrivateLinkRequest.config(the AWS oneof), and the Public API doesn't take it. Nothing is lost today.Blockers
pkg/publicgenerated from livekit/public-api-server@372fb27e (production v2026-12-02-2258).Testing
GOPRIVATE= go build ./...,go vet ./cmd/lk/... ./pkg/...,go test ./cmd/lk/... ./pkg/...andgolangci-lint run ./cmd/lk/... ./pkg/public/...pass.agent-private-links-with-user-auth:create,list,health-statusanddelete, once with an API key (fake cloud agents) and once under--user-auth(fake Public API), with the same expected table output. Also covers a link listed without its health (--json), and a READ member's refusal. The request log shows one list call and no token request under--user-auth.privateLinksWithHealthin both modes (N status calls and a kept error with the SDK; one call anderrHealthUnreadunder--user-auth), each native method's response shape, a role refusal and a NotFound. Thepkg/publictests cover each call's request and decoding, including a missing health, more than one page and a missing link.Review fixes
Demo
Recorded on staging, not uploaded yet:
~/hosted-agents-work/demos/M5/m5-private-links.mp4(write-up~/hosted-agents-work/demos/M5/README.md). Read-only: no private link was created. WRITE lists private links and gets NotFound for an unknown one; READ is refused list and create (refused before any cloud-agents call).Depends on #1136 (the hints name
lk agent builder).