llama-stack-mirror/tests/unit/providers
Roy Belio c574db5f1d
fix(inference): AttributeError in streaming response cleanup (#4236)
This PR fixes issue #3185 
The code calls `await event_gen.aclose()` but OpenAI's `AsyncStream`
doesn't have an `aclose()` method - it has `close()` (which is async).
when clients cancel streaming requests, the server tries to clean up
with:

```python
await event_gen.aclose()  #  AsyncStream doesn't have aclose()!
```

But `AsyncStream` has never had a public `aclose()` method. The error
message literally tells us:

```
AttributeError: 'AsyncStream' object has no attribute 'aclose'. Did you mean: 'close'?
                                                                            ^^^^^^^^
```

## Verification
* Reproduction script
[`reproduce_issue_3185.sh`](https://gist.github.com/r-bit-rry/dea4f8fbb81c446f5db50ea7abd6379b)
can be used to verify the fix.
*   Manual checks, validation against original OpenAI library code
2025-12-14 07:51:09 -05:00
..
agents/meta_reference feat!: Architect Llama Stack Telemetry Around Automatic Open Telemetry Instrumentation (#4127) 2025-12-01 10:33:18 -08:00
batches feat: Implement FastAPI router system (#4191) 2025-12-03 12:25:54 +01:00
files refactor(storage): make { kvstore, sqlstore } as llama stack "internal" APIs (#4181) 2025-11-18 13:15:16 -08:00
inference feat!: change bedrock bearer token env variable to match AWS docs & boto3 convention (#4152) 2025-11-21 09:48:05 -05:00
inline fix: rename llama_stack_api dir (#4155) 2025-11-13 15:04:36 -08:00
nvidia feat!: standardize base_url for inference (#4177) 2025-11-19 08:44:28 -08:00
utils fix(inference): AttributeError in streaming response cleanup (#4236) 2025-12-14 07:51:09 -05:00
vector_io feat: Add support for query rewrite in vector_store.search (#4171) 2025-12-10 10:06:19 -05:00
test_bedrock.py fix: rename llama_stack_api dir (#4155) 2025-11-13 15:04:36 -08:00
test_configs.py feat!: standardize base_url for inference (#4177) 2025-11-19 08:44:28 -08:00