Revert "fix: auto-start rpc worker for agent calls"

This reverts commit e70f8471a8.
This commit is contained in:
Peter Steinberger
2025-12-07 05:54:47 +01:00
parent e70f8471a8
commit 1d38f5a4d5
2 changed files with 5 additions and 15 deletions

View File

@@ -14,10 +14,8 @@ actor AgentRPC {
private struct RpcError: Error { let message: String }
func send(text: String, thinking: String?, session: String) async -> (ok: Bool, text: String?, error: String?) {
if process?.isRunning != true {
do { try await ensureRunning() } catch {
return (false, nil, "rpc worker not running")
}
guard process?.isRunning == true else {
return (false, nil, "rpc worker not running")
}
do {
let payload: [String: Any] = [
@@ -25,7 +23,6 @@ actor AgentRPC {
"text": text,
"session": session,
"thinking": thinking ?? "default",
"deliver": true,
]
let data = try JSONSerialization.data(withJSONObject: payload)
guard let stdinHandle else { throw RpcError(message: "stdin missing") }
@@ -59,10 +56,8 @@ actor AgentRPC {
}
func status() async -> (ok: Bool, error: String?) {
if process?.isRunning != true {
do { try await ensureRunning() } catch {
return (false, "rpc worker not running")
}
guard process?.isRunning == true else {
return (false, "rpc worker not running")
}
do {
let payload: [String: Any] = ["type": "status"]
@@ -119,11 +114,6 @@ actor AgentRPC {
}
}
private func ensureRunning() async throws {
if let process, process.isRunning { return }
try await start()
}
private func stop() async {
stdoutHandle?.readabilityHandler = nil
process?.terminate()

View File

@@ -24,7 +24,7 @@ let modelCatalogPathKey = "clawdis.modelCatalogPath"
let modelCatalogReloadKey = "clawdis.modelCatalogReload"
let voiceWakeSupported: Bool = ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 26
let cliHelperSearchPaths = ["/usr/local/bin", "/opt/homebrew/bin"]
let defaultVoiceWakeForwardCommand = "clawdis-mac agent --message \"${text}\" --thinking low --session main --deliver"
let defaultVoiceWakeForwardCommand = "clawdis-mac agent --message \"${text}\" --thinking low"
let defaultVoiceWakeForwardPort = 22
// Allow enough time for remote agent responses (LLM replies often take >10s).
let defaultVoiceWakeForwardTimeout: TimeInterval = 30