fix(gateway): narrow reply session end reason · openclaw/openclaw@4f7606f
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -78,6 +78,11 @@ function loadSessionArchiveRuntime() {
|
78 | 78 | return sessionArchiveRuntimeLoader.load(); |
79 | 79 | } |
80 | 80 | |
| 81 | +type ReplySessionEndReason = Extract< |
| 82 | +PluginHookSessionEndReason, |
| 83 | +"new" | "reset" | "idle" | "daily" | "unknown" |
| 84 | +>; |
| 85 | + |
81 | 86 | function stripThreadIdFromDeliveryContext( |
82 | 87 | context: SessionEntry["deliveryContext"], |
83 | 88 | ): SessionEntry["deliveryContext"] { |
@@ -96,9 +101,7 @@ function stripThreadIdFromOrigin(origin: SessionEntry["origin"]): SessionEntry["
|
96 | 101 | return Object.keys(rest).length > 0 ? rest : undefined; |
97 | 102 | } |
98 | 103 | |
99 | | -function resolveExplicitSessionEndReason( |
100 | | -matchedResetTriggerLower?: string, |
101 | | -): PluginHookSessionEndReason { |
| 104 | +function resolveExplicitSessionEndReason(matchedResetTriggerLower?: string): ReplySessionEndReason { |
102 | 105 | return matchedResetTriggerLower === "/reset" ? "reset" : "new"; |
103 | 106 | } |
104 | 107 | |
@@ -129,7 +132,7 @@ function resolveStaleSessionEndReason(params: {
|
129 | 132 | entry: SessionEntry | undefined; |
130 | 133 | freshness?: SessionFreshness; |
131 | 134 | now: number; |
132 | | -}): PluginHookSessionEndReason | undefined { |
| 135 | +}): ReplySessionEndReason | undefined { |
133 | 136 | if (!params.entry || !params.freshness) { |
134 | 137 | return undefined; |
135 | 138 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。