mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
## Summary - stop the macOS helper from unlinking caller-supplied socket and token paths - keep parent-owned token cleanup tied to the helper startup that created it - fail closed for non-socket socket-path collisions and cover helper cleanup races with regression tests ## Verification - swift test --package-path native/computer-use-macos - pnpm exec vitest run --config config/vitest.config.ts src/main/computer/macos-native-provider-client.test.ts - pnpm run typecheck:node - pnpm lint - pnpm run build:computer-macos - Electron/helper startup smoke validation
22 lines
906 B
Swift
22 lines
906 B
Swift
import XCTest
|
|
|
|
final class AgentEntrypointSourceSafetyTests: XCTestCase {
|
|
func testAgentEntrypointDoesNotUnlinkCallerSuppliedPaths() throws {
|
|
let testFile = URL(fileURLWithPath: #filePath)
|
|
let packageRoot = testFile
|
|
.deletingLastPathComponent()
|
|
.deletingLastPathComponent()
|
|
.deletingLastPathComponent()
|
|
let mainPath = packageRoot
|
|
.appendingPathComponent("Sources")
|
|
.appendingPathComponent("OrcaComputerUseMacOS")
|
|
.appendingPathComponent("main.swift")
|
|
let source = try String(contentsOf: mainPath, encoding: .utf8)
|
|
|
|
// Why: --agent accepts caller-supplied paths; deleting them in the
|
|
// helper can remove user files if argument validation is bypassed.
|
|
XCTAssertFalse(source.contains("unlink(tokenPath)"))
|
|
XCTAssertFalse(source.contains("unlink(socketPath)"))
|
|
}
|
|
}
|