refactor(sessions): drop unused thread parent helper · openclaw/openclaw@f1c0d5f
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,6 @@ import {
|
5 | 5 | getSubagentDepth, |
6 | 6 | isCronSessionKey, |
7 | 7 | parseThreadSessionSuffix, |
8 | | -resolveThreadParentSessionKey, |
9 | 8 | } from "../sessions/session-key-utils.js"; |
10 | 9 | import { |
11 | 10 | agentSessionKeysMatchByRequestKey, |
@@ -164,19 +163,13 @@ describe("thread session suffix parsing", () => {
|
164 | 163 | "agent:main:feishu:group:oc_group_chat:topic:om_topic_root:sender:ou_topic_user", |
165 | 164 | threadId: undefined, |
166 | 165 | }); |
167 | | -expect( |
168 | | -resolveThreadParentSessionKey( |
169 | | -"agent:main:feishu:group:oc_group_chat:topic:om_topic_root:sender:ou_topic_user", |
170 | | -), |
171 | | -).toBeNull(); |
172 | 166 | }); |
173 | 167 | |
174 | 168 | it("does not treat telegram :topic: as a generic thread suffix", () => { |
175 | 169 | expect(parseThreadSessionSuffix("agent:main:telegram:group:-100123:topic:77")).toEqual({ |
176 | 170 | baseSessionKey: "agent:main:telegram:group:-100123:topic:77", |
177 | 171 | threadId: undefined, |
178 | 172 | }); |
179 | | -expect(resolveThreadParentSessionKey("agent:main:telegram:group:-100123:topic:77")).toBeNull(); |
180 | 173 | }); |
181 | 174 | |
182 | 175 | it("parses mixed-case :thread: markers without lowercasing the stored key", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -351,17 +351,3 @@ export function parseRawSessionConversationRef(
|
351 | 351 | |
352 | 352 | return { channel, kind, rawId, prefix }; |
353 | 353 | } |
354 | | - |
355 | | -export function resolveThreadParentSessionKey( |
356 | | -sessionKey: string | undefined | null, |
357 | | -): string | null { |
358 | | -const { baseSessionKey, threadId } = parseThreadSessionSuffix(sessionKey); |
359 | | -if (!threadId) { |
360 | | -return null; |
361 | | -} |
362 | | -const parent = normalizeOptionalString(baseSessionKey); |
363 | | -if (!parent) { |
364 | | -return null; |
365 | | -} |
366 | | -return parent; |
367 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。