Skip to content

feat(generated): OrganizationMembership (batch e471ddef)#675

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

feat(generated): OrganizationMembership (batch e471ddef)#675
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-e471ddef

Conversation

@workos-sdk-automation

Copy link
Copy Markdown
Contributor

Summary

Regenerated SDK from spec changes.

Triggered by workos/openapi-spec@75604c7

@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jun 25, 2026
@workos-sdk-automation workos-sdk-automation Bot requested review from a team as code owners June 25, 2026 13:51
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR regenerates SDK models and fixtures from the latest spec. The main changes are:

  • New common model exports for auth, pipes, and session event payloads.
  • OrganizationMembership now includes a roles list.
  • Organization-domain standalone tests move to the shared OrganizationDomain model.
  • New round-trip fixtures and tests for generated models.

Confidence Score: 1/5

The regenerated package import surface is currently broken for common models and organization-domain clients.

  • workos.common.models imports generated modules that are not present, so model loading fails at import time.
  • workos.organization_domains._resource still depends on OrganizationDomainStandAlone being re-exported from its models package, but that export was removed.
  • Public aliases for standalone organization-domain state and verification strategy were removed even though their modules still exist, breaking existing public imports.

src/workos/common/models/init.py, src/workos/common/init.py, src/workos/organization_domains/models/init.py

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex attempted the before-side OrganizationMembership roles check using the script PYTHONPATH=src python /tmp/check_org_membership_roles.py tests/fixtures/organization_membership.json in the base worktree, but the run exited with code 1 due to the environment missing httpx, resulting in a blocked setup with no head execution artifact produced.

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. src/workos/organization_domains/models/__init__.py, line 3-8 (link)

    P0 Removed Internal Model Export

    workos.organization_domains._resource still imports OrganizationDomainStandAlone through from .models import OrganizationDomainStandAlone. Removing this re-export makes import workos.organization_domains fail before callers can use the organization-domain client.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/workos/organization_domains/models/__init__.py
    Line: 3-8
    
    Comment:
    **Removed Internal Model Export**
    
    `workos.organization_domains._resource` still imports `OrganizationDomainStandAlone` through `from .models import OrganizationDomainStandAlone`. Removing this re-export makes `import workos.organization_domains` fail before callers can use the organization-domain client.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
src/workos/common/models/__init__.py:209-211
**Missing Generated Model Modules**

These new re-exports import modules that are not included in the PR, starting with `auth_method_mismatch_error.py` and continuing with the new pipes and session models below. Any import of `workos.common.models` now fails at module load with `ModuleNotFoundError`, so the SDK and the new round-trip tests cannot load.

### Issue 2 of 3
src/workos/organization_domains/models/__init__.py:3-8
**Removed Internal Model Export**

`workos.organization_domains._resource` still imports `OrganizationDomainStandAlone` through `from .models import OrganizationDomainStandAlone`. Removing this re-export makes `import workos.organization_domains` fail before callers can use the organization-domain client.

```suggestion
from .create_organization_domain import (
    CreateOrganizationDomain as CreateOrganizationDomain,
)
from workos.common.models.organization_domain import (
    OrganizationDomain as OrganizationDomain,
)
from .organization_domain_stand_alone import (
    OrganizationDomainStandAlone as OrganizationDomainStandAlone,
)
```

### Issue 3 of 3
src/workos/common/models/__init__.py:462
**Removed Public Alias Exports**

The standalone organization-domain state and verification-strategy alias modules still exist, but this change removes their public re-exports from `workos.common.models` and `workos.common`. Existing SDK users that import `OrganizationDomainStandAloneState` or `OrganizationDomainStandAloneVerificationStrategy` from those public package surfaces now get `ImportError` even though the underlying aliases were not removed.

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

Comment on lines +209 to +211
from .auth_method_mismatch_error import (
AuthMethodMismatchError as AuthMethodMismatchError,
)

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.

P0 Missing Generated Model Modules

These new re-exports import modules that are not included in the PR, starting with auth_method_mismatch_error.py and continuing with the new pipes and session models below. Any import of workos.common.models now fails at module load with ModuleNotFoundError, so the SDK and the new round-trip tests cannot load.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/common/models/__init__.py
Line: 209-211

Comment:
**Missing Generated Model Modules**

These new re-exports import modules that are not included in the PR, starting with `auth_method_mismatch_error.py` and continuing with the new pipes and session models below. Any import of `workos.common.models` now fails at module load with `ModuleNotFoundError`, so the SDK and the new round-trip tests cannot load.

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

@@ -459,12 +462,6 @@
from .organization_domain_deleted_data import (

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 Removed Public Alias Exports

The standalone organization-domain state and verification-strategy alias modules still exist, but this change removes their public re-exports from workos.common.models and workos.common. Existing SDK users that import OrganizationDomainStandAloneState or OrganizationDomainStandAloneVerificationStrategy from those public package surfaces now get ImportError even though the underlying aliases were not removed.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/common/models/__init__.py
Line: 462

Comment:
**Removed Public Alias Exports**

The standalone organization-domain state and verification-strategy alias modules still exist, but this change removes their public re-exports from `workos.common.models` and `workos.common`. Existing SDK users that import `OrganizationDomainStandAloneState` or `OrganizationDomainStandAloneVerificationStrategy` from those public package surfaces now get `ImportError` even though the underlying aliases were not removed.

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

@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 found 4 potential issues.

Open in Devin Review

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.

🚩 PR appears to be an incomplete code generation commit

The commit message is "chore(generated): shared regenerated files" which suggests this may be a partial commit of auto-generated output. The .oagen-manifest.json lists test fixture files for the new models but does not list corresponding src/workos/common/models/ source files for auth_method_mismatch_error, session_reauthenticated*, or pipes_connected_account_connection_failed*. This suggests the code generator intentionally did not produce these model files (perhaps they come from a different generation pass), yet the __init__.py re-exports were added prematurely. Similarly, the OrganizationDomainStandAlone re-export was removed from organization_domains/models/__init__.py but the consumer (_resource.py) was not updated — possibly because _resource.py is generated by a separate pass. If this PR is meant to land alongside another PR that provides the missing pieces, they should be coordinated to avoid a broken intermediate state on the main branch.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines -9 to -11
from .organization_domain_stand_alone import (
OrganizationDomainStandAlone as OrganizationDomainStandAlone,
)

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.

🔴 Removing a model re-export breaks the organization domains feature entirely

The re-export of OrganizationDomainStandAlone is removed from the package init (src/workos/organization_domains/models/__init__.py:9-11), but the resource module still depends on it, so any use of the organization domains API will crash.

Impact: Calling get_organization_domain() or verify_organization_domain() raises an error, making the organization domains feature unusable.

Incomplete removal: re-export deleted but consumers not updated

The PR removes the re-export from src/workos/organization_domains/models/__init__.py (lines 9–11 on the old side), but src/workos/organization_domains/_resource.py:11 still does:

from .models import OrganizationDomainStandAlone

This import resolves against models/__init__.py, which no longer defines or re-exports OrganizationDomainStandAlone. The underlying file organization_domain_stand_alone.py still exists, but Python's from package import name only looks in the package's __init__.py, not in submodules.

The resource module uses OrganizationDomainStandAlone in get_organization_domain (_resource.py:63,84), verify_organization_domain (_resource.py:119,140), and their async counterparts (_resource.py:193,214,249,270).

Additionally, tests/test_organization_domains.py:10 imports it and multiple tests reference it (lines 44, 64, 183, 209).

Prompt for agents
The PR removes the OrganizationDomainStandAlone re-export from src/workos/organization_domains/models/__init__.py, but src/workos/organization_domains/_resource.py still imports OrganizationDomainStandAlone from .models (line 11) and uses it as the return type and model parameter in get_organization_domain and verify_organization_domain (both sync and async variants). Either restore the re-export in __init__.py, or update _resource.py to use OrganizationDomain directly (since OrganizationDomainStandAlone is just a TypeAlias for OrganizationDomain). Also update tests/test_organization_domains.py line 10 and its usages at lines 44, 64, 183, 209.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +209 to +211
from .auth_method_mismatch_error import (
AuthMethodMismatchError as AuthMethodMismatchError,
)

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.

🔴 New model classes are imported but their source files are missing, preventing the SDK from loading

Six new model classes are imported in the package init (src/workos/common/models/__init__.py:209-211) but the corresponding source files were never created, so importing the SDK at all will crash.

Impact: Any application that imports the workos package will fail immediately with a module-not-found error.

Missing source files for newly added imports

The PR adds imports in src/workos/common/models/__init__.py for:

  • AuthMethodMismatchError from .auth_method_mismatch_error (line 209-211)
  • PipesConnectedAccountConnectionFailed from .pipes_connected_account_connection_failed (line 557-559)
  • PipesConnectedAccountConnectionFailedData from .pipes_connected_account_connection_failed_data (line 560-562)
  • SessionReauthenticated from .session_reauthenticated (line 600)
  • SessionReauthenticatedData from .session_reauthenticated_data (line 601-603)
  • SessionReauthenticatedDataImpersonator from .session_reauthenticated_data_impersonator (line 604-606)

None of these .py files exist on disk. The .oagen-manifest.json lists test fixtures for these models but does not list source files under src/workos/common/models/. The test fixtures were created, and src/workos/common/__init__.py also re-exports these classes (lines 123, 367-372, 402-406), compounding the failure.

Since workos.common.models is imported transitively by virtually every part of the SDK, this makes the entire package non-functional.

Prompt for agents
The PR adds imports for 6 new model classes in src/workos/common/models/__init__.py (AuthMethodMismatchError, PipesConnectedAccountConnectionFailed, PipesConnectedAccountConnectionFailedData, SessionReauthenticated, SessionReauthenticatedData, SessionReauthenticatedDataImpersonator), but the corresponding Python source files under src/workos/common/models/ were never created. The code generator (oagen) appears to have generated the __init__.py changes, test fixtures, and manifest entries, but not the actual model source files. These files need to be generated and included in the PR. Each should follow the standard pattern: a @dataclass(slots=True) class with from_dict and to_dict methods, matching the structure shown in the test fixtures.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +42 to +43
roles: List["SlimRole"]
"""The list of roles assigned to the user within the organization."""

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.

🚩 New required roles field is a breaking change for existing API consumers

The roles field added to OrganizationMembership at src/workos/organization_membership/models/organization_membership.py:42 is non-optional and has no default value. In from_dict, it uses data["roles"] (line 67) rather than data.get("roles", []), meaning any API response that doesn't include a roles key will raise a KeyError (caught and re-raised as a deserialization error). This is consistent with how other required fields are handled, but it means that if users pin this SDK version while their WorkOS environment still returns the old response format (without roles), deserialization will fail. The existing test fixtures (organization_membership_created_data.json, organization_membership_updated_data.json) already include roles, suggesting the API already returns this field. Worth confirming that the API change is fully rolled out before releasing this SDK version.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants