Skip to content

chore: continue chat even with incomplete tools#407

Merged
ElasticBottle merged 1 commit intomainfrom
winston/continue-even-with-incomplete-tools
Mar 10, 2026
Merged

chore: continue chat even with incomplete tools#407
ElasticBottle merged 1 commit intomainfrom
winston/continue-even-with-incomplete-tools

Conversation

@ElasticBottle
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 10, 2026 18:23
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 10, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/@rectangular-labs/emails@407
pnpm add https://pkg.pr.new/@rectangular-labs/loro-file-system@407
pnpm add https://pkg.pr.new/@rectangular-labs/result@407

commit: b3c5bed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SEO AI “writer” and “strategist” chat agents to keep conversations running even when prior chat history contains incomplete tool-call messages.

Changes:

  • Pass ignoreIncompleteToolCalls: true to convertToModelMessages in the writer agent.
  • Pass ignoreIncompleteToolCalls: true to convertToModelMessages in the strategist agent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/api-seo/src/lib/ai/writer-agent.ts Enables ignoring incomplete tool-call message parts during message conversion for the writer chat agent.
packages/api-seo/src/lib/ai/strategist-agent.ts Enables ignoring incomplete tool-call message parts during message conversion for the strategist chat agent.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the stability and flow of AI agent conversations by introducing a mechanism to gracefully handle incomplete tool calls. By configuring the message conversion process to ignore such incomplete calls, the system ensures that AI agents can maintain continuous dialogue, thereby enhancing the overall reliability of AI-driven interactions.

Highlights

  • AI Agent Robustness: Modified the strategist-agent.ts and writer-agent.ts files to enhance AI agent resilience by passing ignoreIncompleteToolCalls: true to the convertToModelMessages function. This change allows AI agents to continue processing messages even when tool calls are not fully specified, preventing potential conversation stalls.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/api-seo/src/lib/ai/strategist-agent.ts
    • Updated the convertToModelMessages function call to include the ignoreIncompleteToolCalls: true option.
  • packages/api-seo/src/lib/ai/writer-agent.ts
    • Updated the convertToModelMessages function call to include the ignoreIncompleteToolCalls: true option.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

Cloudflare Preview URL for WWW 🎈 : https://pr-407.rectangularlabs.com (custom domain)
Cloudflare Preview URL for SEO 🎈 : https://pr-407.fluidposts.com (custom domain)
Cloudflare Preview URL for SEO WWW 🎈 : https://www-pr-407.fluidposts.com (custom domain)
Cloudflare Preview URL for SEO Contact 🎈 : https://contact-pr-407.fluidposts.com (custom domain)

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces ignoreIncompleteToolCalls: true to handle incomplete tool calls and allow chats to continue. While this improves robustness, it might also hide underlying issues that cause these incomplete calls. Consider adding logging to track how often this occurs to help identify and fix root causes without impacting the user experience. Additionally, I've noted some code duplication between strategist-agent.ts and writer-agent.ts that could be refactored for better maintainability.

Comment on lines +204 to +206
messages: await convertToModelMessages(messages, {
ignoreIncompleteToolCalls: true,
}),

Choose a reason for hiding this comment

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

medium

The logic for creating the streamText options object is duplicated in writer-agent.ts. This change highlights the issue, as ignoreIncompleteToolCalls: true had to be added in both places. To improve maintainability, consider extracting the common object creation logic into a shared helper function.

@ElasticBottle ElasticBottle merged commit 2294dbd into main Mar 10, 2026
12 checks passed
@ElasticBottle ElasticBottle deleted the winston/continue-even-with-incomplete-tools branch March 10, 2026 19:32
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.

2 participants