Skip to content

Read and send an agent's owner as an object - #157

Open
thiva-k wants to merge 1 commit into
thunder-id:mainfrom
thiva-k:agent-owner-object
Open

thiva-k wants to merge 1 commit into
thunder-id:mainfrom
thiva-k:agent-owner-object

Conversation

@thiva-k

@thiva-k thiva-k commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

ThunderID is changing an agent's owner from a string to an object, so the owner can be a person managed in another identity system (thunder-id/thunderid#6435):

"owner": {"id": "jane@example.com", "idType": "email", "isLocal": false}

The SDK still models owner as a string. Agent details render it as text, so once the server returns the object, AgentDetails throws (React error #31) and the whole admin page goes blank. This is what fails the agent e2e tests on thunder-id/thunderid#6435, whose data plane admin console uses @thunderid/react's AgentDetails. Agent create also sends the owner as a string, which the server now rejects with 400 AGT-1001.


⚠️ Breaking Changes

🔧 Summary of Breaking Changes

  • owner on Agent, CreateAgentRequest and UpdateAgentRequest changes from string to AgentOwner.
  • The owner prop of AgentCreate (React and Vue) changes from string to AgentOwner.

💥 Impact

Code that reads agent.owner as a string, or passes a string owner to AgentCreate or the create and update requests, no longer type-checks. It must ship together with thunder-id/thunderid#6435, since the server change breaks the string form anyway.

🔄 Migration Guide

Read the owner's ID from agent.owner?.id, and pass the owner as an object:

<AgentCreate owner={{id: userId}} />

idType defaults to uuid and isLocal to true, so {id: userId} names a user of the same deployment.


Approach

  • @thunderid/javascript: adds AgentOwner (id, optional idType, optional isLocal) and AgentOwnerIdType. Both are exported and used on Agent, CreateAgentRequest and UpdateAgentRequest.
  • @thunderid/react and @thunderid/vue: BaseAgentDetails shows agent.owner?.id, still falling back to "No owner". AgentCreate takes the owner as an AgentOwner and sends it unchanged, so a caller can also name an external owner.
  • Playgrounds (React, Vue, Next.js, Nuxt): the sample agents use the object, and the React AgentCreate story passes and prints the owner as {id}.

No new strings, so no translation changes.

Related Issues

  • N/A

Related PRs

SDK parity

Verification

  • turbo run build typecheck --continue passes for every package and playground (the playgrounds failed before they were updated). The one exception is the @thunderid/nuxt typecheck, which cannot run locally because vue-tsc is not installed.
  • Unit tests: @thunderid/javascript 1160 passed, @thunderid/react 730 passed, including new tests for the owner in BaseAgentDetails and the owner object sent by AgentCreate. In @thunderid/vue the admin component tests (64, including the new owner tests) pass. 12 tests in five unrelated files (flow select, user select wiring, consent decisions, key-value list, OTP field) fail locally with Failed to set an indexed property [0] on 'CSSStyleDeclaration'. None of them touch agents, and they were not run against main to confirm they fail there too.
  • prettier --check passes on the changed files. lint reports existing errors in javascript, nextjs and express, none in the changed files.

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
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added. (The repository has no such label.)
  • 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.

Security checks

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

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 5, 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

@github-actions

github-actions Bot commented Nov 5, 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 => #43
  • thunder-id/android-sdks, Android => #51
  • thunder-id/flutter-sdks, Flutter => #65

3 of 3 sibling SDKs accounted for.

Every sibling SDK is accounted for.

The contract is in the SDK development specification.

ThunderID now returns and accepts an agent's owner as an object with an
id, an idType and an isLocal flag, so it can name a person managed in
another identity system. Agent details showed the owner as text and
failed to render once the owner became an object.

Add the AgentOwner model, use it on Agent, CreateAgentRequest and
UpdateAgentRequest, show the owner's ID in agent details for React and
Vue, and take the owner as an object on AgentCreate.

Refs thunder-id/thunderid#6435

Signed-off-by: thiva-k <kalyanasundaramthivaharan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant