Skip to content

feat(core): session runner hot path — turn timeout, incremental history, snapshot dedupe - #181

Merged
LeXwDeX merged 1 commit into
devfrom
feat/session-runner-hotpath
Aug 7, 2026
Merged

feat(core): session runner hot path — turn timeout, incremental history, snapshot dedupe#181
LeXwDeX merged 1 commit into
devfrom
feat/session-runner-hotpath

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Aug 7, 2026

Copy link
Copy Markdown
Owner

内容

turn timeout 栈

  • agent 配置新增 timeout 字段(NonNegativeInt,description 说明语义);运行时 0/未设回退默认 600s,杜绝 0=立即超时
  • resolveTurnTimeout 按 Config.entries lowest→highest 取最后匹配(findLast,与 latest() 约定一致)——修复全局配置压过项目配置的优先级反转
  • DEFAULT_PROVIDER_TURN_TIMEOUT 独立常量落户 packages/core(不跨包引用 opencode dag 配置,注释说明解耦)
  • 依赖 feat(llm) http timeout(PR feat(llm): per-request timeout through http transport options #180 已合并)

增量 history + decode

  • history 增量读取(afterSeq 游标);decode 回归 Schema.decodeUnknownEffect typed 错误通道(去 try/catch 与 as MessageDecodeError 断言)

runner 状态卫生

  • 光标缓存随 drain 全出口 ensuring 逐出,baselineSeq 校验防陈旧;withBatch 批处理收敛

snapshot

  • captureIfChanged → captureDeduped(名实相符:始终 capture、tree ID 去重),调用点同步

测试

  • history-incremental.test.ts、session-runner-hotpath.test.ts(busy-wait 改有界 waitUntil+timeoutOrElse 5s;stub 按 test AGENTS.md 约定)、session-runner-tool-events 适配
  • 提交时 pre-commit 全量 typecheck + lint 通过;工作流内 core 1161 pass(2 个已知环境失败)

…ry, snapshot dedupe

- agent 配置新增 timeout 字段(NonNegativeInt;运行时 0/未设回退默认 600s,杜绝 0=立即超时);resolveTurnTimeout 按 Config.entries lowest→highest 取最后匹配(findLast,修全局配置压过项目配置的优先级反转)
- DEFAULT_PROVIDER_TURN_TIMEOUT 独立常量(packages/core 不跨包引用 opencode dag 配置,注释说明)
- history 增量读取(afterSeq 游标)+ decode 回归 Schema.decodeUnknownEffect typed 错误通道(去 try/catch 与 as 断言)
- runner 光标缓存随 drain 全出口 ensuring 逐出,baselineSeq 校验防陈旧;批处理 withBatch 收敛
- snapshot 助手更名 captureDeduped(名实相符:始终 capture、tree ID 去重),调用点同步
- 测试:history-incremental、session-runner-hotpath(busy-wait 改有界 waitUntil+timeoutOrElse,stub 按 test AGENTS.md 约定)、tool-events 适配
@LeXwDeX
LeXwDeX merged commit 5e9a772 into dev Aug 7, 2026
4 checks passed
@LeXwDeX
LeXwDeX deleted the feat/session-runner-hotpath branch August 7, 2026 02:56
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