Kernel v0.14.1
LingTai kernel v0.14.1:Codex Responses 状态、cache 纪律与诚实身份
一次聚焦 Codex 的 runtime release:持久 Responses WebSocket 延续、更安全的 tool-output baseline、显式 fresh-epoch reset、简洁的 summarize/cache 提醒、诚实的 LingTai 请求身份,以及刷新后的 kernel ANATOMY 引用。
升级 / runtime
Kernel package lingtai v0.14.1 已发布到 PyPI,作为 LingTai-managed environment 使用的 runtime package source。已有 LingTai 项目仍应按 TUI 管理的 refresh / setup 路径更新,不应把全局裸 pip 命令当作普通用户升级故事。
新功能与改进
-
01
Codex Responses 可以增量延续
当本地 history 仍与远端 baseline 匹配时,LingTai 现在会保留 WebSocket 侧状态,并通过
previous_response_id延续 Codex Responses turn。-
ws_incremental表示 LingTai 继续使用现有远端previous_response_id链,而不是完整重放请求。 -
ws_full表示 LingTai 从本地 history 重建完整请求,并开启新的远端状态链。 - 运行时保留 fallback 路径,因此 prefix mismatch、缺少 baseline 或显式 reset 时可以安全选择完整请求。
为什么重要:Codex cache affinity 依赖远端 Responses 状态链,而不只是重复发送相同 prompt 字节。
-
-
02
Tool-output baseline 与 fresh epoch 变得显式
Tool output 会按请求 baseline 冻结;LingTai 也可以通过 fresh epoch 主动把旧远端 metadata 留在旧链里。
- 冻结 tool-output cache 可以避免后续本地变更悄悄改变增量 Codex 请求正在回复的内容。
- 周期性 epoch reset 默认 20 turns,并从当前本地
chat_history重建一次完整请求。 - 本地
system(action="summarize")成功后,也会让下一次 Codex 请求进入 fresh epoch。
为什么重要:Fresh epoch 是丢弃旧远端状态包袱的安全方式,同时不会删除 LingTai 本地 history。
-
03
Summarize guidance 现在会保护 Codex cache
Jason 指出逐条连续 summarize 会反复打断 Codex cache 链;运行时 comment 现在会把这个代价显式说出来。
- 对 Codex 而言,每次 summarize 都会让下一次请求从
ws_fullfresh epoch 开始,而不是继续ws_incremental。 - adapter comment 明确不建议在大约 5 turns 内连续 summarize。
- 普通长 tool result 应先读完,确认 raw payload 不再需要后再批量 summarize。
为什么重要:其他 provider 对这里不那么敏感,但 Codex 使用 `previous_response_id` 状态,因此不必要的 fresh epoch 就是真实的 cache miss。
- 对 Codex 而言,每次 summarize 都会让下一次请求从
-
04
默认 Codex 身份是诚实的 LingTai
这次 release 清理了把旧 official-CLI-shaped 实验误写成默认行为的陈旧注释。
- 默认请求使用
originator=lingtai与User-Agent=LingTai/<version>。 - 官方 Codex CLI 形状的 identity 只保留为显式本地对比开关。
- comments、tests 与
src/lingtai/llm/openai/ANATOMY.md已同步为发布行为。
为什么重要:协议实验很有价值,但发布出的 runtime 应清楚说明自己是谁。
- 默认请求使用
-
05
验证与 release hygiene
这次 release 也修复了陈旧的 kernel ANATOMY 引用,并记录发布文件的精确 artifact hashes。
- 完整 kernel pytest 通过:
2715 passed, 4 skipped in 304.41s。 - Codex identity/comment targeted tests 通过:
42 passed。 - 自定义全量 ANATOMY citation check 通过:
599citations checked,0issues。 - wheel 与 sdist 通过
twine check,不含__pycache__/.pyc,上传后也在 PyPI 上完成校验。
为什么重要:这是一次小版本 bump,但状态机行为值得完整验证与可追溯的 release evidence。
- 完整 kernel pytest 通过:
贡献者
感谢本发布窗口中提交代码、共同完成提交、参与 PR / review / assignment、报告或推动 issue closure 的贡献者。
验证
最终 release validation 来自干净 release worktree,commit d47473b22599.
- Kernel full pytest 2715 passed, 4 skipped in 304.41s
- Target Codex identity/comment tests 42 passed
- ANATOMY citation checker 599 checked, 0 issues
- Build and twine check wheel + sdist built; both PASSED
- Artifact inspection 0 __pycache__ / .pyc entries
- PyPI verification 0.14.1 published with matching SHA-256 hashes