Skip to content

fix(ai-hook): bind Claude auto-continue to turn identity - #542

Open
wyr-zal wants to merge 2 commits into
Kuddev:mainfrom
wyr-zal:fix/claude-hook-delivery-auto-continue-20261008
Open

wyr-zal wants to merge 2 commits into
Kuddev:mainfrom
wyr-zal:fix/claude-hook-delivery-auto-continue-20261008

Conversation

@wyr-zal

@wyr-zal wyr-zal commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Gate queued Claude auto-continue by the hook ingress sequence so late cross-turn events cannot submit into a newer prompt.
  • Track the full set of Claude prompt identities per session, preserving long-history deduplication without dropping older identities.
  • Keep Claude-style agents separated by provider and session while sharing the turn lifecycle.
  • Add regression coverage for a stale identity replayed after many newer turns, a new-prompt failure after Working Enter, and reuse across sessions.

Closes #541

Evidence

  • Rebased onto official upstream/main 1b58f5dd74cdfd0ea5e8d0c79a5e55687250db12 (2026-10-28).
  • Targeted Windows Rust tests on the rebased commit: 23 + 30 + 5 + 4 + 1 + 1 + 1 = 65 passed, 0 failed.
  • Correction: the earlier nightly/token-equality evidence did not establish CI formatting compliance. Run 40806440095 failed rustfmt at three formatting locations in two files; its native test jobs were skipped. Commit 448a3b75 fixes only these line wraps.
  • Pinned Rust 1.97.1 targeted rustfmt checks now pass for all 29 affected Rust files (Windows CRLF checkout: --edition 2024 --config skip_children=true,newline_style=Windows --check). Both edited files retain CRLF, their non-whitespace content is unchanged, and git diff --check passes. The previous Windows behavior-test results are reused for this formatting-only commit; the new remote CI result is reported separately.
  • python scripts/check_architecture.py --base 1b58f5dd passed (1159 source files, 10 crates).
  • git diff --check and commit whitespace checks passed.
  • Remote run 40812851402: lint passed, including the CI rustfmt check, CI contracts, platform cfg budget and native-matrix planning. architecture-contracts and pr-size also passed. Native tests on five platforms are still running or queued; full-pipeline success is not yet established.

@wyr-zal
wyr-zal requested a review from Kuddev as a code owner October 8, 2026 09:23
@wyr-zal
wyr-zal force-pushed the fix/claude-hook-delivery-auto-continue-20261008 branch from 7f697c1 to 390dd6e Compare October 8, 2026 09:34
@Kuddev

Kuddev commented Oct 25, 2026

Copy link
Copy Markdown
Owner

按当前先合并 bug 修复的范围,已将 #540 的通知投递修复拆到 #764,保留对本 PR 和原作者的归属说明,并补了真实 detached subprocess 的失败前/修复后回归。terminalSequence fallback、提供方/错误隔离、正常 TTY 不重复发送和半帧不重投均有覆盖。

本 PR 中 #541 的自动 continue 是独立功能,仍留在这里评审;不因通知丢失而默认改变用户的自动输入行为。#764 没有复制自动续跑、prompt-id 重试策略或无关补全修改。待 #764 合入后,请基于 main 更新本 PR,并将标题、正文和关闭的 issue 改为剩余的自动续跑功能范围。

@wyr-zal

wyr-zal commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

收到,感谢拆分并保留贡献归属。等 #764 合入后,我会基于最新 main 整理 #542,仅保留 #541 自动续跑功能,同步更新标题、正文及 issue 关联,并补齐相关验证。

- 使用 Hook ingress 序号建立异步提交屏障。

- 保留 session 内完整 prompt_id 去重集合,拒绝旧回合重放。

- 覆盖长会话、跨 session ID 复用与新回合失败续跑回归。
@wyr-zal wyr-zal changed the title fix(ai-hook): deliver Claude hook events without a terminal and add bounded auto-continue fix(ai-hook): bind Claude auto-continue to turn identity Oct 29, 2026
@wyr-zal
wyr-zal force-pushed the fix/claude-hook-delivery-auto-continue-20261008 branch from d34750f to ae0ce35 Compare October 29, 2026 02:27
按 CI 固定的 Rust 1.97.1 格式化三处表达式换行,保留 CRLF,业务逻辑与校验规则不变。

验证:29 个改动 Rust 文件定向格式检查通过;两文件非空白内容一致,git diff --check 通过。
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.

[Feature] Claude 可重试错误的自动续跑(有边界、可关闭)

2 participants