帖子
- 文成宇2026-07-2116004
因为gpt 5.6出来后感觉不需要太多提示词,所以尝试在pi agent中使用。
发现pi的compact不是openai原生的远程压缩,于是找了一下有没有相关的扩展。
pi.dev

Pi Coding Agent
A terminal-based coding agent
尝试了一下
@lll9p/pi-better-compaction这个扩展执行
pi install npm:@lll9p/pi-better-compaction安装扩展有默认的配置参数,也可以自行创建配置文件,在macbook上是创建
~/.pi/agent/extensions/pi-better-compaction/config.json配置如下```
{
"enabled": true,
"allowCompactionContinuityBreak": false,"compactionModel": "openai/gpt-5.6-sol",
"compactionThinkingLevel": "off","responsesCompactApis": ["openai-responses", "openai-codex-responses"],
"notifyOnLoad": true,
"debug": false,
"logProviderPayloads": false,
"logCompactResponses": false,
"redactSensitiveData": true,
"artifactRoot": "~/.pi/agent/artifacts/pi-better-compaction"
}
```然后随便resume一个session,执行/compact
可以看到compact成功了
在sub2api上也能看到对应的请求

注

OpenAI Developers

Compaction | OpenAI API
Manage long-running conversations with server-side and standalone compaction.
原生远程压缩有两种形式。
第一种为新版
/responses+context_management,codex使用该形式,所以在中转站上只能看到/responses请求第二种为旧版
/responses/compact,这是@lll9p/pi-better-compaction使用的形式主楼 - iasi7772026-07-2128769
原生搜索工具可以调用吗,还有体验如何呢
- qaq一个懒人2026-07-2258224
其他家有远程压缩吗,比如 grok 之类的
- 文成宇2026-07-2216004
docs.x.ai

Context Compaction | SpaceXAI Docs
Shrink long conversations into an opaque compaction that can be reused in follow-up calls.
grok也有原生远程压缩
- 烽火聚诸侯2026-07-2215001
第一种为新版
/responses+context_management,codex使用该形式,所以在中转站上只能看到/responses请求【 第一种为新版
/responses+context_management,codex使用该形式,所以在中转站上只能看到/responses请求】佬,这个是codex目前正在用的远程压缩吗? - 文成宇2026-07-2216004
是的。如果不能确定是不是远程压缩的话,可以在codex上直接问有没有触发远端compact
- 文成宇2026-07-2216004
github.com/earendil-works/pi
Add a
ServerToolabstraction to the AI and Agent packages for provider-native tools已打开 02:23AM - 03 Mar 26 UTC
已关闭 08:12AM - 03 Mar 26 UTC

juan-altatech
What do you want to change?
Add a
ServerToolabstraction to the AI and Ag…ent packages so provider-native tools (web search, code interpreter, etc.) can be requested, streamed, and replayed transparently across all supported providers.Why?
Native search is significantly faster and more reliable than client-side alternatives like curl or custom browser tools. Adding this abstraction will allow users to enable other provider-built-in tools like code interpreter as they become available.
How? (optional)
1. Add
ServerTool,ServerToolResult, andServerToolResultContenttypes to the AI package, extendingAssistantMessage.contentand Context to carry server-side tool requests and inline results alongside regular content.
2. Implement provider-specific request building and stream parsing for Anthropic (web_search_20250305/server_tool_use/web_search_tool_result), OpenAI Responses (web_search_preview/web_search_call), OpenAI Completions (web_search_options +
url_citation annotations), and Google (googleSearch + groundingMetadata).
3. UpdatetransformMessagesto pass throughServerToolResultfor same-model replay and convert to text with citations for cross-model, and fix orphaned tool call detection to exclude server-resolved IDs.
4. Update the agent loop to skip client-side execution for tool calls that already have a matchingServerToolResultin the same message, and plumbserverToolsthroughAgentContext/AgentState/proxy.github.com/earendil-works/pi
feat(ai): Add native web search support for Anthropic, OpenAI, xAI, Google
已打开 12:17AM - 14 Jan 26 UTC
已关闭 12:39AM - 14 Jan 26 UTC

nullswan
possibly-openclaw-clanker
Add native web search support for providers with server-managed tools.
Provid…er Tool Cost Anthropic web_search_20250305$10/1k OpenAI web_search_optionsper call xAI/Grok web_searchFREE Google google_search$14/1k What's needed
1. Request: Pass server-managed tools alongside regular tools
2. Response: Handle new content blocks (server_tool_use,web_search_tool_result,annotations)
3. Citations: Expose citation data (url, title, cited_text)<details>
<summary>Proposed StreamOptions extension</summary>```typescript
interface StreamOptions {
webSearch?: {
enabled?: boolean;
maxUses?: number;
allowedDomains?: string[];
blockedDomains?: string[];
userLocation?: { city?: string; country?: string; timezone?: string };
};
}
```</details><details>
<summary>Provider-specific formats</summary>Anthropic — docs```json
{ "type": "web_search_20250305", "name": "web_search", "max_uses": 5 }
``Response blocks:server_tool_use,web_search_tool_result`OpenAI — docs```typescript
web_search_options: { user_location: { type: "approximate", approximate: { country: "US" } } }
``Response:annotationsarray withurl_citation`xAI — docs```json
{ "type": "web_search" }
``Response:citations` arrayGoogle — docs```python
tools=[{"google_search": {}}]
``Response:groundingMetadata`
</details>Related: clawdbot/clawdbot#877
社区讨论过多次,但是作者不愿做,大概是因为各个模型没有统一的接口
- 烽火聚诸侯2026-07-2215001
- 文成宇2026-07-2216004
不可行。openai文档中写的
The response stream includes the encrypted compaction item.,也就是远程压缩后的response是加密的,只有openai模型能解析,其他模型应该解析不了