-
-
Notifications
You must be signed in to change notification settings - Fork 450
fix: normalize MCP elicitation requests with empty message
#895
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
Conversation
🦋 Changeset detectedLatest commit: eee121b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment has been minimized.
This comment has been minimized.
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.
1 issue found across 8 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="examples/with-mcp-elicitation/src/index.ts">
<violation number="1" location="examples/with-mcp-elicitation/src/index.ts:13">
P2: Dead code: `startMcpServer(port, logger)` will never be called because `serverUrl` is hardcoded to a truthy string. The `||` fallback is unreachable. Either remove the fallback or use a conditional that can actually be falsy (e.g., uncomment the env var access).</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
|
|
||
| const { url } = await startMcpServer(port, logger); | ||
| const serverUrl = "http://127.0.0.1:3142/mcp"; // process.env.MCP_SERVER_URL?.trim(); | ||
| const resolvedUrl = serverUrl || (await startMcpServer(port, logger)).url; |
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.
P2: Dead code: startMcpServer(port, logger) will never be called because serverUrl is hardcoded to a truthy string. The || fallback is unreachable. Either remove the fallback or use a conditional that can actually be falsy (e.g., uncomment the env var access).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/with-mcp-elicitation/src/index.ts, line 13:
<comment>Dead code: `startMcpServer(port, logger)` will never be called because `serverUrl` is hardcoded to a truthy string. The `||` fallback is unreachable. Either remove the fallback or use a conditional that can actually be falsy (e.g., uncomment the env var access).</comment>
<file context>
@@ -9,14 +9,14 @@ const logger = createPinoLogger({
-
-const { url } = await startMcpServer(port, logger);
+const serverUrl = "http://127.0.0.1:3142/mcp"; // process.env.MCP_SERVER_URL?.trim();
+const resolvedUrl = serverUrl || (await startMcpServer(port, logger)).url;
const mcpConfig = new MCPConfiguration({
</file context>
Deploying voltagent with
|
| Latest commit: |
eee121b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2dddda92.voltagent.pages.dev |
| Branch Preview URL: | https://bug-with-mcp-elicitation.voltagent.pages.dev |
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
What is the new behavior?
fixes (issue)
Notes for reviewers
Summary by cubic
Fixes empty-message MCP elicitations by deriving a prompt from the JSON Schema so handlers always receive a usable message. Prevents blank prompts when servers omit message.
Bug Fixes
New Features
Written for commit eee121b. Summary will update automatically on new commits.