Skip to content

fix(repository-workflow): 避免读取模型时抢占活跃 thread - #96

Merged
DCjanus merged 2 commits into
masterfrom
fix/repository-workflow-active-writer
Aug 4, 2026
Merged

fix(repository-workflow): 避免读取模型时抢占活跃 thread#96
DCjanus merged 2 commits into
masterfrom
fix/repository-workflow-active-writer

Conversation

@DCjanus

@DCjanus DCjanus commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Why

Codex 引入 thread 单 writer 约束后,提交辅助脚本通过 thread/resume 查询当前模型会与正在运行的主 App Server 争抢 writer lock,导致提交流程报错中断。

What

  • 改用只读的 thread/read 获取 rollout 路径,并从最后一条完整的 turn_context 解析实际模型,避免恢复和抢占活跃 thread。
  • 兼容活跃 rollout 尚未写完的尾部记录,并支持通过 CODEX_MODEL_NAME 显式覆盖模型名。
  • 补充模型切换、不完整尾行、损坏记录和缺失路径的回归测试,并将测试纳入 GitHub Actions。

Validation

在仍由主 App Server 持有 writer 的当前 thread 中直接执行脚本,可以正常返回 Codex:gpt-5.6-sol,不再出现 active writer 冲突。

Notes

PR 创建后仓库的全局依赖门禁检测到 Typer 最新版本已更新至 0.27.1;已通过仓库自带的依赖升级工具同步 18 个 uv 脚本的最低版本声明。

@DCjanus
DCjanus merged commit 3e9ec48 into master Aug 4, 2026
3 checks passed
@DCjanus
DCjanus deleted the fix/repository-workflow-active-writer branch August 4, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant