OpenAI Responses API Long-Running Agent Support Update
OpenAI has significantly updated its Responses API, introducing three new features to address the challenges of long-running agents. With Server-side Compaction, Hosted Shell Containers, and the Skills API, agents can now run continuously for hours or even days.
Server-side Compaction Resolves “Context Forgetting”
Traditional AI agents faced issues with token limits during long task executions, leading to the loss of past inferences. OpenAI’s Server-side Compaction fundamentally resolves this problem.
This feature is not just a simple history deletion but summarizes the agent’s past actions in a compressed state, retaining important context while removing noise.
# Enable automatic compaction
curl -X POST https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.2",
"store": false,
"compaction": {
"mode": "auto",
"threshold": 100000
}
}'
According to the demonstration data from the e-commerce platform Triple Whale, agent Moby maintained accuracy while operating in a session with 5 million tokens and 150 tool calls. (Source: venturebeat.com)
Hosted Shell Containers Provide a Complete Execution Environment
The new Shell Tool offers an OpenAI-hosted Debian 12 environment with the container_auto option. This is not just a code interpreter but provides each agent with a dedicated terminal environment.
# Example usage of Hosted Shell Container
import openai
response = openai.responses.create(
model="gpt-5.2",
tools=[{
"type": "shell",
"shell": {
"container": "container_auto"
}
}],
messages=[{
"role": "user",
"content": "Create a Python data transformation script and save it to /mnt/data"
}]
)
This environment comes with the following pre-installed:
- Python 3.11, Node.js 22, Java 17, Go 1.23, Ruby 3.1
- Persistent storage via
/mnt/data - Internet connection for library installation and external API integration
Data engineers can implement high-performance data processing tasks in these hosted containers without building ETL middleware. (Source: venturebeat.com)
Skills API for Standardized Agent Capabilities
The Skills API is a new standard developed by the OpenAI team, allowing agent capabilities to be defined in a structured format. Compared to traditional custom function definitions, this approach improves reusability and maintainability.
{
"type": "skill",
"skill": {
"name": "data_analysis",
"description": "Perform data analysis and visualization",
"parameters": {
"data_source": {"type": "string"},
"analysis_type": {"type": "string", "enum": ["statistical", "trend", "correlation"]}
}
}
}
The Skills standard enables developers to share capabilities across multiple agents and reduce repetitive prompt work. (Source: openai.com)
Implementation Architecture Details
In OpenAI’s official announcement, the internal implementation of Server-side Compaction is described as “summarizing the agent’s past actions in a compressed state, retaining important context.” However, specific details about the compression algorithm and memory management are not disclosed.
According to Microsoft Azure documentation, compaction items are encrypted and not in a human-readable format, suggesting that OpenAI has developed its own state compression technology. (Source: learn.microsoft.com)
Summary
- Using Server-side Compaction, long-running agent sessions with 5 million tokens can be executed while maintaining accuracy
- Hosted Shell Containers provide persistent storage via
/mnt/data, allowing for data retention between sessions according to company policies - The Skills API standard enables significant reductions in prompt development time and allows for capability sharing across multiple agents
- With the
container_autooption, high-performance data processing pipelines can be instantly built without ETL middleware construction