Skip to content

Comments

fix: accept empty string result in attempt_completion tool#11646

Closed
roomote[bot] wants to merge 1 commit intomainfrom
fix/attempt-completion-empty-string
Closed

fix: accept empty string result in attempt_completion tool#11646
roomote[bot] wants to merge 1 commit intomainfrom
fix/attempt-completion-empty-string

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 20, 2026

Opened by @roomote on behalf of Hannes Rudolph

Fixes #11404 -- The attempt_completion tool was incorrectly rejecting empty string results.

Problem

The existing code used a truthy check (if (!result) / if (args.result)) which treated empty strings ("") as falsy, causing valid empty-string completions to be rejected with a missing nativeArgs error.

Solution

Changed the truthy check to an explicit existence check (!== undefined) in both the streaming and finalize parse paths in NativeToolCallParser.ts.

Changes

  • src/core/assistant-message/NativeToolCallParser.ts: Two truthy checks changed to !== undefined
  • src/core/assistant-message/__tests__/NativeToolCallParser.spec.ts: Three regression tests added

Testing

  • Empty string results are accepted
  • Non-empty results continue to work
  • Streaming path handles empty string results correctly

View task on Roo Code Cloud

Interactively review PR in Roo Code Cloud

Change truthy check to explicit undefined check in NativeToolCallParser.ts
so that empty string results are not incorrectly rejected.

Fixes #11404
@roomote roomote bot closed this Feb 20, 2026
@roomote roomote bot deleted the fix/attempt-completion-empty-string branch February 20, 2026 20:49
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 20, 2026
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.

Tool execution fails: attempt_completion missing nativeArgs for Z-AI and Ollama after provider migrations

1 participant