Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Jan 27, 2026

Description

For dangling tool calls in normal messages, add cancelled messages in chat history.

closes CON-5280

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Continue Tasks: ▶️ 2 queued — View all


Summary by cubic

Adds “Tool cancelled” messages to the chat when an assistant tool call has no matching result. Prevents dangling tool calls and keeps history consistent (CON-5280).

  • Bug Fixes
    • Track toolCallIds with results from tool messages and toolCallStates.
    • Insert a “Tool cancelled” tool message for any assistant toolCall without a result.
    • Applies to normal messages to remove dangling tool call entries.

Written for commit 5e5f5b9. Summary will update on new commits.

@uinstinct uinstinct requested a review from a team as a code owner January 27, 2026 15:01
@uinstinct uinstinct requested review from sestinj and removed request for a team January 27, 2026 15:01
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 27, 2026
@uinstinct uinstinct changed the title fix: add cancelled tool messages improve: add cancelled tool messages Jan 27, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uinstinct constructMessages already defaults to a NO_TOOL_CALL_OUTPUT_MESSAGE case for any toolCallState without tool output. Could you check why this isn't working? It seems like maybe toolCalls and toolCallStates are getting out of sync?

});
}

console.log("debug1 msg->", msgs);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log

@uinstinct
Copy link
Contributor Author

@uinstinct constructMessages already defaults to a NO_TOOL_CALL_OUTPUT_MESSAGE case for any toolCallState without tool output. Could you check why this isn't working? It seems like maybe toolCalls and toolCallStates are getting out of sync?

Should have checked this one before putting up the PR - had initially thought there might be problem in parallel tool calls so went ahead with resolution before checking the cause.

Checked and found out that cancelled tool messages are present for both normal and parallel tool calls. Compaction also works due to the earlier pr

closing this PR

@uinstinct uinstinct closed this Feb 2, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Feb 2, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants