feat(generated): Changes to agents, pipes, and user_management - #727
Conversation
…iKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, Pipes, PipesProvider, PlatformTeams, Radar, SSO, UserManagement, Vault, Webhooks, Widgets
|
| secret: str | ||
| """The API key secret to store for the tenant.""" | ||
| user_id: str | ||
| """The User identifier the API key is installed for.""" |
There was a problem hiding this comment.
Positional arguments silently change meaning
Previously, ApiKeyInstallation accepted (user_id, secret, organization_id=None) through its alias. The replacement reverses the first two arguments: existing code such as ApiKeyInstallation("user_123", "sk_example") now serializes the secret as user_id and the user ID as secret. Passing this model as api_key breaks integration creation and key rotation.
The same compatibility issue affects CreateDataIntegration, where ownership displaces description, and DataIntegrationsUpsertClientCredentialsRequest, where the new selectors displace config. Preserve existing field positions, append new optional fields, and add positional-construction regression tests.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/pipes/models/api_key_installation.py
Line: 15-18
Comment:
**Positional arguments silently change meaning**
Previously, `ApiKeyInstallation` accepted `(user_id, secret, organization_id=None)` through its alias. The replacement reverses the first two arguments: existing code such as `ApiKeyInstallation("user_123", "sk_example")` now serializes the secret as `user_id` and the user ID as `secret`. Passing this model as `api_key` breaks integration creation and key rotation.
The same compatibility issue affects `CreateDataIntegration`, where ownership displaces description, and `DataIntegrationsUpsertClientCredentialsRequest`, where the new selectors displace config. Preserve existing field positions, append new optional fields, and add positional-construction regression tests.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| def test_update_data_integration_organization(self, workos, httpx_mock): | ||
| httpx_mock.add_response( | ||
| json=load_fixture("data_integration.json"), | ||
| ) | ||
| result = workos.pipes.update_data_integration_organization("test_slug") | ||
| assert isinstance(result, DataIntegration) | ||
| assert result.object == "data_integration" | ||
| assert result.id == "data_integration_01EHZNVPK3SFK441A1RGBFSHRT" | ||
| request = httpx_mock.get_request() | ||
| assert request.method == "PUT" | ||
| assert request.url.path.endswith("/data-integrations/test_slug/organization") |
There was a problem hiding this comment.
New request bodies lack coverage
The organization-update tests supply no update fields and check only the method/path. The credential and token tests also never supply the new ownership and plural-connection body selectors, so they would pass even if serialization dropped those inputs.
Add sync and async body assertions for organization updates with enabled=False, explicit nullable fields, and a nested payload. Also exercise organization/account selectors and both boolean values in credential requests. This would protect the new behavior rather than only confirming that its routes exist.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_pipes.py
Line: 196-206
Comment:
**New request bodies lack coverage**
The organization-update tests supply no update fields and check only the method/path. The credential and token tests also never supply the new ownership and plural-connection body selectors, so they would pass even if serialization dropped those inputs.
Add sync and async body assertions for organization updates with `enabled=False`, explicit nullable fields, and a nested payload. Also exercise organization/account selectors and both boolean values in credential requests. This would protect the new behavior rather than only confirming that its routes exist.
**Knowledge Base Used:**
- [Product automation services](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/workos-python/-/docs/product-automation-services.md)
- [Pagination and shared types](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/workos-python/-/docs/pagination-and-shared-types.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| "ownership": "unexpected_data_integration_ownership", | ||
| "description": "Production GitHub app", | ||
| "enabled": True, | ||
| "state": "unexpected_data_integration_state", | ||
| "state": "valid", |
There was a problem hiding this comment.
Unknown-state regression coverage removed
Replacing unexpected_data_integration_state with valid removes the existing check that DataIntegration preserves unfamiliar server state values. The new unknown-ownership case should extend that coverage, not replace it. Keep both fields unknown here, or parameterize the test to exercise each independently.
| "ownership": "unexpected_data_integration_ownership", | |
| "description": "Production GitHub app", | |
| "enabled": True, | |
| "state": "unexpected_data_integration_state", | |
| "state": "valid", | |
| "ownership": "unexpected_data_integration_ownership", | |
| "description": "Production GitHub app", | |
| "enabled": True, | |
| "state": "unexpected_data_integration_state", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_pipes_models_round_trip.py
Line: 300-303
Comment:
**Unknown-state regression coverage removed**
Replacing `unexpected_data_integration_state` with `valid` removes the existing check that `DataIntegration` preserves unfamiliar server state values. The new unknown-ownership case should extend that coverage, not replace it. Keep both fields unknown here, or parameterize the test to exercise each independently.
```suggestion
"ownership": "unexpected_data_integration_ownership",
"description": "Production GitHub app",
"enabled": True,
"state": "unexpected_data_integration_state",
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
feat(agents): Add parameter
AgentsSessions.list.organization_idAgentsSessions.list.organization_id.feat(pipes): Update Pipes API surface
PipesOwnership.usertoCreateDataIntegrationOwnership.usertoDataIntegrationOwnership.GET /data-integrations/{slug}/organization.PUT /data-integrations/{slug}/organization.DELETE /data-integrations/{slug}/organization.Pipes.listDataIntegrations.ownership.GET /data-integrations.PUT /user_management/users/{user_id}/connected_accounts/{slug}.DELETE /user_management/users/{user_id}/connected_accounts/{slug}.feat(user_management): Add user management API surface
CreateAuthkitOAuthResource.AuthkitOAuthResource.UserManagementAuthkitOAuthResources.fix(pipes): Update Pipes API surface
userland_userfromCreateDataIntegrationOwnership.userland_userfromDataIntegrationOwnership.POST /user_management/users/{user_id}/connected_accounts/{slug}.Triggered by workos/openapi-spec@0b4d419
BEGIN_COMMIT_OVERRIDE
feat(agents): Add parameter
AgentsSessions.list.organization_id(#727)feat(pipes): Update Pipes API surface (#727)
feat(user_management): Add user management API surface (#727)
fix(pipes): Update Pipes API surface (#727)
END_COMMIT_OVERRIDE