---
type: email
from: Giulio <notifications@github.com>
subject: [openai/openai-agents-python] truncation not working for gpt-oss

 (Issue #1574)
received: 2026-03-06 07:12:40
date_header: Sat, 23 Aug 2025 10:37:53 -0700
priority: normal
status: awaiting_approval
uid: 28494
---

## Email Content

**From:** Giulio <notifications@github.com>
**Subject:** [openai/openai-agents-python] truncation not working for gpt-oss

 (Issue #1574)
**Date:** Sat, 23 Aug 2025 10:37:53 -0700

### Body (preview)

giuliohome created an issue (openai/openai-agents-python#1574)



### Describe the bug



I expected the truncation='auto' setting in `ModelSettings` to prevent context overflow errors, but it seems not to be applied. Instead, I receive `400` errors when the request exceeds the available context size.



I read the documentation and also checked #1494



### Code snippet



```py

    # Configure model settings with truncation for this run

    model_settings = ModelSettings(

        temperature=0.1,

        truncation='auto'

    )

    run_config = RunConfig(model_settings=model_settings)

    

    result = await Runner.run(agent, input=input_items, max_turns=50, run_config=run_config)

```



### Debug information

- Agents SDK version: latest

- Python version Python 3.13.3



From Logfire tracing I see



```json

"model_config": {

  "temperature": 0.1,

  "truncation": "auto",

  "max_tokens": null,

  ...

}



```



### Repro steps



1. Run the agent with the code above.

2. Observe the inference model runner logs.



```yaml

srv  update_slots: all slots are idle

srv  log_server_r: request: POST /v1/chat/completions 127.0.0.1 200

srv  params_from_: Chat format: GPT-OSS

slot launch_slot_: id  0 | task 5581 | processing task

slot update_slots: id  0 | task 5581 | new prompt, n_ctx_slot = 8192, n_keep = 0, n_prompt_tokens = 8210

slot      release: id  0 | task 5581 | stop processing: n_past = 0, truncated = 0

srv    send_error: task id = 5581, error: the request exceeds the available context size. try increasing the context size or enable context shift

```





### Expected behavior

With `truncation="auto"`, I expected the input to be automatically truncated to fit within the context window (8192 tokens). Instead, the request overflows and fails.





-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/issues/1574

You are receiving this because you are subscribed to this thread.



Message ID:

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
