Skip to content

fix(compass-assistant): resend after auto-run tool calls complete COMPASS-11386 - #8715

Merged
dudaschar merged 1 commit into
mainfrom
COMPASS-11386-stream
Nov 19, 2026
Merged

dudaschar merged 1 commit into
mainfrom
COMPASS-11386-stream

Conversation

@dudaschar

Copy link
Copy Markdown
Collaborator

Description

createDefaultChat only set sendAutomaticallyWhen to lastAssistantMessageIsCompleteWithApprovalResponses, so the chat only sen again after the user approved a tool call.

Tools that don't need approval run inside the request that called them, and the transport is single-step (streamText has no stopWhen). Once such a tool finished, nothing sent again and the model never saw the result. The user got
the raw tool output and no text reply.

sendAutomaticallyWhen now also returns true when lastAssistantMessageIsCompleteWithToolCalls is, so the model responds to the tool result.

The approval flow shouldn't change. After the follow-up text, the last step has no tool calls, and denied tools don't count as complete.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

#8705 removed needsApproval from the Compass tools to match the mongodb-mcp-server defaults. That exposed this gap: with no approval step, nothing triggered the follow-up request.

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@dudaschar dudaschar self-assigned this Nov 19, 2026
@dudaschar
dudaschar requested a review from a team as a code owner November 19, 2026 17:59
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the change restoring follow-up responses after completed tool calls.

No open issues 🎉

What changed in this PR

Restores Compass Assistant’s follow-up responses after tools run without approval, addressing the gap exposed by #8705. The change is narrowly scoped and includes focused regression coverage.

Changes:

  • Extends automatic resending to completed tool calls while retaining approval-response handling.
  • Adds tests for tool-result follow-ups and stopping after plain-text responses.
File Description
packages/​compass-assistant/​src/​compass-assistant-provider.tsx Enables automatic follow-up requests after completed tool calls.
packages/​compass-assistant/​src/​compass-assistant-provider.spec.tsx Adds regression tests for automatic follow-ups and plain-text completion.

Review effort: Balanced

@dudaschar
dudaschar merged commit 24e318a into main Nov 19, 2026
62 checks passed
@dudaschar
dudaschar deleted the COMPASS-11386-stream branch November 19, 2026 20:54
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.

5 participants