Description
When using a gpt-5.6 model with a long prompt prefix, usage_details is missing cache_creation_input_token_count, despite being available in the raw response.
Code Sample
import asyncio
from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
from dotenv import load_dotenv
load_dotenv()
async def main() -> None:
client = FoundryChatClient(credential=AzureCliCredential())
agent = Agent(
client=client,
name="WeatherAgent",
instructions="You are a helpful weather agent. " * 200,
default_options={"prompt_cache_key": "cache-key"},
)
result = await agent.run("Hello")
print(result.usage_details.get("cache_creation_input_token_count")) # None
print(result.raw_representation.raw_representation.usage.input_tokens_details.cache_write_tokens) # 1409
if __name__ == "__main__":
asyncio.run(main())
Error Messages / Stack Traces
Package Versions
agent-framework-core: 1.12.1, agent-framework-openai: 1.11.0
Python Version
Python 3.14.5
Additional Context
No response
Description
When using a gpt-5.6 model with a long prompt prefix,
usage_detailsis missingcache_creation_input_token_count, despite being available in the raw response.Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-core: 1.12.1, agent-framework-openai: 1.11.0
Python Version
Python 3.14.5
Additional Context
No response