Skip to content

Conversation

@dcbartlett
Copy link
Collaborator

@dcbartlett dcbartlett commented Dec 18, 2025

Description

Fixes the Apply-Diff e2e test. Adds new tests for native tooling for apply-diff
Adds debug launch configuration for e2e tests.

Test Procedure

Run e2e test suite using pnpm test:run in the e2e app or with the debug launch profile.

Pre-Submission Checklist

  • [-] Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • [-] Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Important

Add native tool calling tests for apply_diff and remove outdated tests in vscode-e2e.

  • Tests:
    • Add apply-diff-native.test.ts to test native tool calling for apply_diff.
    • Remove apply-diff.test.ts, which contained outdated tests.
    • New tests cover scenarios like modifying file content, handling errors, and applying multiple search/replace blocks.
  • Verification:
    • Implement NativeProtocolVerification interface to track native protocol usage.
    • Use createVerificationState() and assertNativeProtocolUsed() to ensure native protocol is used.
  • Misc:
    • Add debug launch configuration for e2e tests.

This description was created by Ellipsis for bdd2326. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. bug Something isn't working labels Dec 18, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 18, 2025

Rooviewer Clock   See task on Roo Cloud

Re-reviewed at bdd2326. All issues from previous reviews remain fixed. No new issues found.

  • Misleading comments about model/provider (e.g., "Claude Sonnet 4.5" comment with OpenAI model ID)
  • Native protocol verification doesn't actually assert hasNativeApiProtocol is true
  • Error handling test uses testFile.content instead of testFile.name for target file
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines 422 to 424
toolProtocol: "native", // Enable native tool calling
apiProvider: "openrouter", // Use Anthropic provider directly
apiModelId: "openai/gpt-5.1", // Claude Sonnet 4.5 supports native tools
Copy link
Contributor

Choose a reason for hiding this comment

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

The comments here are misleading: "Use Anthropic provider directly" but apiProvider is "openrouter", and "Claude Sonnet 4.5 supports native tools" but apiModelId is "openai/gpt-5.1". These inconsistencies appear in all 5 tests in this file and could confuse future maintainers about which provider/model is actually being tested.

Fix it with Roo Code or mention @roomote and request a fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@roomote Fix this please.

Copy link
Contributor

@roomote roomote bot Dec 18, 2025

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the misleading comments in all 4 tests. Changed "Use Anthropic provider directly" to "Use OpenRouter provider" and "Claude Sonnet 4.5 supports native tools" to "GPT-5.1 supports native tools". All local checks passed.

View commit | Revert commit

Comment on lines 55 to 76
function assertNativeProtocolUsed(verification: NativeProtocolVerification, testName: string): void {
// Check that apiProtocol was set (indicates API was called)
assert.ok(
verification.apiProtocol !== null,
`[${testName}] apiProtocol should be set in api_req_started message. ` +
`This indicates an API request was made.`,
)

// Check that response doesn't contain XML tool tags
assert.strictEqual(
verification.responseIsNotXML,
true,
`[${testName}] Response should NOT contain XML tool tags. ` +
`Found XML tags which indicates XML protocol was used instead of native.`,
)

// Check that tool was executed
assert.strictEqual(
verification.toolWasExecuted,
true,
`[${testName}] Tool should have been executed. ` + `Executed tool: ${verification.executedToolName || "none"}`,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This verification function only checks apiProtocol !== null, but doesn't assert that hasNativeApiProtocol is true. The test suite is specifically for "Native Tool Calling", yet this would pass if a non-native protocol (e.g., "xml") was used. Consider adding assert.strictEqual(verification.hasNativeApiProtocol, true, ...) to properly verify that native protocol is actually being used.

Fix it with Roo Code or mention @roomote and request a fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@roomote Let's add this.

Copy link
Contributor

@roomote roomote bot Dec 18, 2025

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit


<task>
Test the apply_diff tool's error handling by attempting to replace a pattern that does not exist in the target file.
Target File: ${testFile.content}
Copy link
Contributor

Choose a reason for hiding this comment

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

This line uses ${testFile.content} which outputs "Original content" instead of ${testFile.name} which would provide the actual filename. The AI will see "Target File: Original content" and won't know which file to operate on. This differs from the original apply-diff.test.ts which correctly uses ${testFile.name}.

Suggested change
Target File: ${testFile.content}
Target File: ${testFile.name}

Fix it with Roo Code or mention @roomote and request a fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@roomote Update this

Copy link
Contributor

@roomote roomote bot Dec 18, 2025

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 18, 2025
@dcbartlett dcbartlett force-pushed the dbartlett/e2e-ntc-tests branch from 0121f71 to 836aa04 Compare December 18, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants