mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:54:58 +00:00
refactor(commands): dedupe session target resolution and fs tool test setup
This commit is contained in:
@@ -7,7 +7,7 @@ import { info } from "../globals.js";
|
||||
import { parseAgentSessionKey } from "../routing/session-key.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { isRich, theme } from "../terminal/theme.js";
|
||||
import { resolveSessionStoreTargets } from "./session-store-targets.js";
|
||||
import { resolveSessionStoreTargetsOrExit } from "./session-store-targets.js";
|
||||
import {
|
||||
formatSessionAgeCell,
|
||||
formatSessionFlagsCell,
|
||||
@@ -95,16 +95,16 @@ export async function sessionsCommand(
|
||||
cfg.agents?.defaults?.contextTokens ??
|
||||
lookupContextTokens(displayDefaults.model) ??
|
||||
DEFAULT_CONTEXT_TOKENS;
|
||||
let targets: ReturnType<typeof resolveSessionStoreTargets>;
|
||||
try {
|
||||
targets = resolveSessionStoreTargets(cfg, {
|
||||
const targets = resolveSessionStoreTargetsOrExit({
|
||||
cfg,
|
||||
opts: {
|
||||
store: opts.store,
|
||||
agent: opts.agent,
|
||||
allAgents: opts.allAgents,
|
||||
});
|
||||
} catch (error) {
|
||||
runtime.error(error instanceof Error ? error.message : String(error));
|
||||
runtime.exit(1);
|
||||
},
|
||||
runtime,
|
||||
});
|
||||
if (!targets) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user