Repository navigation
Bug 2080970 - Migrate dialog tools to BiDi #234
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import { mkdtempSync } from 'node:fs'; | |
| import { tmpdir } from 'node:os'; | ||
| import { join, resolve } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { test } from 'vitest'; | ||
| import { removeDir } from './fs.js'; | ||
| import type { ToolArgsOf } from '@/types/tool-args.js'; | ||
| import type { MODULES } from '@/tools/index.js'; | ||
|
|
@@ -88,3 +89,11 @@ export async function startMcpServer(serverArgs: string[] = []): Promise<McpTest | |
| }, | ||
| }; | ||
| } | ||
|
|
||
| export const mcpTest = test | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixture is really nice, we don't have that many mcp/ tests, but that looks a lot better. Should we update docs/testing.md to mention this instead of |
||
| .extend('mcpServerArgs', { scope: 'file' }, [] as string[]) | ||
| .extend('mcp', { scope: 'file' }, async ({ mcpServerArgs }, { onCleanup }) => { | ||
| const server = await startMcpServer(mcpServerArgs); | ||
| onCleanup(() => server.close()); | ||
| return server; | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 will cause a regression in one edge case, when
promptis called with a default value, egprompt("favorite color", "pink"). Previously the default value would be used if promptText was undefined, but here we will default to empty string.We can workaround by listening to
userPromptOpenedand storing thedefaultValue, but that sounds quite hacky.To be honest I think this is rather a BiDi spec issue, because there is no easy way to use the default value of a prompt, but maybe we should still work around this here.
Or we can also wait and handle that when we fix Bug 2081600 - [firefox-devtools-mcp] Report open alert/confirm/prompt dialogs and the tools that handle them, which will require to listen to this event anyway.
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.
Let's handle this together with 2081600.