Revert EMULATOR_MODE to rcon default, restore RCON config
CI / check (push) Successful in 28s
CI / release (push) Skipped
CI / deploy (push) Successful in 54s

This commit is contained in:
openhands committed 2026-08-22 22:32:24 +02:00
1 parent f24426c1fa
commit adb56eb80b
4 files changed
+30 -15

No files matched your search

+3 -1
View File
@@ -223,8 +223,10 @@ export function emulatorOffline(detail?: string): Promise<SendAlertResult> {
severity: "critical",
message: detail
? `Emulator appears offline: ${detail}`
: "Emulator appears offline — emulator API connection could not be established.",
: "Emulator appears offline — RCON connection could not be established.",
context: {
rconHost: env.RCON_HOST,
rconPort: env.RCON_PORT,
...(detail ? { detail } : {}),
},
});
+13 -9
View File
@@ -225,20 +225,24 @@ export function httpTransport(opts: {
* misconfiguration surfaces immediately instead of on first command.
*/
export function createEmulatorTransport(): RconTransport {
const mode = env.EMULATOR_MODE ?? "api";
if (mode === "api") {
if (env.EMULATOR_MODE === "api") {
if (!env.EMULATOR_API_URL) {
throw new Error("EMULATOR_MODE=api requires EMULATOR_API_URL to be set");
}
return httpTransport({
url: env.EMULATOR_API_URL ?? "http://127.0.0.1:3001",
timeoutMs: 10_000,
url: env.EMULATOR_API_URL,
timeoutMs: env.RCON_TIMEOUT_MS,
apiKey: env.EMULATOR_API_KEY,
apiKeyHeader: env.EMULATOR_API_KEY_HEADER,
maxRetries: 3,
maxRetries: env.RCON_MAX_RETRIES,
});
}
// API mode only; RCON transport removed.
throw new Error(
"EMULATOR_MODE=rcon is no longer supported; use EMULATOR_MODE=api",
);
return tcpTransport({
host: env.RCON_HOST,
port: env.RCON_PORT,
timeoutMs: env.RCON_TIMEOUT_MS,
maxRetries: env.RCON_MAX_RETRIES,
});
}
const globalForRcon = globalThis as unknown as { rcon?: RconClient };