Skip to content

feat: Add linkClaimAttemptToExternalUser to Agents module#1652

Open
m0tzy wants to merge 2 commits into
mainfrom
devin/1783009238-add-create-claim-attempt
Open

feat: Add linkClaimAttemptToExternalUser to Agents module#1652
m0tzy wants to merge 2 commits into
mainfrom
devin/1783009238-add-create-claim-attempt

Conversation

@m0tzy

@m0tzy m0tzy commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Adds workos.agents.linkClaimAttemptToExternalUser(options) wrapping POST /agents/claims/attempts.

The serializer hardcodes type: 'link_external_user' so callers don't need to pass it:

const result = await workos.agents.linkClaimAttemptToExternalUser({
  claimAttemptToken: 'cla_tkn_...',
  user: { email: 'alice@example.com', externalId: 'ext_alice' },
  organizationId: 'org_...', // optional
});
// result: { id, status, userCode, organizations }

Types: LinkClaimAttemptToExternalUserOptions, ClaimAttemptResponse, ClaimAttemptOrganization

Documentation

[x] Yes

API reference docs updated in the companion monorepo PR (workos/workos#64535).

Closes AUTH-6647

Link to Devin session: https://app.devin.ai/sessions/4c6130f5dc744691a1c9fe409b253aac
Requested by: @m0tzy

Add POST /agents/claims/attempts endpoint support to the Node SDK.
This allows admin API consumers to attach a user to a claim attempt
and retrieve the code needed for the agent to complete the claim.

Closes AUTH-6647

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@m0tzy m0tzy requested review from a team as code owners July 2, 2026 16:21
@m0tzy m0tzy requested a review from dandorman July 2, 2026 16:21
@m0tzy m0tzy self-assigned this Jul 2, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor
Original prompt from madison.packer

Can we open a PR for this? https://linear.app/workos/issue/AUTH-6646/add-an-api-endpoint-to-the-agent-auth-admin-controller-for-retrieving

@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

AUTH-6647

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title Add createClaimAttempt to Agents module feat: Add createClaimAttempt to Agents module Jul 2, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new Agents wrapper for claim attempt creation. The main changes are:

  • New request and response interfaces for claim attempts.
  • New serializer for POST /agents/claims/attempts payloads and responses.
  • New fixture and tests for request serialization, response deserialization, and optional organization handling.
  • New exports from the Agents interface and serializer barrels.

Confidence Score: 4/5

The change is not ready to merge because the newly advertised public SDK method is not exposed under the documented name.

The affected surface is narrow and the failure mode is direct: consumers calling the documented Agents API hit a missing method at runtime before any request can be made.

src/agents/agents.ts

T-Rex T-Rex Logs

What T-Rex did

  • Reproduced the public API mismatch by running a focused TypeScript runtime script that constructs the repository WorkOS client and inspects the live agents API surface.
  • Inspected contract surface across baseline and organization runs, noting the absence of linkClaimAttemptToExternalUser in before cases and its presence in after cases with expected request body changes and HTTP 200 responses.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/agents/agents.ts:64-66
**Public API mismatch**
The PR adds `linkClaimAttemptToExternalUser`, but the advertised SDK API and PR title/description are `workos.agents.createClaimAttempt(...)`. With this implementation, consumers following the new documented example get `workos.agents.createClaimAttempt is not a function`, so the new endpoint wrapper is not exposed under the intended public method name.

Reviews (2): Last reviewed commit: "feat: Rename createClaimAttempt to linkC..." | Re-trigger Greptile

…d type discriminator

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title feat: Add createClaimAttempt to Agents module Add linkClaimAttemptToExternalUser to Agents module Jul 2, 2026
@devin-ai-integration devin-ai-integration Bot changed the title Add linkClaimAttemptToExternalUser to Agents module feat: Add linkClaimAttemptToExternalUser to Agents module Jul 2, 2026
Comment thread src/agents/agents.ts
Comment on lines +64 to +66
async linkClaimAttemptToExternalUser(
options: LinkClaimAttemptToExternalUserOptions,
): Promise<ClaimAttemptResponse> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Public API mismatch
The PR adds linkClaimAttemptToExternalUser, but the advertised SDK API and PR title/description are workos.agents.createClaimAttempt(...). With this implementation, consumers following the new documented example get workos.agents.createClaimAttempt is not a function, so the new endpoint wrapper is not exposed under the intended public method name.

Artifacts

Repro: focused runtime script that calls the advertised agents.createClaimAttempt API

  • Contains supporting evidence from the run (text/typescript; charset=utf-8).

Repro: command output showing createClaimAttempt is missing and linkClaimAttemptToExternalUser exists

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/agents.ts
Line: 64-66

Comment:
**Public API mismatch**
The PR adds `linkClaimAttemptToExternalUser`, but the advertised SDK API and PR title/description are `workos.agents.createClaimAttempt(...)`. With this implementation, consumers following the new documented example get `workos.agents.createClaimAttempt is not a function`, so the new endpoint wrapper is not exposed under the intended public method name.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is resolved — the method was intentionally renamed from createClaimAttempt to linkClaimAttemptToExternalUser in the second commit. The PR title and description have been updated accordingly. The bot review was triggered against the first commit before the rename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant