Skip to content

feat: in-request model-content deadline (firstContentTimeoutMs/contentGapTimeoutMs, three-level cascade, default off) - #3264

Open
ranxianglei wants to merge 7 commits into
masterfrom
2026-10-15_first-content-deadline
Open

ranxianglei wants to merge 7 commits into
masterfrom
2026-10-15_first-content-deadline

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #3254

背景

#3254:一次折叠三次尝试共 27 分钟(775s + 773s + 27s)。卡在途的 relay 靠 ping/注释不断续命字节级空闲计时器,bili 没有任何「无模型内容」上限——事实断路器是客户端自己的看门狗,而 bili.log 全程只有 keep-alive 提示,零 abort/timeout 记录。

修法(owner 拍板:开箱即用、每场景自适配、零配置)

两个模型内容期限字段,三级级联 model > provider route > global network.*(显式 0 在所在层生效 = 关闭;gap 缺省继承 initial 的解析上限):

  • firstContentTimeoutMs(阶段一):响应开始 → 首个模型内容事件(文本/推理增量、工具调用、签名;ping/注释不算内容)的最长等待;
  • contentGapTimeoutMs(阶段二):首个内容之后相邻内容事件间的静默上限,每个内容事件重新计时。

到期行为:中止卡死的上游流 + 一条干净的带内错误结束回合(#1453 形状:context intact, resend your last message)。不做内部盲重取——带内错误让回合干净失败:有重试梯的客户端退避后重试,没有的则直接停止。触发日志带 phase/waited/limit/attempt/round/source=config|builtin|adaptive(便于与客户端重试梯逐次对齐)。

开箱即用(默认开启,零配置)

默认以 720000ms 内置值开启(FC_BUILTIN_DEFAULT_MS,单一具名常量,一行可调)——不写任何配置,每个部署都有界。选 720s 的标准是「别误杀合法长 prefill」:它是 relay 可用 SSE 注释合法续命的量级经验值,且仍短于客户端 ~780s 看门狗(bili 永远先动手并留日志)。任意层显式 0 = 对该阶段豁免(逃生门)。

线路自适应收紧

线路积累 ≥8 次健康尝试后,每个解析出的阶段值转为上限:有效期限收紧为 clamp(3 × p95(该线路近期健康样本), 120s, 该解析上限)(phase 1 用首内容耗时样本,phase 2 用内容间隔样本),永不超过解析上限。上界跟随解析值而非硬编码(避免「冷线路用内置 720s、热到第 9 轮却莫名跳到 600s」的自相矛盾)。采样纪律:只有健康尝试入环(正常完成且无截断/错误;卡死、被期限中止、出错的尝试从不采样);样本存 session metadata(跨重启持久化,环形窗口 32)。冷启动(<8 样本)用配置/内置值原值。常量 FC_ADAPTIVE_MIN_SAMPLES=8 / FC_ADAPTIVE_WINDOW=32 为本 PR 自定(owner 只给了 clamp 区间与 3×p95 公式)。

实现要点:ReadableStream.cancel() 对 locked stream 会 reject(实测 Invalid state: ReadableStream is locked,kill 静默空转→永久挂起),所以 kill 走 interruptibleBody 包装的 underlying-source controller;四个 adapter 的 iterSseEvents 都把读失败吞成 EOF,kill 落点 = for-await 干净退出,消费点无需 try/catch。全部显式 0 时零开销。

config surface(本节为必填)

新增字段(全部可选;默认开启于内置 720000,非「缺省=关」):

位置 键 默认
global network.firstContentTimeoutMs / .contentGapTimeoutMs 内置 720000(gap 继承 initial)
route providers[<key>].firstContentTimeoutMs / .contentGapTimeoutMs 未设→global→内置 720000
model providers[<key>].models[<m>] 同两键 未设→route→global→内置 720000
  • 为什么现有表面表达不了:network.* 进程全局单值,无法按线路/模型分化;compress.* 三层是压缩专用语义;env 只有进程级单值表达不了 per-route(也不属 env-only 六类豁免)→ 刻意仅文件可设、无 env 层。
  • 校验偏差声明:与同区 lenient 数值兄弟不同,这两个字段在 load-time(loadOptions fail-fast + parseRouteEntry)与 per-request(resolver)均抛错拒绝非整数/负数/NaN/字符串——安全机制的 typo 不允许静默失效。
  • 兼容/迁移:纯增量可选字段;但默认行为从「无 bili 侧上限」变为「有界 720s」(见下披露)。回滚到旧行为 = 任意层设 0。

行为变更披露(重要)

默认 ON —— 这是本次最大的行为变更,属产品决策(§7.4 default-value change),已由 owner 拍板(「需要做到一个开箱即用、每个场景都能自适配」+ 指定内置 720000)。

  • 旧值 → 新值:卡死的上游尝试从「无 bili 侧上限(事实由客户端 ~780s 看门狗兜底)」变为「≤720s 内置上限,预热后收紧至 clamp(3×p95, 120s, 解析上限)」。原因:把断路器拿回 bili 手里并在 bili.log 留下可审计记录;720s 仍短于客户端看门狗,bili 永远先动手。
  • 两类客户端价值不同(诚实披露,撤回此前过强表述):带内错误让回合干净失败。有重试梯的客户端(如某些 codex-webui fork 加了 MAX_RESPONSE_RETRIES/no_content_timeout)会退避后自动重试;原生/无重试梯的存量客户端可能直接把回合判失败、需用户手动重发。此前描述称「owner 已在 codex-webui 源码查证 retry_delay 对带内 Stream 错误走 backoff 重试」——该验证针对的是报告者的 fork(本地批量提交带入 MAX_RESPONSE_RETRIES=10 / no_content_timeout_elapsed / 中文文案),不是原生 codex,对存量客户端不成立,特此更正。
  • 误杀风险:首内容合法 >720s 的线路(超大上下文 prefill、很慢的本地模型)会被提前中止(客户端本来也只允许到 ~780s);罕见,触发日志 source=builtin 可追溯,可显式设大值或 0 豁免。
  • clamp 上界跟随解析值(非硬编码 600s):消除冷/热线路期限跳变的自相矛盾。

查重

查重: 无。#3148/#3154(已合入)是死上游 pre-response 传输失败的轮级断路器——机制不同(连接未建成/未出响应头 vs 连接活着但只发 ping 不发内容的流);#2438/#2682 属 preflight 路径。本 PR 机制独立。

测试

  • 新增 tests/issue3254-first-content-deadline.test.ts 11 项:initial/gap 两相触发(fetch 计数钉死「不盲重取」)、健康流不误触、legacy pin(ctx 不带字段时零开销路径不变)、parseDeadlineMs 单元、级联真值表(含 builtin/config/adaptive source 标注 + 全局层 0 豁免)、经 ACP_PROVIDERS 文件路径的 load-time 校验、p95/adaptive 钳制单元(含「慢线路 p95=300s 在 720s 上限下保持满额 720s」)、会话环形窗口与坏数据消毒、端到端采样(健康尝试入环、被中止尝试不入环)。本地定向套件绿(issue3254 + issue1455/1453 邻接回归 + config-surface-guard)。
  • 全量回归以 CI 为准(CI 跑在推送后的 head d41b7f796;分支已 rebase 到最新 master,含 fix: re-sign the preflight summarization egress over its own body (#3226) #3234/fix: preserve Codex mid-history developer items on Responses proxy #3229 等)。

Follow-up

无——原 #3265(线路自适应期限)已按 owner 指示并入本 PR 实现,issue 侧已关闭为重复。

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-15_first-content-deadline (bdcbc05)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4004-pr.3264.04eb9f1

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3264.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。(独立复核,未照抄 PR 正文声明)按失败签名(deadline / timeout / stall / watchdog / 内容超时)在 open+closed issue 与 PR 中检索,无并行的「活流内容级期限」工作。最近邻逐一比对:

审核进行中:方向关 → 既有行为回归清点 → 代码主关 → 测试有效性 → diff 整洁度,结论按结构化八问回复。

ranxianglei pushed a commit that referenced this pull request Oct 15, 2026
docs-sync CI lane failed on the PR head: the #3254 seed entries in
website/config-reference/{process,providers}.yaml were added, but the
derived artifacts (CONFIGURATION.md/.zh-CN.md index tables,
website/main.js i18n strings, website/docs/index.html) were hand-edited
instead of regenerated, so they drifted from generator output:

- network.firstContentTimeoutMs/contentGapTimeoutMs index rows landed
  after postResponseLingerMs by hand; the generator emits them in seed
  order (after preflightDeadEndCooldownMs);
- the two provider-level index rows were missing entirely;
- cr.fcdeadline/cr.gapdeadline i18n entries and the tt.network summary
  line were absent from website/main.js + index.html.

Re-ran tools/gen-config-docs.mjs generate and committed its output;
the seed text (already authored in this PR) is the source of truth.
ranxianglei pushed a commit that referenced this pull request Oct 15, 2026
…3264)

The per-request cascade read the model from the request body only.
Gemini-native requests carry their model in the URL path, not the body,
so providers[<key>].models[<m>] deadlines could never match a
google-wire request — the model tier silently never applied there,
the same silent-failure class this feature rejects for invalid values.
Fall back to prepared.google.model (path-derived) when the body has no
model field; non-google requests are unaffected (prepared.google is
undefined).
ranxianglei pushed a commit that referenced this pull request Oct 15, 2026
Cosmetic: the #3254 edit left five spaces between proxyKeepAliveMaxMs
and postResponseLingerMs in the hand-maintained `### network` Type line
of CONFIGURATION.md and CONFIGURATION.zh-CN.md.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-87b)

PR 审核结论(独立审过 diff、本地跑过测试、复现了 CI 红):机制成立、方向正确;审出 3 处问题已全部在 PR 分支修掉并 push(3 个独立标注 commit,rebase 到分支已并入的 master 之上),等新 head CI 全绿即可合。

结构化八问

  1. 是什么问题:bili 没有「距上次模型内容多久」这个监控维度——relay 只发 ping/SSE 注释就能让两个既有字节级计时器无限续命,一次卡死烧掉客户端 ~25 分钟(in-request summarization has no timeout of its own: the client's 780s content watchdog becomes the de facto circuit breaker — one fold across three attempts totaling 27 minutes (775s + 773s + 27s) | in-request summarization 没有自己的等待上限:客户端 780s 内容看门狗成了事实断路器,一次折叠三次尝试共 27 分钟(775s + 773s + 27s) #3254 事故 775s+773s+27s),事实断路器是客户端自己的内容看门狗,bili.log 零审计记录。
  2. 什么原因导致的:network.upstreamTimeoutMs(720s) 与 requestWatchdogMs 都被任意字节重置,keep-alive 注释也是字节——「流没死」与「没有模型内容」是两个维度,前者被覆盖、后者无人管。根因是缺监控维度,不是参数调得不对。
  3. 影响范围与严重程度:默认 OFF,未配置者零行为变化(legacy 路径逐字节不变,有测试钉死)。启用后影响所有走 acp-loop 的请求(plugin/proxy 两模式共用):卡死尝试从「挂到客户端看门狗(~780s)」变为「到期限中止+带内错误」。启用前无外部影响;启用后该变化即设计目的本身。
  4. 怎么修复的:两个 opt-in 字段三级级联(model > route > global network.*,显式 0 所在层生效不穿透、gap 缺省继承 initial);kill 走 interruptibleBody 包装(plain cancel() 对 locked stream reject,我本机实测复现 TypeError: Invalid state: ReadableStream is locked,包装器方案必要);四个 adapter 的 SSE 迭代器都把读失败吞成 EOF(逐个核对过 anthropic/responses/openai/google),kill 落点 = for-await 干净退出;到期经 adapter.emitError(proxy 工具(compress)后的 re-request 不重试网络层失败,一次抖动即中断整个 turn #1453/上游截断在 compress 内部重发路径无法恢复:重试闸门将 ping 计为已转发输出,且 emitError 合成 end_turn 伪完成 #1455 既定带内错误通道)结束回合一次,且 kill 结算块在所有重试门之前 return → 绝不触发内部盲重取(C-rejected),宿主重试梯接管。
  5. 是否有回归问题:逐项审过既有行为——(a) 关闭路径:不包装/不计时/结算分支无副作用,线字节逐字节不变(legacy pin 测试 D + 代码清点);(b) truncation/degraded/continuation 三个重试门语义不变(kill 检查在其之前 return);(c) dumpSse tee:kill 会提前取消 dump 分支(已注释声明可接受,主路径不受影响);(d) 客户端断开(signal.aborted):不发带内错误、body 照旧取消;(e) 定时器生命周期:clearContentDeadline 在 finally 内,所有退出形态都清;(f) 邻接套件 issue1453/issue1455/config-surface-guard 本地 14/14 绿、typecheck 绿。无意回归:无。
  6. 是否破坏缓存:不涉及——纯在途流超时机制,不触碰 prefix cache、会话状态、fold 游标或去重键;触发后会话状态原样保留,重发走正常路径。
  7. 是否改了设计方向:无转向——在既有 network.* 传输时序域加一个可选维度,级联结构复用 compress 三层模式,错误通道复用 proxy 工具(compress)后的 re-request 不重试网络层失败,一次抖动即中断整个 turn #1453/上游截断在 compress 内部重发路径无法恢复:重试闸门将 ping 计为已转发输出,且 emitError 合成 end_turn 伪完成 #1455 既定机制;仅文件可设(无 env 层)理由已在文档写明(per-route 值无法用进程级单值表达,也不属 env-only 六类豁免)。
  8. 是否引入了新的配置:有(本 PR 核心)——network.firstContentTimeoutMs / network.contentGapTimeoutMs + providers[<key>] 与 providers[<key>].models[<m>] 同两键;默认 unset(OFF);严格校验(非整数/负数/NaN/字符串抛错:启动 fail-fast + 热更后每请求响亮失败,我核对了 throw 路径最终落到 dispatch 的 502+错误日志,不是进程崩溃);纯增量可选,无迁移。owner 部署参考值 global 180000 / 长 prefill 线路 600000 已写入文档示例。

审核中发现并已修复的问题(3 个 commit,已 push 到 PR 分支 a6e674b)

  1. CI 红:docs-sync 失败(阻断级)。seed yaml 加了条目但派生产物是手改的不是重新生成的:network.* 索引行位置错(手放 postResponseLingerMs 之后,生成器按 seed 顺序应落在 preflightDeadEndCooldownMs 之后)、providers 级两行索引整行缺失、website/main.js 缺 cr.fcdeadline/cr.gapdeadline i18n 条目与 tt.network 摘要更新。本地复现(node tools/gen-config-docs.mjs generate 后 diff 非空)→ 重跑生成器提交其输出(commit fix: regenerate config docs from seeds)。连带影响:test 与 static-gates 两个 job needs docs-sync 且 if: !failure()——docs-sync 红导致全量单元套件在 CI 上根本没跑(skipped)。修复后新 head 才会第一次跑出全量判定。
  2. 功能缺口:Google wire 上 model 层静默失效。级联取模型只读了请求体 (parsedReq as {model}).model,而 Gemini native 请求的模型在 URL path 不在 body → models[<m>] 期限对 google-wire 请求永远匹配不上,静默回退 route/global——正是本 PR 对非法值明确拒绝的那类「安全机制静默失效」。补 ?? prepared.google?.model 兜底(commit fix: resolve the model tier from the path model on the Google wire)。行为变更披露:旧值 = Gemini native 请求即使配置了 models[] 也按 route/global 解析 → 新值 = 按 path 模型匹配 model 层;只影响启用新字段的 google-wire 用户,关闭时零影响。(注:紧邻的 resolveCompress 调用点存在同样的既有缺口,属 compress.* 所有 model 层的共有特性,先于本 PR 存在,超出本 PR 范围未动。)
  3. 文档 typo:CONFIGURATION.md/.zh-CN.md 的 network Type 行里 proxyKeepAliveMaxMs; postResponseLingerMs 五空格(commit docs: drop stray double space)。

测试有效性(④)

7 项全有牙且确定性好:fetch 桩换成抛错函数把「不盲重取」钉死(任何内部重取都会炸测试)、legacy pin 钉死关闭时行为、断言最后一个 SSE 块是 event: error(协议原生错误通道)、日志契约(phase/source/attempt/round)逐字断言、级联真值表覆盖 owner 拍板的全部语义点、同步 enqueue 构造流无时序 margin。小缺口(不阻塞):model 层显式 0 无单独 case(与 route 层同一代码路径)、global 层启动校验无直接单测(同一 parseDeadlineMs 函数)。

代码整洁度(⑤b)/ diff 整洁度(⑤)

命名达意(interruptibleBody/armContentDeadline/contentDeadlineSettled)、无死代码、注释全部讲 why(locked-stream cancel 坑、C-rejected 决策、tee dump 分支取舍)且与仓库惯例一致;唯一 cast 复用同文件既有模式,无 as any。修复 commit 后 diff 每一行都与本 PR 相关,三个修复各自独立标注。

状态与判定

Follow-up(线路自适应期限 clamp(3×p95, 120s, 600s),需先补每线路健康首内容耗时采样)按 PR 正文另行立项,本 PR 不阻塞。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 全绿确认(head a6e674ba8),上一轮评审的 pending 项关闭:

全矩阵结果

  • 全量测试套件:12/12 shard 绿(ubuntu/windows × node 22/24 × 3 balanced shards——docs-sync 转绿后 test 车道首次完整跑通);static-gates 4/4 绿。
  • docs-sync 绿(docs 重生成修复生效);各 guard/build/e2e 车道全绿。

唯一一次瞬红 → 判定 runner 侧 flake,与本 PR 无关
e2e-native-opencode 车道测试 3(model-invoked compress really folds context)红过一次,报错 at least one persisted session must carry compressed blocks (got 1 sessions);对同一提交 rerun 后转绿。两条独立证据排除本 PR:① rebase 前的 head(808d8c362,已含 master 全部持久化相关合入)该车道是绿的;② 两个 head 间差异只有我补的 3 个评审修复提交(docs 重生成 / Google 线路模型提取 / 文档空格),而该 e2e 车道不写任何配置,新期限路径根本不启用——差异对该车道可证惰性。已立追踪 issue #3269(带来源标记,含 run 编号与复现证据)跟进负载下的脚本/时序竞态排查,不阻塞本 PR。

最终判定:可合。 实现与 owner 决策逐条对齐(三级级联、显式 0 不穿透、不做内部盲重取、gap 重新计时、attempt/source 日志位、默认 OFF 零开销且 legacy 逐字节不变),config surface 章节完整,行为变更已披露(旧值=无 bili 侧上限由客户端 ~780s 兜底 → 新值=配置值,仅启用者受影响),全量 CI 绿。合并请人工执行:#3264

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

冲突已解决并推送:d41b7f796..92881e6ed → 2026-10-15_first-content-deadline(merge 方式,非 rebase,保留原提交链)。

结构化八问:

  1. 是什么问题:PR 分支与 master 分叉(master 领先 125 个提交),GitHub 标记 dirty,PR 无法合并。
  2. 什么原因导致的:并行开发——分支打开后 master 合入了 feat: remove the absorb distillation feature (#3293) #3309(absorb 移除)、fix(opencode-native): proxy 不可用时超窗请求本地拒发,不再静默直连撞上游 400 #3318、src/server.ts 拆分为 src/server/*、config 文档生成器更新等大量变更,双方都改了 src/server/relay.ts 顶部 import 块,git 无法自动合并。顺带发现:分支尾部两个 feat 提交(route-adaptive 精修、out-of-the-box 720s 内置)更新了 yaml 种子但没重新生成派生文档,docs-sync CI 会红。
  3. 影响范围与严重程度:仅影响本 PR 的合并性;不影响任何已发布行为。不处理则 PR 永远合不了。
  4. 怎么修复的:把 origin/master merge 进分支。唯一文本冲突在 relay.ts import:PR 侧残留 buildAbsorbSystemPrompt(feat: remove the absorb distillation feature (#3293) #3309 已删,compress-tool.ts 不再导出该符号)+ 新增 findRouteKey/loadConfigFile/resolveFirstContentDeadlines;master 侧新增 withProjectAttribution。解法:compress-tool import 取 master 版(旧符号已不存在),config import 取两侧符号并集;每个导入符号都在合并后树里逐一核对了导出位置与使用点。另加一个独立标注的 fixup 提交,用 tools/gen-config-docs.mjs generate 重生成四份派生文档(CONFIGURATION en/zh、website 的 main.js/index.html)——之前提交的派生文档还留着 default-off 时代的旧措辞(同一张表里 tt.network 说 "unset" 而表格行说 "on by default",自相矛盾)。
  5. 是否有回归问题:无。逐项清点:ABSORB_INSTRUCTION_MARKER 在 tag-echo-filter.ts 仍存在且 relay.ts 使用点完好(feat: remove the absorb distillation feature (#3293) #3309 只删了 absorb prompt-builder 路径,不是 marker);core.ts 的 deadline 全套逻辑(arm/fire/clear、initial/gap 两相、route-adaptive 采样、killed attempt 不入样)完整保留;master 新增的 withProjectAttribution 在场且被使用;typecheck 通过;定向测试全绿(issue3254 套件 11/11;config-surface-guard + knobs-config-precedence + loop-core 合计 36/36);文档重生成为幂等(二次运行零 diff)。全量回归交远程 CI。
  6. 是否破坏缓存:不涉及——本次合并未触碰缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:没有,只是把 master 并入 PR 分支,无新方向。
  8. 是否引入了新的配置:本次操作没有引入。功能自身的 firstContentTimeoutMs/contentGapTimeoutMs 已在 CONFIGURATION en/zh + website 文档化,这次只是让派生文档与 yaml 种子对齐。

判定:冲突状态应自动转干净;等远程 CI 全绿后由人工合并(按规则我不代合)。

awork added 7 commits October 16, 2026 21:26
In-request summarization had no bili-side wait bound of its own: a stalled
relay that kept the TCP connection alive (byte-level idle timer rearmed by
pings/comments) could hold a model attempt open until the CLIENT's own
content watchdog fired — issue #3254 measured 775s + 773s + 27s for one
fold, with bili logs showing only keep-alive notices and zero abort records.

Add two opt-in model-content deadlines, each cascading model > provider
route > global network.* (explicit 0 wins at its level):

- firstContentTimeoutMs: response start -> first model content event
  (text/reasoning delta, tool call, redacted thinking, standalone signature);
- contentGapTimeoutMs: silence between content events after the first
  arrived, re-armed on every content event (absent -> inherits the resolved
  initial value).

On expiry the loop aborts the stalled upstream stream (interruptible-body
wrapper: ReadableStream.cancel() on a locked stream rejects, so the kill
goes through the underlying source's controller) and ends the turn with one
clean in-band error in the #1453 shape — context intact, resend your last
message. No internal blind refetch (owner decision): the client's retry
ladder re-arms from the in-band error, which it handles natively (verified
against codex-webui's handle_response_stream_error/retry_delay).

Deliberately file-only config (no env layer): per-route/per-model values
cannot be expressed as one process-wide variable. Strict validation
(throw on non-integer/negative) at load time AND per request, unlike the
lenient network.* numeric siblings — a typo must not silently disable a
safety mechanism. Absent everywhere = byte-identical legacy behavior.

Tests: tests/issue3254-first-content-deadline.test.ts (initial/gap fire,
healthy-stream no-fire, legacy pin, validator unit, cascade table,
load-time validation via ACP_PROVIDERS file path). Docs mirrored en/zh +
config-reference yamls. Config-surface guard green.
docs-sync CI lane failed on the PR head: the #3254 seed entries in
website/config-reference/{process,providers}.yaml were added, but the
derived artifacts (CONFIGURATION.md/.zh-CN.md index tables,
website/main.js i18n strings, website/docs/index.html) were hand-edited
instead of regenerated, so they drifted from generator output:

- network.firstContentTimeoutMs/contentGapTimeoutMs index rows landed
  after postResponseLingerMs by hand; the generator emits them in seed
  order (after preflightDeadEndCooldownMs);
- the two provider-level index rows were missing entirely;
- cr.fcdeadline/cr.gapdeadline i18n entries and the tt.network summary
  line were absent from website/main.js + index.html.

Re-ran tools/gen-config-docs.mjs generate and committed its output;
the seed text (already authored in this PR) is the source of truth.
…3264)

The per-request cascade read the model from the request body only.
Gemini-native requests carry their model in the URL path, not the body,
so providers[<key>].models[<m>] deadlines could never match a
google-wire request — the model tier silently never applied there,
the same silent-failure class this feature rejects for invalid values.
Fall back to prepared.google.model (path-derived) when the body has no
model field; non-google requests are unaffected (prepared.google is
undefined).
Cosmetic: the #3254 edit left five spaces between proxyKeepAliveMaxMs
and postResponseLingerMs in the hand-maintained `### network` Type line
of CONFIGURATION.md and CONFIGURATION.zh-CN.md.
…llow-up)

Owner folded the previously filed follow-up (#3265) into this issue: once a route accumulates >=8 healthy attempts, each configured deadline value becomes a ceiling and the effective deadline tightens to clamp(3 x p95 of the route's recent healthy first-content durations, 120s, 600s) per phase. Sampled only from healthy attempts (completed without truncation/error); samples persist in session metadata (ring of 32); fire log records source=config|adaptive.
…ollowing adaptive) (#3254)

Round 3 per owner mandate (out-of-the-box / self-adapting / zero-config):
- resolver now falls back to FC_BUILTIN_DEFAULT_MS=720000 when no tier sets a
  value, so every deployment is bounded with NO config written; explicit 0 at
  any level still opts out (escape hatch). source gains 'builtin'.
- adaptive clamp upper bound now FOLLOWS the resolved ceiling instead of a
  hardcoded 600s (removes FC_ADAPTIVE_CAP_MS): warm routes tighten toward
  clamp(3*p95, 120s, resolvedCeiling); slow routes keep their full ceiling.
- gap phase inherits the resolved initial CEILING (raw configured/builtin),
  not the adaptive-tightened value.
- corrected the in-band-error design note: an in-band error fails the turn
  cleanly and lets clients that HAVE a retry ladder back off; it does not
  assume every client auto-retries (verification was against a fork, not
  native codex).
- docs en/zh + website seeds updated to on-by-default semantics.
Derived docs (CONFIGURATION en/zh, website main.js/index.html) had drifted
from the yaml seeds the generator reads: the two follow-up feat commits
(route-adaptive refinement, out-of-the-box 720s builtin) updated the yaml
wording but the committed derived docs kept stale default-off-era phrasing
(e.g. tt.network still said 'firstContentTimeoutMs unset' while the same
table row said 'on by default'). Re-ran tools/gen-config-docs.mjs generate;
output is byte-stable on a second run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment