Bug Report
Package: azure-ai-agentserver-responses
Version: 1.0.0b9 (also present in b10)
Python: 3.14
Description
get_history_item_ids() in both InMemoryResponseProvider and FoundryResponseProvider
truncates history from the wrong direction. It uses resolved[:limit] which keeps the
oldest N items and drops the newest — the opposite of correct behavior for
conversation history.
Affected files
azure/ai/agentserver/responses/store/_memory.py
azure/ai/agentserver/responses/store/_foundry_provider.py (same pattern)
Expected behavior
resolved[-limit:] — keep the most recent N items, drop the oldest.
Actual behavior
resolved[:limit] — keeps the first N items (oldest), drops recent turns.
Impact
In multi-turn hosted agents (20+ turns), the agent loses visibility of recent
user messages, feedback, and decisions. It retains old context (initial setup)
but can't see what just happened — causing it to repeat steps or ignore recent
user input. The default default_fetch_history_count=100 makes this trigger
around turn 25-30 in tool-heavy workflows.
Workaround
Set ResponsesServerOptions(default_fetch_history_count=500) to delay the
truncation, but this doesn't fix the direction bug.
Suggested fix
# _memory.py , _foundry_provider.py equivalent
return resolved[-limit:] # keep newest N, not oldest N
Suggested labels
bug, Hosted Agents, Client
Bug Report
Package: azure-ai-agentserver-responses
Version: 1.0.0b9 (also present in b10)
Python: 3.14
Description
get_history_item_ids()in bothInMemoryResponseProviderandFoundryResponseProvidertruncates history from the wrong direction. It uses
resolved[:limit]which keeps theoldest N items and drops the newest — the opposite of correct behavior for
conversation history.
Affected files
azure/ai/agentserver/responses/store/_memory.pyazure/ai/agentserver/responses/store/_foundry_provider.py(same pattern)Expected behavior
resolved[-limit:]— keep the most recent N items, drop the oldest.Actual behavior
resolved[:limit]— keeps the first N items (oldest), drops recent turns.Impact
In multi-turn hosted agents (20+ turns), the agent loses visibility of recent
user messages, feedback, and decisions. It retains old context (initial setup)
but can't see what just happened — causing it to repeat steps or ignore recent
user input. The default
default_fetch_history_count=100makes this triggeraround turn 25-30 in tool-heavy workflows.
Workaround
Set
ResponsesServerOptions(default_fetch_history_count=500)to delay thetruncation, but this doesn't fix the direction bug.
Suggested fix
Suggested labels
bug, Hosted Agents, Client