Skip to content

fix: forward the caller identity when creating an instance - #43

Merged
vitramir merged 1 commit into
mainfrom
fix/forward-identity-on-instance-create
Aug 1, 2026
Merged

fix: forward the caller identity when creating an instance#43
vitramir merged 1 commit into
mainfrom
fix/forward-identity-on-instance-create

Conversation

@vitramir

@vitramir vitramir commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Adding an agent class to a thread creates an instance for it, and Agents checks that the caller can initiate that class. Threads called CreateInstance with no identity metadata at all, so Agents refused:

create agent instance: rpc error: code = Unauthenticated
desc = identity not available: x-identity-id not found in metadata

Class-on-add is the path the whole agent instance feature depends on, so it failed outright. Found running the go-core suite against the local VM — TestWorkloadStartsOnUnackedMessage.

The identity is forwarded rather than the call being made as Threads: the instance is created on behalf of whoever is adding the agent, so the check stays on that principal instead of moving to a peer service. identityClientContext already existed for exactly this and three other call sites use it.

Adding an agent class to a thread creates an instance for it, and Agents
checks that the caller can initiate that class. Threads called
CreateInstance with no identity metadata at all, so Agents refused with
"identity not available" and class-on-add failed outright -- the path the
whole agent instance feature depends on.

The identity is forwarded rather than the call being made as Threads: the
instance is created on behalf of whoever is adding the agent, so the
check stays on that principal instead of moving to a peer service.
@vitramir
vitramir merged commit 5e882de into main Aug 1, 2026
1 check passed
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.

1 participant