mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 10:27:33 +00:00
* fix(computer): report a locked screen instead of missing Accessibility Behind the lock screen (display sleep, screen saver or a manual lock) macOS reports Accessibility as untrusted. Orca read that as a missing permission, and its recovery hint led agents to open System Settings. Check the session lock first and return screen_locked; permission setup refuses while locked. * fix(computer): recheck the lock under the provider lock and at setup launch * fix(computer): read the lock fresh for setup and keep locked status reads out of the cache * refactor(computer): drop the extra lock read at setup; the status and setup helper already check it
16 lines
712 B
Swift
16 lines
712 B
Swift
import OrcaComputerUseMacOSCore
|
|
import XCTest
|
|
|
|
final class SessionLockProbeTests: XCTestCase {
|
|
func testTheSessionLockFlagDecides() {
|
|
XCTAssertTrue(SessionLockProbe.isLocked(session: ["CGSSessionScreenIsLocked": kCFBooleanTrue as Any]))
|
|
XCTAssertTrue(SessionLockProbe.isLocked(session: ["CGSSessionScreenIsLocked": NSNumber(value: 1)]))
|
|
XCTAssertFalse(SessionLockProbe.isLocked(session: ["CGSSessionScreenIsLocked": kCFBooleanFalse as Any]))
|
|
}
|
|
|
|
func testAnAbsentKeyOrMissingSessionIsUnlocked() {
|
|
XCTAssertFalse(SessionLockProbe.isLocked(session: ["kCGSSessionOnConsoleKey": NSNumber(value: 1)]))
|
|
XCTAssertFalse(SessionLockProbe.isLocked(session: nil))
|
|
}
|
|
}
|