Skip to content

Commit 3480212

Browse files
fix lint in direct agent session routing
1 parent 91afdbb commit 3480212

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/agents/agent-command.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,16 +813,17 @@ async function prepareAgentCommandExecution(opts: AgentCommandOpts, runtime: Run
813813
}
814814

815815
async function agentCommandInternal(
816-
opts: AgentCommandOpts,
816+
initialOpts: AgentCommandOpts,
817817
runtime: RuntimeEnv = defaultRuntime,
818818
deps?: CliDeps,
819819
) {
820820
const resolvedDeps = await resolveAgentCommandDeps(deps);
821-
const isRawModelRun = opts.modelRun === true || opts.promptMode === "none";
822-
const suppressVisibleSessionEffects = opts.sessionEffects === "internal";
823-
const preserveUserFacingSessionModelState = opts.preserveUserFacingSessionModelState === true;
824-
const prepared = await prepareAgentCommandExecution(opts, runtime);
825-
opts = prepared.opts;
821+
const isRawModelRun = initialOpts.modelRun === true || initialOpts.promptMode === "none";
822+
const suppressVisibleSessionEffects = initialOpts.sessionEffects === "internal";
823+
const preserveUserFacingSessionModelState =
824+
initialOpts.preserveUserFacingSessionModelState === true;
825+
const prepared = await prepareAgentCommandExecution(initialOpts, runtime);
826+
const opts = prepared.opts;
826827
const {
827828
body,
828829
transcriptBody,

src/commands/agent.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ describe("agentCommand", () => {
12861286
await withTempHome(async (home) => {
12871287
const store = path.join(home, "sessions.json");
12881288
const sessionKey = "agent:main:openclaw-weixin:direct:[email protected]";
1289-
await writeSessionStoreSeed(store, {
1289+
writeSessionStoreSeed(store, {
12901290
[sessionKey]: { sessionId: "wechat-session", updatedAt: Date.now() },
12911291
});
12921292
mockConfig(home, store, undefined, undefined, [{ id: "main" }, { id: "work" }]);
@@ -1302,7 +1302,7 @@ describe("agentCommand", () => {
13021302
await withTempHome(async (home) => {
13031303
const store = path.join(home, "sessions.json");
13041304
const sessionKey = "agent:main:openclaw-weixin:direct:[email protected]";
1305-
await writeSessionStoreSeed(store, {
1305+
writeSessionStoreSeed(store, {
13061306
[sessionKey]: {
13071307
sessionId: "wechat-session",
13081308
updatedAt: Date.now(),

0 commit comments

Comments
 (0)