mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 21:51:28 +00:00
Revert "refactor(cli): remove bundled cli text providers"
This reverts commit 05d351c430.
This commit is contained in:
@@ -197,6 +197,18 @@ describe("gateway run option collisions", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each([["--cli-backend-logs", "generic flag"]])(
|
||||
"enables CLI backend log filtering via %s (%s)",
|
||||
async (flag) => {
|
||||
delete process.env.OPENCLAW_CLI_BACKEND_LOG_OUTPUT;
|
||||
|
||||
await runGatewayCli(["gateway", "run", flag, "--allow-unconfigured"]);
|
||||
|
||||
expect(setConsoleSubsystemFilter).toHaveBeenCalledWith(["agent/cli-backend"]);
|
||||
expect(process.env.OPENCLAW_CLI_BACKEND_LOG_OUTPUT).toBe("1");
|
||||
},
|
||||
);
|
||||
|
||||
it("starts gateway when token mode has no configured token (startup bootstrap path)", async () => {
|
||||
await runGatewayCli(["gateway", "run", "--allow-unconfigured"]);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import { GatewayLockError } from "../../infra/gateway-lock.js";
|
||||
import { formatPortDiagnostics, inspectPortUsage } from "../../infra/ports.js";
|
||||
import { cleanStaleGatewayProcessesSync } from "../../infra/restart-stale-pids.js";
|
||||
import { detectRespawnSupervisor } from "../../infra/supervisor-markers.js";
|
||||
import { setConsoleTimestampPrefix } from "../../logging/console.js";
|
||||
import { setConsoleSubsystemFilter, setConsoleTimestampPrefix } from "../../logging/console.js";
|
||||
import { createSubsystemLogger } from "../../logging/subsystem.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
@@ -49,6 +49,8 @@ type GatewayRunOpts = {
|
||||
allowUnconfigured?: boolean;
|
||||
force?: boolean;
|
||||
verbose?: boolean;
|
||||
cliBackendLogs?: boolean;
|
||||
claudeCliLogs?: boolean;
|
||||
wsLog?: unknown;
|
||||
compact?: boolean;
|
||||
rawStream?: boolean;
|
||||
@@ -78,6 +80,8 @@ const GATEWAY_RUN_BOOLEAN_KEYS = [
|
||||
"reset",
|
||||
"force",
|
||||
"verbose",
|
||||
"cliBackendLogs",
|
||||
"claudeCliLogs",
|
||||
"compact",
|
||||
"rawStream",
|
||||
] as const;
|
||||
@@ -237,6 +241,10 @@ async function runGatewayCommand(opts: GatewayRunOpts) {
|
||||
}
|
||||
|
||||
setVerbose(Boolean(opts.verbose));
|
||||
if (opts.cliBackendLogs || opts.claudeCliLogs) {
|
||||
setConsoleSubsystemFilter(["agent/cli-backend"]);
|
||||
process.env.OPENCLAW_CLI_BACKEND_LOG_OUTPUT = "1";
|
||||
}
|
||||
const wsLogRaw = (opts.compact ? "compact" : opts.wsLog) as string | undefined;
|
||||
const wsLogStyle: GatewayWsLogStyle =
|
||||
wsLogRaw === "compact" ? "compact" : wsLogRaw === "full" ? "full" : "auto";
|
||||
@@ -591,6 +599,11 @@ export function addGatewayRunCommand(cmd: Command): Command {
|
||||
)
|
||||
.option("--force", "Kill any existing listener on the target port before starting", false)
|
||||
.option("--verbose", "Verbose logging to stdout/stderr", false)
|
||||
.option(
|
||||
"--cli-backend-logs",
|
||||
"Only show CLI backend logs in the console (includes stdout/stderr)",
|
||||
false,
|
||||
)
|
||||
.option("--ws-log <style>", 'WebSocket log style ("auto"|"full"|"compact")', "auto")
|
||||
.option("--compact", 'Alias for "--ws-log compact"', false)
|
||||
.option("--raw-stream", "Log raw model stream events to jsonl", false)
|
||||
|
||||
Reference in New Issue
Block a user