-
Notifications
You must be signed in to change notification settings - Fork 867
Fix on config and log #921
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -402,7 +402,15 @@ private static void ProcessCommand(string id, PendingCommand pending) | |
| } | ||
|
|
||
| sw?.Stop(); | ||
| McpLogRecord.Log(command.type, parameters, logType, "SUCCESS", sw?.ElapsedMilliseconds ?? 0); | ||
|
|
||
| string syncLogStatus = "SUCCESS"; | ||
| string syncLogError = null; | ||
| if (result is ErrorResponse errResp) | ||
| { | ||
| syncLogStatus = "ERROR"; | ||
| syncLogError = errResp.Error; | ||
| } | ||
| McpLogRecord.Log(command.type, parameters, logType, syncLogStatus, sw?.ElapsedMilliseconds ?? 0, syncLogError); | ||
|
Comment on lines
+406
to
+413
Contributor
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. issue (bug_risk): Logged error status is inconsistent with the success status returned to the caller. Because |
||
|
|
||
| var response = new { status = "success", result }; | ||
| pending.TrySetResult(JsonConvert.SerializeObject(response)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -408,7 +408,6 @@ private static void InvokeWriteToConfig(string configPath, McpClient client) | |||||||||
| private static void AssertTransportConfiguration(JObject unity, McpClient client) | ||||||||||
| { | ||||||||||
| bool useHttp = EditorPrefs.GetBool(UseHttpTransportPrefKey, true); | ||||||||||
| bool isVSCode = client.IsVsCodeLayout; | ||||||||||
| bool isWindsurf = string.Equals(client.HttpUrlProperty, "serverUrl", StringComparison.OrdinalIgnoreCase); | ||||||||||
|
|
||||||||||
| if (useHttp) | ||||||||||
|
|
@@ -429,16 +428,9 @@ private static void AssertTransportConfiguration(JObject unity, McpClient client | |||||||||
| Assert.IsNull(unity["command"], "HTTP transport should remove command"); | ||||||||||
| Assert.IsNull(unity["args"], "HTTP transport should remove args"); | ||||||||||
|
|
||||||||||
| if (isVSCode) | ||||||||||
| { | ||||||||||
| Assert.AreEqual("http", (string)unity["type"], | ||||||||||
| "VSCode entries should advertise HTTP transport"); | ||||||||||
| } | ||||||||||
| else | ||||||||||
| { | ||||||||||
| Assert.IsNull(unity["type"], | ||||||||||
| "Non-VSCode entries should not include type metadata in HTTP mode"); | ||||||||||
| } | ||||||||||
| // "type" is now included for all clients (standard MCP protocol field). | ||||||||||
| Assert.AreEqual("http", (string)unity["type"], | ||||||||||
| "All entries should advertise HTTP transport type"); | ||||||||||
|
Comment on lines
+432
to
+433
|
||||||||||
| Assert.AreEqual("http", (string)unity["type"], | |
| "All entries should advertise HTTP transport type"); | |
| Assert.IsTrue((string)unity["type"] == "http" || (string)unity["type"] == "streamableHttp", | |
| "All HTTP entries should advertise a supported HTTP transport type (\"http\" or \"streamableHttp\")"); |
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.
issue (bug_risk): AssertTransportConfiguration now assumes all HTTP entries use "http" type, which contradicts the new Cline "streamableHttp" behavior.
This helper now conflicts with ConfigJsonBuilder, which sets "streamableHttp" for Cline. If tests use AssertTransportConfiguration with a Cline McpClient, the assertion will be incorrect and mask the client-specific behavior.
Please either make the assertion depend on the client type (e.g., "streamableHttp" for Cline, "http" for others) or introduce a separate helper for client-specific expectations. Also ensure there is at least one test that validates a Cline HTTP configuration end-to-end against "streamableHttp".
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 change introduces/retains a Cline-specific transport type ("streamableHttp") when using HTTP. There isn’t corresponding test coverage in WriteToConfigTests to lock in this behavior, so it’s easy to regress while refactoring the config builder. Consider adding a test case for a McpClient{name="Cline"} that asserts the generated config uses type=="streamableHttp" in HTTP mode (and still uses stdio type when HTTP is disabled).