Remove polymorphic service and backend-mode enums
Intent: Eliminate the unused GuestServiceKind, GuestServiceBackendMode, GuestServiceLaunch, GuestOpenclawDaemonBackend, GuestAcpBackend, and GuestServiceReadinessCheck types that existed to support multiple service variants but were only ever instantiated for the OpenClaw gateway with native backend.
Affected files: crates/pika-server/src/managed_openclaw_guest.rs
@@ -15,173 +15,48 @@ pub(crate) const GUEST_OPENCLAW_CONFIG_PATH: &str = "workspace/pika-agent/opencl
-#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(rename_all = "snake_case")]
-enum GuestServiceKind {
- PikachatDaemon,
- OpenclawGateway,
-}
-
-#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(rename_all = "snake_case")]
-enum GuestServiceBackendMode {
- Native,
- Acp,
-}
@@ -15,173 +15,48 @@
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(tag = "kind", rename_all = "snake_case")]
-enum GuestServiceLaunch {
- PikachatDaemon {
- #[serde(skip_serializing_if = "Option::is_none")]
- acp_backend: Option<GuestAcpBackend>,
- },
- OpenclawGateway {
- exec_command: String,
- state_dir: String,
- config_path: String,
- gateway_port: u16,
- daemon_backend: GuestOpenclawDaemonBackend,
- },
-}
@@ -15,173 +15,48 @@
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(tag = "kind", rename_all = "snake_case")]
-enum GuestServiceReadinessCheck {
- LogContains {
- path: String,
- pattern: String,
- ready_probe: String,
- timeout_failure_reason: String,
- },
- HttpGetOk {
- url: String,
- ready_probe: String,
- timeout_failure_reason: String,
- },
-}
The old design defined five enum types to model a generic "guest service" abstraction:
GuestServiceKind— discriminated betweenPikachatDaemonandOpenclawGatewayGuestServiceBackendMode— discriminated betweenNativeandAcpGuestServiceLaunch— a tagged union carrying launch config for either service kind, including an optionalGuestOpenclawDaemonBackendandGuestAcpBackendGuestServiceReadinessCheck— a tagged union supportingLogContainsorHttpGetOkreadiness strategies
All of these enums were only ever instantiated with the OpenclawGateway / Native / HttpGetOk variants. This branch deletes them entirely, removing roughly 125 lines of dead abstraction.