-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix apply-diff test and add ntc apply-diff test #10185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Re-reviewed at bdd2326. All issues from previous reviews remain fixed. No new issues found.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| toolProtocol: "native", // Enable native tool calling | ||
| apiProvider: "openrouter", // Use Anthropic provider directly | ||
| apiModelId: "openai/gpt-5.1", // Claude Sonnet 4.5 supports native tools |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Fix this please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
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.
| 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"}`, | ||
| ) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. All local checks passed.
|
|
||
| <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} |
There was a problem hiding this comment.
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}.
| Target File: ${testFile.content} | |
| Target File: ${testFile.name} |
Fix it with Roo Code or mention @roomote and request a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Update this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. All local checks passed.
0121f71 to
836aa04
Compare
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:runin the e2e app or with the debug launch profile.Pre-Submission Checklist
Important
Add native tool calling tests for
apply_diffand remove outdated tests invscode-e2e.apply-diff-native.test.tsto test native tool calling forapply_diff.apply-diff.test.ts, which contained outdated tests.NativeProtocolVerificationinterface to track native protocol usage.createVerificationState()andassertNativeProtocolUsed()to ensure native protocol is used.This description was created by
for bdd2326. You can customize this summary. It will automatically update as commits are pushed.