You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
chore(ci): change CI to use ogx_open_client (#6016)
# What does this PR do?
Fixes multiple integration test failures when running with the
OpenAPI-generated SDK (`ogx_open_client`) instead of the Stainless SDK
(`ogx_client`). This PR switches the integration test suite to use the
new SDK and resolves all compatibility issues discovered during the
transition.
**Changes by commit:**
1. **fix(ci):** Fix the OpenAPI SDK publish workflow to use OIDC trusted
publishing instead of unconfigured secret-based auth.
2. **chore(client-sdks):** Switch all integration tests and the library
client from `ogx_client` to `ogx_open_client`. Add fallback import
chains for backward compatibility. Update model class references in
`test_rerank.py` and adapt
`test_openai_vector_store_file_contents_with_extra_query` for the new
SDK's direct query parameter convention (vs. the OpenAI SDK's
`extra_query`).
3. **fix(client-sdks):** Fix dict serialization in multipart form
requests. The generated SDK was sending dicts as JSON strings, but the
OGX server expects bracket-notation (`key[subkey]=value`). Affects
`expires_after` and similar nested fields on file upload.
4. **fix(client-sdks):** Add a `ChoiceDeltaToolCall` streaming delta
variant in the OpenAPI spec. The spec previously used the same
`ChatCompletionMessageToolCall` schema (all fields required, no `index`)
for both complete responses and streaming deltas, but streaming deltas
on the wire include `index` and omit `id`/`type`/`function` on
continuation chunks. This formalizes the de-facto protocol without
changing anything on the wire.
5. **fix(client-sdks):** Fix enum deserialization in anyOf validators.
The generated `actual_instance_must_validate_anyof` used `isinstance()`
to check variant types, which failed for `str,Enum` types (e.g.,
`OpenAIResponseInputToolChoiceMode`) because a bare string like `"auto"`
is not an `isinstance` of the enum class. Add a fallback that tries
constructing the type from `str`/`int` values.
6. **fix(tests):** Fix four bugs in vision inference integration tests:
guard against `None` in streaming `delta.content`, fix
`multi_image_data` fixture reference (was using the function instead of
the resolved value), fix wrong streaming API call
(`chunk.event.delta.text` → `chunk.choices[0].delta.content`), and
update stale GitHub image URL.
## Test Plan
Integration tests were run against a live OpenAI backend with the
`ci-tests` distribution:
```bash
# Ensure the generated SDK is installed with all template fixes
cp -r client-sdks/openapi/sdks/python/ogx_open_client/* \
.venv/lib64/python3.12/site-packages/ogx_open_client/
# Run the full base test suite
uv run --no-sync ./scripts/integration-tests.sh \
--stack-config server:ci-tests --setup gpt --suite base --inference-mode live
```
**Results: 22 failures (down from 29 baseline), 0 regressions.**
All 22 remaining failures are pre-existing and unrelated:
- 16x ranker/hybrid search returning empty results (keyword indexing
issue across backends)
- 6x legacy `/v1/completions` endpoint 404 (not served by the `ci-tests`
distribution with `gpt` setup — not a real CI configuration)
**Tests fixed by this PR (7 resolved):**
| Test | Root cause | Fix |
|------|-----------|-----|
|
`test_openai_vector_store_file_contents_with_extra_query[client_with_models-*]`
(x6 backends) | Generated SDK rejects `extra_query` kwarg |
`_get_file_content` helper adapts params per client type |
| `test_inference_store_tool_calls[client_with_models-True]` | Streaming
tool call chunks deserialized as raw dicts | `ChoiceDeltaToolCall`
schema with relaxed fields |
| `test_list_response_input_items[client_with_models]` | `tool_choice:
"auto"` fails anyOf enum validation | Try enum construction for str/int
in validator |
| `test_image_chat_completion_multiple_images[True]` | `None`
delta.content on streaming chunks | `or ""` guard |
| `test_image_chat_completion_multiple_images[False]` |
`multi_image_data` fixture function used as value | Changed to
`multi_image_url` |
| `test_image_chat_completion_streaming` | `.lower()` called on `None`
delta.content | `if delta_content:` guard |
| `test_openai_chat_completion_image_url` | Stale GitHub URL
(`meta-llama/ogx`) | Updated to `ogx-ai/ogx` |
---------
Signed-off-by: E Geiger <egeiger@redhat.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>
| Close stale issues and PRs |[stale_bot.yml](stale_bot.yml)| Run the Stale Bot action |
38
37
| Test External Providers Installed via Module |[test-external-provider-module.yml](test-external-provider-module.yml)| Test External Provider installation via Python module |
39
38
| Test External API and Providers |[test-external.yml](test-external.yml)| Test the External API and Provider mechanisms |
0 commit comments