Skip to content

fix(agent): expose current turn cancellation completion - #695

Merged
san-ci[bot] merged 4 commits into
genai-io:mainfrom
yanmxa:fix/turn-cancellation
Oct 30, 2026
Merged

san-ci[bot] merged 4 commits into
genai-io:mainfrom
yanmxa:fix/turn-cancellation

Conversation

@yanmxa

@yanmxa yanmxa commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Change

  • Add Runtime.InterruptCurrentTurn() <-chan struct{}: request cancellation immediately and observe execution completion.
  • Repeated cancellation during unwind returns the same signal.
  • Keep the existing TUI InterruptTurn() 250 ms bounded wait.

Completion covers execution only, not event handling or persistence. Idle/input semantics remain unchanged; no ACP endpoint is added.

Validation

  • Full Go tests, relevant race suites and lint passed; tmux startup/input/exit smoke passed.
  • Production OpenAI Chat driver + local HTTP server: cancel before headers and during streaming aborts the request; completion waits for transport cleanup, with no retry or successor request observed.
  • Slow-tool unwind is covered automatically. Remote provider computation/billing and other provider protocols are not verified by this HTTP test.

Signed-off-by: Meng Yan <yanmxa@gmail.com>
@san-ci san-ci Bot added the dco:yes label Oct 30, 2026
@san-ci

san-ci Bot commented Oct 30, 2026

Copy link
Copy Markdown

[REVIEW NOTIFIER] This PR requires a review from @hchenxa.

Once this PR has been reviewed and has the lgtm label, it will be automatically squash-merged.

Suggested reviewer

Based on OWNERS, @hchenxa is suggested to review this PR.

How to get your PR reviewed:

  • Address reviewer feedback and push changes
  • Reviewer adds lgtm label when satisfied
  • An approving review + lgtm will trigger auto-merge

@san-ci san-ci Bot added the approved label Oct 30, 2026
@san-ci

san-ci Bot commented Oct 30, 2026

Copy link
Copy Markdown

[REVIEW NOTIFIER] This PR requires a review from @hchenxa.

Once this PR has been reviewed and has the lgtm label, it will be automatically squash-merged.

Suggested reviewer

Based on OWNERS, @hchenxa is suggested to review this PR.

How to get your PR reviewed:

  • Address reviewer feedback and push changes
  • Reviewer adds lgtm label when satisfied
  • An approving review + lgtm will trigger auto-merge

Signed-off-by: Meng Yan <yanmxa@gmail.com>
Signed-off-by: Meng Yan <yanmxa@gmail.com>
Signed-off-by: Meng Yan <yanmxa@gmail.com>
@zhujian7

Copy link
Copy Markdown
Contributor

/lgtm

@san-ci san-ci Bot added the lgtm label Oct 30, 2026
@san-ci
san-ci Bot merged commit a22c125 into genai-io:main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants