Skip to content

fix: let an instance name itself - #74

Merged
vitramir merged 1 commit into
mainfrom
fix/instance-names-itself
Aug 1, 2026
Merged

fix: let an instance name itself#74
vitramir merged 1 commit into
mainfrom
fix/instance-names-itself

Conversation

@vitramir

@vitramir vitramir commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

identity.SetNickname authorizes on who the caller is:

  • caller == subject → plain member on the organization is enough
  • caller != subject → needs can_manage_members or can_add_member

setAgentInstanceNickname forwarded the caller's identity. Instances are created from a thread, so that caller is an ordinary participant with neither of those permissions — and the Orchestrator reaches instance creation over the mesh with no caller at all, failing in identityOutgoingContext before the call was even made.

The instance itself already holds an organization membership tuple at this point (addAgentInstanceAuthorization runs before the nickname is set, and registerAgentInstanceIdentity before that), so it is the one caller that is always allowed. It now names itself — the same shape as apps#28.

Why no test caught it: this fix has existed only as a patch the E2E workflow applied to instances.go at build time. The workflow now fails outright — agents instances.go import block not found — because the anchor moved when "strings" was added to the imports. Two tests pin the behaviour instead; both fail on main.

Removing that patch from the E2E workflow is a follow-up in agynio/e2e.

Identity lets a caller set its own nickname with plain organization
membership, and set anyone else's only with can_manage_members. Instances
are created from a thread, so forwarding the caller presents an ordinary
participant who has neither -- and the Orchestrator reaches this over the
mesh with no caller at all, which failed before the call was even made.

The instance holds an organization membership tuple by this point:
addAgentInstanceAuthorization runs before the nickname is set. So it is
the one caller that is always allowed, and it names itself.

This lived as a patch the E2E workflow applied to this file at build
time, which is how it stayed invisible here.
@vitramir
vitramir merged commit cabd508 into main Aug 1, 2026
1 of 2 checks 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