Skip to content

fix: avoid duplicate tool results when resuming interrupts - #6270

Closed
alectimison-maker wants to merge 1 commit into
CopilotKit:mainfrom
alectimison-maker:fix/6201-interrupt-tool-results
Closed

alectimison-maker wants to merge 1 commit into
CopilotKit:mainfrom
alectimison-maker:fix/6201-interrupt-tool-results

Conversation

@alectimison-maker

Copy link
Copy Markdown

What does this PR do?

Fixes executor-less interrupt result ownership so suspend/resume agents can publish their real tool result without a client-generated result shadowing it.

  • synthesize ToolCallResult messages only for tool_call interrupts, whose tools have no executor
  • keep backend-owned interrupts limited to resume decisions
  • cover the shared interrupt state plus Angular and React consumers

Related PRs and Issues

Validation

  • pnpm -C packages/core test — 58 files, 616 tests passed
  • pnpm -C packages/angular test — 46 files, 293 tests passed
  • pnpm -C packages/react-core test — 122 files, 1,471 Vitest tests and 2 script tests passed
  • check-types passed for Core, Angular, and React Core
  • pre-commit affected-package test, publint, and attw targets passed for 21 projects
  • targeted formatting, lint, and git diff --check passed

Checklist

  • I have read the Contribution Guide
  • If the PR changes or adds functionality, I have updated the relevant documentation
  • "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone)

Documentation is unchanged because this corrects internal result ownership without changing the public API.

wolfmanfx added a commit that referenced this pull request Aug 13, 2026
## Summary

Only create client-side tool results for `tool_call` interrupts.
Backend-owned interrupts now resume without synthetic tool messages,
preventing duplicate results.

Includes Core, Angular, and React test coverage.

## References

- Fixes #6201
- Related: #6270
- [AG-UI interrupts](https://docs.ag-ui.com/concepts/interrupts)

## Validation

- [x] Core, Angular, and React tests
- [x] Full workspace test suite
- [x] Type checks
@BenTaylorDev

Copy link
Copy Markdown
Contributor

Thanks for this, and sorry for the slow response — this one got fixed in parallel before we got to your PR.

The same gate landed in #6470, merged 2026-08-13:

if (!interrupt.toolCallId || interrupt.reason !== "tool_call") return [];

It is on main today at packages/core/src/interrupt-state.ts:148, with the matching Core, Angular, and React Core test coverage. #6201 is closed.

Your diagnosis and the fix were correct — you and #6470 reached the identical one-line change independently. Closing this as already fixed rather than as wrong.

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.

injectInterrupt synthesizes tool results for interrupts whose agent emits the real ToolCallResult on resume

2 participants