Skip to content

feat(benchmark): configure cancellable HTTP 429 recovery - #7375

Merged
huangruiteng merged 1 commit into
mainfrom
codex/benchmark-codex-retry-settings
Oct 26, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/benchmark-codex-retry-settings

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

A direct provider HTTP 429 can end a native Codex Goal turn without using its stream retry budget. Add --provider-rate-limit-retry-seconds to the EdgeBench runner and record it in the run receipt, using the existing SForge host credential gateway rather than starting replacement Goal turns.

The default remains zero. Explicit retry settings require an API-key route and a supporting SForge revision; unavailable support fails before launch. Both native Goal and official Stop-hook workers receive the same policy. Zero also clears an ambient SForge retry setting so recorded and effective configuration cannot diverge.

The transport implementation is EdgeBench #13. It honors Retry-After, applies capped jittered backoff otherwise, cancels waits on client/trial shutdown, and keeps the original trial deadline. Codex stream retry settings, prompts, sessions, completion semantics and scoring are unchanged.

Validation: 325 tests passed, 4 existing optional tests skipped. Two unrelated native_goal_continue assertion failures were reproduced on the unmodified base and excluded from this run. Eight focused configuration tests passed against the companion SForge revision, including real gateway construction and legacy-source rejection. The real-gateway test explicitly skips when that optional companion revision is absent. Installed Codex 0.153.4 recovered nine injected HTTP 429s within its original turn; a 305-second Retry-After also recovered without resetting the Goal. Synthetic-provider qualification proves transport recovery, not benchmark effectiveness.

The public-boundary scan passed for all three changed files. The broader local check still reports unrelated pre-existing registry migration failures; it is not reported as green.

Signed-off-by: huangruiteng <huangrt01@163.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | max

APPROVE — 未发现由这三文件补丁引入的阻塞缺陷;当前精确范围质量资格仍为 FAIL,不能据此合并。 评审提交 02cae79560d8bea37247578a8fe10eb289174b70,本轮冻结检查目标 main 为 f794ee4642353b70cde185e2774fa0059c467d6a。

动机

使用 API-key 路由运行 native-goal 或 official 试验的操作者。过去只能接受直接 429 或依赖其他重试层;现在显式提供窗口后,既有网关可在原试验中等待并重试,取消和窗口耗尽仍会结束等待。本轮核验了参数、运行回执与真实网关构造一致,并运行受控 429、取消和窗口耗尽用例;未启动真实模型或评测。本 PR 不改变评分、任务语义、Codex 流式重试、会话或试验预算,也不证明解题效果或真实服务稳定性。

伴随 SForge #13 尚未合入默认冻结源;当前分支的两项旧断言仍红,精确范围质量资格未通过。直接 429 与流式重试、硬额度耗尽是三个不同边界;新增窗口不应变成重新创建 Goal 或更换账户的理由。

改动思路

重试窗口的选择留在现有 runner,HTTP 等待与取消留在 SForge 网关,原试验与预算 owner 不变;一个配置 helper 已足够。本 PR 完成交付可选参数、预启动拒绝和回执读回;SForge #13 的传输发布及当前分支合入主干断言修复仍由对应作者负责。

不修改现有 native Goal 或 official 的续跑 owner。main 先解析路由与配置,再校验窗口并创建 worker;真正的 HTTP 等待、Retry-After、取消和关闭仍在 SForge 的 APIProxy。直接增加 Codex stream 重试次数不覆盖同一层;另写外层重试会带来会话和预算风险,因而一个配置 helper 是合理的最小边界。

输入 实际行为
省略或 0 网关窗口为 0;回执明确记录 0
正数、API 路由、支持的冻结 SDK 同一数值传至现有网关和回执
OAuth-only、非法值、旧 SDK 正数 启动前给出明确错误

此表来自实际 main/config/gateway 对照,不是模型或试验效果证据。

具体改动

完整范围为 benchmark/edgebench/run.py 的 21 行生产增量、56 行聚焦测试和 27 行 README,合计 +104/-0。没有新增 transport 实现、状态 store 或协议 owner。

独立规范为 spec_ref: benchmark/edgebench/README.md,spec_revision: 5cff2b9,按修改前文本核对:

  • Select and freeze the native provider — implemented:既有 source lock 保留;旧 source 不支持正数时拒绝,不重钉活跃 cohort。
  • Worker profiles — implemented:native-goal 和 official 复用同一网关,原模型、effort、profile 和 timeout owner 不变。
  • Continue after native account exhaustion — implemented:普通 429 不授权账户切换,不创建新 Goal 或新任务预算。

关键代码讲解

  1. _configure_provider_retries:严格接受非负整数;正数须有 API base/key 和 provider 字段。旧 SDK 的 0 返回原配置;支持时用既有 dataclass 的 replace,没有第二份手工同步状态。
  2. main:新参数进入已解析的 config 后才构造 worker;同一 config 送入原 run_agent,并将窗口写入 runtime-receipt.json。新增的是可核对的 per-run 配置,不是重试成功或任务完成回执。

默认语义有一个明确的兼容边界:在新伴随 SDK 上,旧 runner 会继承 SFORGE_AGENT_RATE_LIMIT_RETRY_SECONDS=900,新 runner 的省略值会将它覆盖为 0。配对实测确认了这个有意的 precedence 变化;不能把该案例称为全字节等价。普通无 ambient 设置的旧调用仍为 0。新回执字段是兼容的附加数值,不启用重试。

对主干的风险

当前伴随公开源码固定为 47fa89e2c4db5f957f7a30ba3da29928f83d8f43(EdgeBench #13)。八项新设置测试通过,覆盖真实 gateway 构造;同一 harness 在不可变 pre-change e1 与本头完成 16 次实际 main→config→worker→receipt/gateway 观察。两个 profile 的窗口一致,原 1234 秒 timeout 未变。Docker、Codex、模型与 evaluator 的启动 effect 被明确截住,未用这个夹具冒称真实试验完成。

伴随 source 的 44 项实际 loopback proxy/retry/cancellation/cleanup 测试通过,包括九个 429、Retry-After、窗口耗尽、其他状态与停止等待。实际旧 SDK 7589eba864f24e1eb2bdf63f3dfc42881c755832 上为 7 passed/1 明确 capability skip;不存在的真实新网关没有被伪造为通过。

扩展五套验证为 457 passed/4 skipped/2 failed。两项 test_native_goal_continue_is_a_native_goal_opt_in 的旧 regex 失败,在 PR 修改前 e1 与本头的完整归一化失败内容相同;此补丁没有修改其 test 或 constructor 路径。当前 target f794 已通过已合并的断言修正使它们变绿,本分支还未携带该修正。首次另外五项 flat-import 环境失败也保留,补全测试路径后只剩这两项;没有删除断言或挑选成功运行。

Ruff、compile、公开边界和 standard premerge 的 6 direct +19 selected 自动检查通过;整体仍为 manual_review_required,保留 benchmark 维护者留置。CQR 仍记录 FAIL,并经物理回读和原生 verify 确认为不合格:当前 target 已绿,不能伪造“同一当前基线也红”的例外来豁免本头两项失败。作者应先合入既有目标分支修正,再对新 exact head 资格化;本评审不要求在这里另修一个无关功能。

发布前目标 main 已推进至 1927ba22cbabc23f8fb54eb46eefa4631eab7cb1;逐 blob 核对 runner、既有 runtime、相关测试与 README,和冻结检查目标 f794 相同。质量 scope 已按1927重建,失败资格重新记录并读回;上述实际测试仍保留其原测试版本归属。

语义与 CI 对齐

复用外部已类型化的 config duration 和现有 runtime receipt,未增加通用 Goal/Agent 状态词汇。普通 429 仍不是硬额度判断。没有查询、轮询或等待 CI;代码评审、当前质量资格、provider 发布和合并权限分别保留。

我的整体评价

long_horizon:preserved;user_experience:improved。 重试仍消费原试验预算,配置、取消及回读由现有 owner 负责;新参数不额外要求确认、复制凭据或重建任务。重试窗口的选择留在现有 runner,HTTP 等待与取消留在 SForge 网关,原试验与预算 owner 不变;一个配置 helper 已足够。本 PR 完成交付可选参数、预启动拒绝和回执读回;SForge #13 的传输发布及当前分支合入主干断言修复仍由对应作者负责。

本次只改 runner、配置测试和使用说明;没有修改渲染页面。真实服务、付费模型效果与试验收益未验证。已投递的 repository experience 用于核对真实入口、有用结果和续跑边界,没有据此继承历史结论或声称记忆带来收益。当前功能增量合理,CQR FAIL 与合并留置仍须如实保留;不执行合并。

English verdict: APPROVE
At 02cae79560d8bea37247578a8fe10eb289174b70, the runner binds an explicit default-zero HTTP429 window to the existing SForge gateway and truthful receipt, with original profiles/timeouts preserved. Actual main/gateway and companion transport/cancellation checks pass. Two unchanged pre-change assertion failures remain on this exact head and are already corrected on current target main; strict current-scope CQR remains FAIL until integration/requalification. No CI, live model/benchmark outcome, provider publication or merge qualification is claimed.

@huangruiteng
huangruiteng merged commit 30ffb06 into main Oct 26, 2026
21 of 34 checks passed
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.

2 participants