fix(macos): clean warnings and harden gateway/talk config parsing

This commit is contained in:
Peter Steinberger
2026-02-25 00:27:31 +00:00
parent 9cd50c51b0
commit ce1dbeb986
15 changed files with 331 additions and 284 deletions

View File

@@ -13,8 +13,10 @@ extension OnboardingView {
guard self.state.connectionMode == .local else { return }
let configured = await self.loadAgentWorkspace()
let url = AgentWorkspace.resolveWorkspaceURL(from: configured)
switch AgentWorkspace.bootstrapSafety(for: url) {
case .safe:
let safety = AgentWorkspace.bootstrapSafety(for: url)
if let reason = safety.unsafeReason {
self.workspaceStatus = "Workspace not touched: \(reason)"
} else {
do {
_ = try AgentWorkspace.bootstrap(workspaceURL: url)
if (configured ?? "").trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
@@ -23,8 +25,6 @@ extension OnboardingView {
} catch {
self.workspaceStatus = "Failed to create workspace: \(error.localizedDescription)"
}
case let .unsafe (reason):
self.workspaceStatus = "Workspace not touched: \(reason)"
}
self.refreshBootstrapStatus()
}
@@ -54,7 +54,7 @@ extension OnboardingView {
do {
let url = AgentWorkspace.resolveWorkspaceURL(from: self.workspacePath)
if case let .unsafe (reason) = AgentWorkspace.bootstrapSafety(for: url) {
if let reason = AgentWorkspace.bootstrapSafety(for: url).unsafeReason {
self.workspaceStatus = "Workspace not created: \(reason)"
return
}