Skip to content

fix(okta): describe each user param the way its endpoint accepts it - #7307

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/tools-okta
Aug 31, 2026
Merged

fix(okta): describe each user param the way its endpoint accepts it#7307
waleedlatif1 merged 2 commits into
stagingfrom
fix/tools-okta

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Nine Okta tools described their user path parameter inaccurately. These params are user-or-llm, so the description is literally what the model reads before choosing what to pass — an inaccurate one produces a 404 on a well-formed call.

Okta's spec defines exactly two user path parameters, and the distinction is the whole bug:

Component Documented as Used by
pathId ({id}) "An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user" /users/{id} and every /users/{id}/lifecycle/*
pathUserId ({userId}) "ID of an existing Okta user" /users/{userId}/factors, /roles, /sessions

Over-promising — tightened (8 tools)

All on pathUserId, all previously advertising "User ID or login". A model reading that passes an email and gets a 404:

assign_user_role, list_user_roles, remove_user_role, enroll_factor, list_factors, get_factor, reset_factor, clear_user_sessions — now "Okta user ID (not a login or email) …".

Under-promising — loosened (1 tool)

delete_user calls DELETE /api/v1/users/{id}, which is login-capable, but said "User ID to delete". Now "User ID or login (email) to delete".

What this PR does not change

Description text only. No param name, tool id, URL, required flag or visibility was touched.

Eight tools that looked wrong and are not. suspend_user, unsuspend_user, reset_password, update_user, activate_user, get_user, deactivate_user and reset_all_factors all build /users/{id} or /users/{id}/lifecycle/*pathId, genuinely login-capable — so "User ID or login" was already accurate on every one. Tightening them would have introduced the bug. The trap is that several of them name their TypeScript param userId, which makes them read as ID-only while the path they build is {id}.

Testing

apps/sim/tools/okta/user_path_descriptions.test.ts — derives everything from the real registry rather than a hardcoded list. For each Okta tool carrying a userId param it runs the tool's own URL builder with a sentinel and classifies by the produced pathname against ^/api/v1/users/<sentinel>(/lifecycle/[^/]+)?$, then asserts the description advertises a login iff the path is login-capable. A future Okta tool is covered with no edit.

One subtlety the test has to handle: a naive "contains the word login" detector reports true for "not a login or email", which would have forced dropping the explicit warning. The detector strips negated clauses first, so the warning an ID-only tool carries doesn't read as the promise it exists to deny.

Verified red-first per description, not as a batch: each of the nine reverted individually turned exactly one named test red and no others. 121 tests pass across tools/okta.

bun run lint, type-check, check:audits (39 audits), tool-metadata:check, docs:check and check-block-registry.ts origin/staging all pass. Regenerated artifacts committed.

Endpoint coverage was verified as part of this: all 44 tool URL+method pairs diffed against the spec's path/method table — zero missing paths, zero method mismatches.

Deferred

The block's UI carries the same drift and cannot be fixed without a back-compat decision. blocks/blocks/okta.ts uses one shared userId subBlock across 21 operations — 9 login-capable, 12 ID-only — with placeholder: 'User ID or login (email)'. The model path is now correct; a human picking Enroll Factor still reads "login (email)". Splitting it means new subBlock ids, which is exactly what the stability check guards and would orphan saved values. Options are to neutralize the placeholder to "User ID" (accurate for all 21, loses the login hint on 9) or leave it. Wanted a decision rather than a unilateral change.

Login resolution was considered and not implemented. clear_user_sessions is the one tool that would earn a GET /users/{login} pre-flight — offboarding is where the caller has an email and nothing else — but it costs a round trip, needs a read scope the tool may not otherwise hold, and inherits the ambiguity Okta itself warns about for shortnames and logins containing /.

Type of Change

  • Bug fix

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Okta's Management API spec uses two distinct user path parameters. `pathId`
("An ID, login, or login shortname ... of an existing Okta user") backs
`/api/v1/users/{id}` and every `/api/v1/users/{id}/lifecycle/*` operation.
`pathUserId` and `pathAppUserId` ("ID of an existing Okta user") back the
factors, roles, sessions, and membership paths.

Every Okta `userId` param is `user-or-llm`, so its description is the only
thing a model reads before choosing what to pass. Eight tools on `pathUserId`
endpoints advertised "User ID or login", so a model that supplied an email got
a 404; `delete_user` sits on a `pathId` endpoint but promised an ID only, so a
model resolved an ID it never needed.

Tightened: assign_user_role, list_user_roles, remove_user_role, enroll_factor,
list_factors, get_factor, reset_factor, clear_user_sessions.
Loosened: delete_user.

A registry-derived test classifies each Okta tool by the path its own `url`
builder produces, so a future tool is covered without a hardcoded list.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 31, 2026 9:23pm

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns model-visible Okta userId parameter descriptions with whether each provider endpoint accepts only an Okta user ID or also accepts a login.

  • Tightens eight factor, role, and session tool descriptions to require an Okta user ID.
  • Expands the delete-user description to document login support.
  • Regenerates tool metadata and integration documentation.
  • Adds a registry-derived regression test covering both Okta user-path parameter kinds.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/tools/okta/user_path_descriptions.test.ts Adds registry-derived checks that Okta user parameter descriptions match the URL shape generated by each tool.
apps/sim/tools/okta/delete_user.ts Documents that the delete-user endpoint accepts either an Okta user ID or login.
apps/sim/tools/okta/assign_user_role.ts Corrects the role-assignment user parameter to require an Okta user ID rather than a login.
apps/sim/tools/okta/clear_user_sessions.ts Corrects the session-revocation user parameter to require an Okta user ID.
apps/sim/tools/generated/tool-metadata.ts Regenerates serialized tool metadata to propagate the corrected Okta parameter descriptions.
apps/docs/content/docs/integrations/okta.mdx Updates generated Okta integration documentation to match the corrected tool contracts.

Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/docs/content/docs/integrations/okta.mdx
# Conflicts:
#	apps/sim/tools/generated/tool-metadata.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 12 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit bd49a7e into staging Aug 31, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/tools-okta branch September 1, 2026 00:36
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