chore: drop gateway ipc remnants

This commit is contained in:
Peter Steinberger
2025-12-09 20:21:41 +00:00
parent 131864b940
commit a76d00a08e
8 changed files with 14 additions and 18 deletions

View File

@@ -128,17 +128,17 @@ enum DebugActions {
await HealthStore.shared.refresh(onDemand: true)
}
static func sendTestHeartbeat() async -> Result<ControlHeartbeatEvent?, String> {
static func sendTestHeartbeat() async -> Result<ControlHeartbeatEvent?, Error> {
do {
_ = await AgentRPC.shared.setHeartbeatsEnabled(true)
try await ControlChannel.shared.configure()
await ControlChannel.shared.configure()
let data = try await ControlChannel.shared.request(method: "last-heartbeat")
if let evt = try? JSONDecoder().decode(ControlHeartbeatEvent.self, from: data) {
return .success(evt)
}
return .success(nil)
} catch {
return .failure(error.localizedDescription)
return .failure(error)
}
}
@@ -149,7 +149,7 @@ enum DebugActions {
static func toggleVerboseLoggingMain() async -> Bool {
let newValue = !self.verboseLoggingEnabledMain
UserDefaults.standard.set(newValue, forKey: self.verboseDefaultsKey)
try? await ControlChannel.shared.request(
_ = try? await ControlChannel.shared.request(
method: "system-event",
params: ["text": AnyHashable("verbose-main:\(newValue ? "on" : "off")")])
return newValue

View File

@@ -4,11 +4,6 @@ import OSLog
import SwiftUI
struct HealthSnapshot: Codable, Sendable {
struct Ipc: Codable, Sendable {
let exists: Bool?
let path: String?
}
struct Web: Codable, Sendable {
struct Connect: Codable, Sendable {
let ok: Bool
@@ -37,7 +32,6 @@ struct HealthSnapshot: Codable, Sendable {
let ts: Double
let durationMs: Double
let web: Web
let ipc: Ipc?
let heartbeatSeconds: Int?
let sessions: Sessions
}

View File

@@ -261,7 +261,7 @@ final class InstancesStore: ObservableObject {
lastInputSeconds: nil,
mode: "health",
reason: "health probe",
text: "Health ok · linked=\(snap.web.linked) · ipc.exists=\(snap.ipc.exists)",
text: "Health ok · linked=\(snap.web.linked)",
ts: snap.ts)
if !self.instances.contains(where: { $0.id == entry.id }) {
self.instances.insert(entry, at: 0)

View File

@@ -244,6 +244,10 @@ final class WebChatManager {
static let shared = WebChatManager()
private var controller: WebChatWindowController?
func preferredSessionKey() -> String {
WorkActivityStore.shared.current?.sessionKey ?? "main"
}
func show(sessionKey: String) {
if self.controller == nil {
self.controller = WebChatWindowController(sessionKey: sessionKey)