Add discovery API to Python SDK#39
Conversation
Resync openapi.yml + generated client with the latest roe-main PR 3232
state (commits 1e84e190f rename + 4e3b70241 trim). Two contract changes
land here:
- `/v1/discovery/{agent-engine-types,supported-models}/` → `/v1/agents/{types,models}/`
- `engines` items are now an open dict (six fields: class_id, display_name,
description, summary, input_schema, default_values), not TemporalWorkflow
The old `TemporalWorkflow.from_dict` popped `form_type`, which the new
payload omits — `list_agent_engine_types()` against current backend
would have raised `KeyError`. Adds a from_dict test against a realistic
six-field engine response to catch this category of drift in CI.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile review |
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge; the new discovery endpoints are additive, tenant-agnostic, and do not touch existing auth or agent creation paths. The handwritten wrapper (DiscoveryAPI) is straightforward and well-tested. The generated files are self-contained additions with no changes to existing behaviour. All findings are cosmetic or stylistic and do not affect runtime correctness. Generated model files (agent_engine_type_list.py, supported_llm_model.py, etc.) carry unused imports from the code-generator template that will trip linters if ruff is ever extended to cover _generated/. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant RoeClient
participant DiscoveryAPI
participant GeneratedEndpoint
participant Server
Caller->>RoeClient: client.discovery.list_agent_engine_types()
RoeClient->>DiscoveryAPI: list_agent_engine_types()
DiscoveryAPI->>GeneratedEndpoint: "sync_detailed(client=raw_client)"
GeneratedEndpoint->>Server: GET /v1/agents/types/
Server-->>GeneratedEndpoint: 200 AgentEngineTypeList JSON
GeneratedEndpoint-->>DiscoveryAPI: Response[AgentEngineTypeList]
DiscoveryAPI->>DiscoveryAPI: translate_response(response)
DiscoveryAPI-->>Caller: AgentEngineTypeList
Caller->>RoeClient: "client.discovery.list_supported_models(capability=image)"
RoeClient->>DiscoveryAPI: "list_supported_models(capability=image)"
Note over DiscoveryAPI: None to UNSET translation applied
DiscoveryAPI->>GeneratedEndpoint: "sync_detailed(client=raw_client, capability=image)"
GeneratedEndpoint->>Server: "GET /v1/agents/models/?capability=image"
Server-->>GeneratedEndpoint: 200 SupportedLLMModelList JSON
GeneratedEndpoint-->>DiscoveryAPI: Response[SupportedLLMModelList]
DiscoveryAPI->>DiscoveryAPI: translate_response(response)
DiscoveryAPI-->>Caller: SupportedLLMModelList
Reviews (2): Last reviewed commit: "fix: drop unused RoeConfig from Discover..." | Re-trigger Greptile |
Discovery endpoints are tenant-agnostic; carrying RoeConfig on the API class was a dead public surface that misled future readers. Also remove the duplicate cast/UNSET and unused quote imports from the regenerated endpoint modules, and add a regression test for the capability=None to UNSET translation path. Greptile P2 review id 33087814.
|
@greptile review |
CI's check-codegen-drift job re-runs codegen and rejects any drift from the committed generated files. The duplicate cast/UNSET and unused quote imports are codegen-tool quirks; cleaning them by hand made the committed tree differ from regen output and broke CI. Restore the files. The codegen-side fix is tracked separately and is not in scope for this PR.
|
Closing per request. |
Summary
roe-aito1.0.802client.discovery.list_agent_engine_types()client.discovery.list_supported_models(capability=None)Testing
uv run ruff check src/roe/api/discovery.py src/roe/api/__init__.py src/roe/client.py tests/unit/test_discovery.pyuv run pytest tests/unit -qDependency