

























@@ -105,8 +105,8 @@ export function createSessionsListTool(opts?: {
105105const label = readStringParam(params, "label");
106106const agentId = readStringParam(params, "agentId");
107107const search = readStringParam(params, "search");
108-const includeDerivedTitles = params.includeDerivedTitles === true;
109-const includeLastMessage = params.includeLastMessage === true;
108+const includeDerivedTitles = params.includeDerivedTitles === true ? true : undefined;
109+const includeLastMessage = params.includeLastMessage === true ? true : undefined;
110110const gatewayCall = opts?.callGateway ?? callGateway;
111111112112const list = await gatewayCall<{ sessions: Array<SessionListRow>; path: string }>({
@@ -201,21 +201,23 @@ export function createSessionsListTool(opts?: {
201201const sessionId = readStringValue(entry.sessionId);
202202const sessionFileRaw = (entry as { sessionFile?: unknown }).sessionFile;
203203const sessionFile = readStringValue(sessionFileRaw);
204+const resolvedAgentId = resolveAgentIdFromSessionKey(key);
204205let transcriptPath: string | undefined;
205206if (sessionId) {
206207try {
207-const agentId = resolveAgentIdFromSessionKey(key);
208208const trimmedStorePath = storePath?.trim();
209209let effectiveStorePath: string | undefined;
210210if (trimmedStorePath && trimmedStorePath !== "(multiple)") {
211211if (trimmedStorePath.includes("{agentId}") || trimmedStorePath.startsWith("~")) {
212-effectiveStorePath = resolveStorePath(trimmedStorePath, { agentId });
212+effectiveStorePath = resolveStorePath(trimmedStorePath, {
213+agentId: resolvedAgentId,
214+});
213215} else if (path.isAbsolute(trimmedStorePath)) {
214216effectiveStorePath = trimmedStorePath;
215217}
216218}
217219const filePathOpts = resolveSessionFilePathOptions({
218- agentId,
220+agentId: resolvedAgentId,
219221storePath: effectiveStorePath,
220222});
221223transcriptPath = resolveSessionFilePath(
@@ -230,7 +232,7 @@ export function createSessionsListTool(opts?: {
230232231233const row: SessionListRow = {
232234key: displayKey,
233-agentId: resolveAgentIdFromSessionKey(key),
235+agentId: resolvedAgentId,
234236 kind,
235237channel: derivedChannel,
236238origin:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。