Skip to content

feat(generated): Agents (batch 89943d4b) - #548

Closed
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-89943d4b
Closed

feat(generated): Agents (batch 89943d4b)#548
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-89943d4b

Conversation

@workos-sdk-automation

Copy link
Copy Markdown
Contributor

Summary

Regenerated SDK from spec changes.

Triggered by workos/openapi-spec@b6350ef

@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Sep 1, 2026
@workos-sdk-automation
workos-sdk-automation Bot requested review from a team as code owners September 1, 2026 21:39
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Sep 1, 2026
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR regenerates the Agents SDK to make blueprint session settings optional and add agent-token validation.

  • Adds the authenticated blueprint-token validation endpoint and request/response models.
  • Updates RBI declarations, generated manifests, changelog metadata, and endpoint/model tests.
  • The new response RBI overstates the nullability guarantees of several fields.

Confidence Score: 4/5

The response type contract should be corrected before merging so typed consumers do not treat nullable validation fields as guaranteed strings.

The endpoint can construct a model containing nil identity and expiry fields, while its newly generated RBI promises non-null String values for those same accessors.

Files Needing Attention: rbi/workos/agent_token_validation.rbi, lib/workos/agents/agent_token_validation.rb

Important Files Changed

Filename Overview
lib/workos/agents.rb Makes blueprint session settings optional and adds the authenticated blueprint-token validation request flow.
lib/workos/agents/agent_token_validation.rb Adds the validation response model, whose direct hash assignments permit nil identity and expiry values.
rbi/workos/agent_token_validation.rbi Adds response-model signatures but incorrectly marks potentially absent identity and expiry fields as non-null strings.
test/workos/test_agents.rb Covers endpoint routing and authentication but accepts an empty response without checking nullable response fields.

Sequence Diagram

sequenceDiagram
  participant App as Ruby application
  participant Agents as WorkOS::Agents
  participant API as WorkOS API
  participant Model as AgentTokenValidation
  App->>Agents: validate_blueprint_token(...)
  Agents->>API: "POST /agents/blueprints/{id}/tokens/validate"
  API-->>Agents: Validation JSON
  Agents->>Model: new(response.body)
  Model-->>App: Typed validation result
Loading
Prompt To Fix All With AI
### Issue 1
rbi/workos/agent_token_validation.rbi:18-31
**Validation fields have wrong nullability**

When a token-validation response omits identity or expiry fields, `AgentTokenValidation` returns `nil` while this RBI declares those accessors as non-null `String`, causing typed consumers to trust values that can produce downstream `NoMethodError` or `TypeError` failures.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile

Comment on lines +18 to +31
sig { returns(String) }
def agent_instance_id; end

sig { params(value: String).returns(String) }
def agent_instance_id=(value); end

sig { returns(String) }
def agent_instance_session_id; end

sig { params(value: String).returns(String) }
def agent_instance_session_id=(value); end

sig { returns(String) }
def organization_id; end

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 Validation fields have wrong nullability

When a token-validation response omits identity or expiry fields, AgentTokenValidation returns nil while this RBI declares those accessors as non-null String, causing typed consumers to trust values that can produce downstream NoMethodError or TypeError failures.

Knowledge Base Used: Agents, actions, and widgets

Prompt To Fix With AI
This is a comment left during a code review.
Path: rbi/workos/agent_token_validation.rbi
Line: 18-31

Comment:
**Validation fields have wrong nullability**

When a token-validation response omits identity or expiry fields, `AgentTokenValidation` returns `nil` while this RBI declares those accessors as non-null `String`, causing typed consumers to trust values that can produce downstream `NoMethodError` or `TypeError` failures.

**Knowledge Base Used:** [Agents, actions, and widgets](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/workos-ruby/-/docs/agents-actions-and-widgets.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@gjtorikian gjtorikian closed this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

1 participant