公益站的codex压缩上下文踩坑记录

2026-04-13 13:090阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

非常感谢大佬们提供的公益站,

记录一下我遇到的情况,有些站点不支持 /v1/responses/compact 接口,响应404,导致codex在压缩上下文时直接中断,我深入研究了一下,也可以在 /v1/responses 接口添加 context_management 和 compact_threshold参数实现 /compact 接口,但是经过我测试,不支持 /v1/responses/compact 接口的通过 /v1/responses 方式实现压缩也无效,返回的响应格式是普通对话,而不是带 encrypted_content 参数的压缩对话

头疼,一点办法也没有,希望各位公益站大佬可以支持这个压缩接口

测试方法:

上下文需要大于1000才会触发压缩

CONTENT=$(python - <<'PY' print("记住:ORBIT-7319\n" + ("x " * 1200)) PY ) curl https://code.claudex.us.ci/v1/responses \ -H "Authorization: Bearer OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d "$(jq -n --arg content "$CONTENT" '{ model: "gpt-5.4", store: false, stream: false, max_output_tokens: 16, context_management: [{type:"compaction", compact_threshold:1000}], input: [{role:"user", content:$content}] }')" 网友解答:


--【壹】--:

我发现之前对话都消失了,请问怎么把之前的信息都同步过来,积攒

阅读全文
标签:纯水
问题描述:

非常感谢大佬们提供的公益站,

记录一下我遇到的情况,有些站点不支持 /v1/responses/compact 接口,响应404,导致codex在压缩上下文时直接中断,我深入研究了一下,也可以在 /v1/responses 接口添加 context_management 和 compact_threshold参数实现 /compact 接口,但是经过我测试,不支持 /v1/responses/compact 接口的通过 /v1/responses 方式实现压缩也无效,返回的响应格式是普通对话,而不是带 encrypted_content 参数的压缩对话

头疼,一点办法也没有,希望各位公益站大佬可以支持这个压缩接口

测试方法:

上下文需要大于1000才会触发压缩

CONTENT=$(python - <<'PY' print("记住:ORBIT-7319\n" + ("x " * 1200)) PY ) curl https://code.claudex.us.ci/v1/responses \ -H "Authorization: Bearer OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d "$(jq -n --arg content "$CONTENT" '{ model: "gpt-5.4", store: false, stream: false, max_output_tokens: 16, context_management: [{type:"compaction", compact_threshold:1000}], input: [{role:"user", content:$content}] }')" 网友解答:


--【壹】--:

我发现之前对话都消失了,请问怎么把之前的信息都同步过来,积攒

阅读全文
标签:纯水