diff --git a/sidecar/tests/Aryx.AgentHost.Tests/AryxCopilotAgentMessageOptionsTests.cs b/sidecar/tests/Aryx.AgentHost.Tests/AryxCopilotAgentMessageOptionsTests.cs index 3959020..cdada84 100644 --- a/sidecar/tests/Aryx.AgentHost.Tests/AryxCopilotAgentMessageOptionsTests.cs +++ b/sidecar/tests/Aryx.AgentHost.Tests/AryxCopilotAgentMessageOptionsTests.cs @@ -10,13 +10,14 @@ public sealed class AryxCopilotAgentMessageOptionsTests [Fact] public async Task ProcessMessageAttachmentsAsync_MapsProtocolAttachmentsAndMessageMode() { + string attachmentPath = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "aryx-tests", "assets", "diagram.png")); ChatMessage message = new(ChatRole.User, "Please inspect these images."); message.Contents.Add(new AIContent { RawRepresentation = new ChatMessageAttachmentDto { Type = "file", - Path = @"C:\workspace\project\assets\diagram.png", + Path = attachmentPath, DisplayName = "diagram.png", }, }); @@ -47,7 +48,7 @@ public sealed class AryxCopilotAgentMessageOptionsTests first => { UserMessageDataAttachmentsItemFile file = Assert.IsType(first); - Assert.Equal(@"C:\workspace\project\assets\diagram.png", file.Path); + Assert.Equal(attachmentPath, file.Path); Assert.Equal("diagram.png", file.DisplayName); }, second => diff --git a/sidecar/tests/Aryx.AgentHost.Tests/HookCommandRunnerTests.cs b/sidecar/tests/Aryx.AgentHost.Tests/HookCommandRunnerTests.cs index 8f82cb7..183dcf9 100644 --- a/sidecar/tests/Aryx.AgentHost.Tests/HookCommandRunnerTests.cs +++ b/sidecar/tests/Aryx.AgentHost.Tests/HookCommandRunnerTests.cs @@ -71,8 +71,8 @@ public sealed class HookCommandRunnerTests string hooksDirectory = Directory.CreateDirectory(Path.Combine(project.Path, "scripts")).FullName; HookCommandDefinition hook = CreatePlatformHook( OperatingSystem.IsWindows() - ? "Write-Output ((Get-Location).Path + '|' + $env:HOOK_TEST_ENV)" - : "printf '%s|%s' \"$(pwd)\" \"$HOOK_TEST_ENV\"", + ? "$null = [Console]::In.ReadToEnd(); Write-Output ([Environment]::CurrentDirectory + '|' + $env:HOOK_TEST_ENV)" + : "cat >/dev/null; printf '%s|%s' \"$(pwd)\" \"$HOOK_TEST_ENV\"", cwd: "scripts", env: new Dictionary { diff --git a/src/main/services/mcpOAuthService.ts b/src/main/services/mcpOAuthService.ts index cac303a..50957c7 100644 --- a/src/main/services/mcpOAuthService.ts +++ b/src/main/services/mcpOAuthService.ts @@ -1,12 +1,14 @@ import { randomBytes, createHash } from 'node:crypto'; import { createServer, type Server, type IncomingMessage, type ServerResponse } from 'node:http'; -import { shell } from 'electron'; +import electron from 'electron'; import type { McpOauthStaticClientConfig } from '@shared/domain/mcpAuth'; import { storeToken, buildWellKnownUrl, buildWellKnownUrlFallback, type McpOAuthToken } from './mcpTokenStore'; +const { shell } = electron; + /* ── Public API ──────────────────────────────────────────────── */ export interface McpOAuthFlowOptions {