feat(chat): /stop also kills background processes like desktop (#1409)

This commit is contained in:
m57 authored and GitHub committed 2026-09-30 14:33:07 +03:00
1 parent 05519ba1ff
commit 0e39a71591
8 files changed
+133 -4

No files matched your search

@@ -94,6 +94,9 @@ object WsMethods {
/** Kill a single background process (scoped to the active session). */
const val PROCESS_KILL = "process.kill"
/** Kill every background process in the gateway registry (`/stop`, global). */
const val PROCESS_STOP = "process.stop"
// ── Subagents (issue #1089) ───────────────────────────────────────────
/** List active subagents and delegations for a session. */
@@ -0,0 +1,15 @@
package com.m57.hermescontrol.data.ws.contract
import kotlinx.serialization.Serializable
/**
* `process.stop` kills every background process in the gateway registry (the desktop `/stop` second half). Desktop
* sends `{}`: the backend call is global, so no `session_id` or `profile` override is sent.
*/
@Serializable
data object ProcessStopParams
@Serializable
data class ProcessStopResult(
val killed: Int? = null,
)
@@ -363,6 +363,13 @@ object RpcMethods {
JsonElement.serializer(),
)
val PROCESS_STOP: RpcMethod<ProcessStopParams, ProcessStopResult> =
RpcMethod(
WsMethods.PROCESS_STOP,
ProcessStopParams.serializer(),
ProcessStopResult.serializer(),
)
// Passthrough JsonElement results: callers keep their existing legacy decoders.
val PLUGINS_MANAGE: RpcMethod<PluginsManageParams, JsonElement> =
RpcMethod(
@@ -514,6 +521,7 @@ object RpcMethods {
SUBAGENT_TAIL,
PROCESS_LIST,
PROCESS_KILL,
PROCESS_STOP,
PLUGINS_MANAGE,
PROJECTS_LIST,
PROFILES_LIST,