Skip to content

Read and write an agent's name through its attributes - #143

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:fix-agent-name
Oct 28, 2026
Merged

brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:fix-agent-name

Conversation

@brionmario

@brionmario brionmario commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Purpose

The ThunderID server no longer has a top-level name on agents (thunder-id/thunderid@9114cab02, "Move the agent name into the agent type schema"). An agent's name is now the name attribute in attributes, and reads made with include=display also return display, the display value the server resolves from those attributes. CreateAgentRequest and UpdateAgentRequest have no name field.

The SDKs still sent and read a top-level name, so:

  • AgentCreate registered agents with no name, because the server drops the field.
  • AgentDetails showed an empty title and asked "Delete undefined?".
  • The AgentList name column was blank.
  • Agent candidates in RoleAssignments and GroupMembers had blank labels.

This surfaced in the Admin Console E2E tests on thunder-id/thunderid#6164.

Search is unaffected: getAgents and getAgent already request include=display, and the server matches the name eq "x" filter against the name attribute.

Approach

  • Models (@thunderid/javascript, models/agent-resource.ts):
    • Agent and BasicAgent: name is replaced by display?: string, the server-resolved display value from reads with include=display. Agent keeps attributes, and BasicAgent gains it, since list responses carry it.
    • CreateAgentRequest and UpdateAgentRequest: name is removed; the name goes in attributes.name.
    • The createAgent and updateAgent doc examples now use attributes: {name}.
  • getAgentName(agent): a new util in @thunderid/javascript. It returns display, then attributes.name when that's a non-empty string, then the agent's id. React and Vue re-export it, and Next.js and Nuxt get it through them.
  • React and Vue components:
    • AgentList/BaseAgentList: the name column uses getAgentName.
    • AgentDetails/BaseAgentDetails: the title, the lifecycle confirmation and the delete confirmation use getAgentName.
    • AgentCreate sends attributes: {name}. BaseAgentCreate's form and its {name, type, description} submission are unchanged.
    • RoleAssignments and GroupMembers label agent candidates with getAgentName.
  • Next.js, Nuxt and Node: nothing breaks. Their agent components wrap the React and Vue ones, and @thunderid/node's management client only passes the request types through.
  • Playgrounds (React, Vue, Next.js, Nuxt): the SAMPLE_AGENTS data now carries attributes.name and display, and the stories, custom-render snippets and agentMemberships capability checks use getAgentName.

Related Issues

  • N/A

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
      • packages/javascript/src/utils/__tests__/getAgentName.test.ts: display wins, then attributes.name, then id.
      • packages/react/src/components/admin/__tests__/adminComponents.test.tsx ("agent names"): the list falls back from display to attributes.name to id; the details title and delete confirmation use the name attribute; AgentCreate posts {attributes: {name}, ouId, type}.
      • packages/vue/src/__tests__/components/admin/admin-components.test.ts: the same list and details cases; the AgentCreate test now asserts the exact {attributes: {name}, ouId, type} payload.
      • The existing agent fixtures now use attributes.name and display.
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.
  • Cross-SDK parity. Exactly one of parity/prs-raised or parity/prs-not-needed added.
    • If parity/prs-raised, the port links are posted as a reply on the parity check's comment.
    • No sample is affected: b2b/manage declares its own agent type, reads display first and creates agents through a flow.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

The ThunderID server no longer has a top-level name on agents
(thunder-id/thunderid 9114cab02, "Move the agent name into the agent type
schema"). An agent's name is now the `name` attribute in `attributes`, and
reads made with `include=display` also return `display`, the display value
the server resolves from those attributes. The SDKs still sent and read a
top-level `name`, so AgentCreate registered agents without a name (the
server drops the field), AgentDetails showed an empty title and asked
"Delete undefined?", the AgentList name column was blank, and agent
candidates in RoleAssignments and GroupMembers had blank labels.

- Models: `Agent` and `BasicAgent` drop `name` and gain `display`;
  `BasicAgent` gains `attributes`. `CreateAgentRequest` and
  `UpdateAgentRequest` drop `name`; the name goes in `attributes.name`.
- Add `getAgentName(agent)` to @thunderid/javascript. It returns
  `display`, then a non-empty `attributes.name`, then the agent's id.
  React and Vue re-export it.
- React and Vue: AgentList, AgentDetails (title, lifecycle confirmation
  and delete confirmation), RoleAssignments and GroupMembers label agents
  with getAgentName. AgentCreate sends `attributes: {name}`;
  BaseAgentCreate's form and submission are unchanged.
- Update the doc examples, tests and playground samples, stories and
  capability checks to the new shape.

Signed-off-by: Brion <info@brionmario.com>
@brionmario brionmario added bug Something isn't working parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there labels Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🔀 Cross-SDK feature parity, ports raised

This pull request is labelled parity/prs-raised, so the capability it introduces is expected in the other ThunderID SDKs as well.

Ports (DO NOT EDIT)

  • thunder-id/ios-sdks, iOS => #37
  • thunder-id/android-sdks, Android => #45
  • thunder-id/flutter-sdks, Flutter => #58

3 of 3 sibling SDKs accounted for.

Every sibling SDK is accounted for.

The contract is in the SDK development specification.

@brionmario

Copy link
Copy Markdown
Member Author

@brionmario
brionmario merged commit e0aff55 into thunder-id:main Oct 28, 2026
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants