P02 · LLM Protocol Infrastructure
Codex-Shim
一个刻意保持窄边界的 Responses-to-Chat 兼容层,让 Codex CLI 对接 OpenAI-compatible Chat Completions provider,同时明确暴露不支持的 control-plane 行为。
转换协议语义,而不只是 JSON 字段。
有效的兼容面
覆盖 instructions、token controls、function tools、function-call outputs、previous-response continuation、reasoning content 与 buffered Responses SSE。
不伪造 Remote Compact
Compact control-plane 请求被明确标记为 unsupported,而不是盲目转发或伪装成 provider failure。
保持小 API Surface,并让失败语义可见。
Tool Call 映射
Chat tool call 转换为 Responses function-call item,function-call output 再映射回 Chat tool message。
Continuation
通过内存 continuation model 支持 previous response ID,匹配该 shim 的窄职责边界。
可验证交付物
Release archive 同时提供 checksum 与 build information,方便直接验证开源交付证据。