-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix MCP test independence #5046
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
@@ -841,7 +940,40 @@ suite("Roo Code use_mcp_tool Tool", function () { | |||
} | |||
} | |||
api.on("taskCompleted", taskCompletedHandler) | |||
await sleep(2000) // Wait for Roo Code to fully initialize |
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.
Could we hook into our event emitter to determine if we're initialized instead of sleeping?
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.
It seems like taskStarted
will not wait for MCP servers to be initialized causing the model to not see them.
Do you know of any event I can use to wait for the MCP servers to initialize?
interface RooCodeAPIEvents {
message: [data: {
taskId: string;
action: "created" | "updated";
message: ClineMessage;
}];
taskCreated: [taskId: string];
taskStarted: [taskId: string];
taskModeSwitched: [taskId: string, mode: string];
taskPaused: [taskId: string];
taskUnpaused: [taskId: string];
taskAskResponded: [taskId: string];
taskAborted: [taskId: string];
taskSpawned: [parentTaskId: string, childTaskId: string];
taskCompleted: [taskId: string, tokenUsage: TokenUsage, toolUsage: ToolUsage, isSubtask: IsSubtask];
taskTokenUsageUpdated: [taskId: string, tokenUsage: TokenUsage];
taskToolFailed: [taskId: string, toolName: ToolName, error: string];
}
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.
Maybe we should add one?
…on MCP server initialization
We have finished reviewing your PR. We have found no vulnerabilities. Reply to this PR with |
Ensures each MCP test sets up its own configuration independently by adding alwaysAllow permissions setup to all tests. This prevents test failures when tests run in different orders.
Important
Ensures MCP test independence by setting up individual configurations and introduces
mcpServersInitialized
event for server initialization handling.use-mcp-tool.test.ts
sets up its own configuration independently by modifying themcpConfig
to includealwaysAllow
permissions.use-mcp-tool.test.ts
.mcpServersInitialized
event toRooCodeAPIEvents
inapi.ts
andipc.ts
.mcpServersInitialized
inMcpHub
after server connections are updated.ClineProviderEvents
inClineProvider.ts
to includemcpServersInitialized
.API
inapi.ts
to listen formcpServersInitialized
and emit it.This description was created by
for e52478f. You can customize this summary. It will automatically update as commits are pushed.