惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
T
The Blog of Author Tim Ferriss
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
量子位
I
InfoQ
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog
J
Java Code Geeks
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
V
V2EX
腾讯CDC
P
Proofpoint News Feed
A
About on SuperTechFans
爱范儿
爱范儿
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(webchat): route trajectory slash export before agent ...
vincentkoc · 2026-06-14 · via Recent Commits to openclaw:main

@@ -89,4 +89,107 @@ describe("maybeResolveNativeSlashCommandFastReply", () => {

8989

expect(getReplyPayloadMetadata(result.reply)?.deliverDespiteSourceReplySuppression).toBe(true);

9090

expect(typing.cleanup).toHaveBeenCalledTimes(1);

9191

});

92+93+

it("handles authorized text slash commands before model dispatch", async () => {

94+

handleCommandsMock.mockResolvedValueOnce({

95+

shouldContinue: false,

96+

reply: { text: "Trajectory exports can include prompts." },

97+

});

98+99+

const typing = createTypingController();

100+

const ctx = buildTestCtx({

101+

Body: "/export-trajectory bundle",

102+

BodyForCommands: "/export-trajectory bundle",

103+

CommandBody: "/export-trajectory bundle",

104+

CommandSource: "text",

105+

CommandAuthorized: true,

106+

SessionKey: "agent:dev:webchat",

107+

Provider: "webchat",

108+

Surface: "webchat",

109+

OriginatingChannel: "webchat",

110+

ChatType: "direct",

111+

CommandTurn: {

112+

kind: "text-slash",

113+

source: "text",

114+

authorized: true,

115+

commandName: "export-trajectory",

116+

body: "/export-trajectory bundle",

117+

},

118+

});

119+120+

const result = await maybeResolveNativeSlashCommandFastReply({

121+

ctx,

122+

cfg: markCompleteReplyConfig({

123+

session: { store: "/tmp/openclaw-text-slash-sessions.json" },

124+

} as OpenClawConfig),

125+

agentId: "dev",

126+

agentDir: "/tmp/agent",

127+

agentCfg: undefined,

128+

commandAuthorized: true,

129+

defaultProvider: "openai",

130+

defaultModel: "gpt-5.5",

131+

aliasIndex: { byKey: new Map(), byAlias: new Map() },

132+

provider: "openai",

133+

model: "gpt-5.5",

134+

workspaceDir: "/tmp/workspace",

135+

typing,

136+

});

137+138+

expect(handleCommandsMock).toHaveBeenCalledTimes(1);

139+

expect(result).toEqual({

140+

handled: true,

141+

reply: expect.objectContaining({

142+

text: "Trajectory exports can include prompts.",

143+

}),

144+

});

145+

if (!result.handled || !result.reply || Array.isArray(result.reply)) {

146+

throw new Error("expected single handled reply");

147+

}

148+

expect(getReplyPayloadMetadata(result.reply)?.deliverDespiteSourceReplySuppression).toBe(true);

149+

expect(typing.cleanup).toHaveBeenCalledTimes(1);

150+

});

151+152+

it("leaves external text slash commands on the canonical session path", async () => {

153+

const typing = createTypingController();

154+

const ctx = buildTestCtx({

155+

Body: "/export-trajectory bundle",

156+

BodyForCommands: "/export-trajectory bundle",

157+

CommandBody: "/export-trajectory bundle",

158+

CommandSource: "text",

159+

CommandAuthorized: true,

160+

SessionKey: "agent:dev:telegram:group:123",

161+

Provider: "telegram",

162+

Surface: "telegram",

163+

ChatType: "group",

164+

CommandTurn: {

165+

kind: "text-slash",

166+

source: "text",

167+

authorized: true,

168+

commandName: "export-trajectory",

169+

body: "/export-trajectory bundle",

170+

},

171+

});

172+173+

const result = await maybeResolveNativeSlashCommandFastReply({

174+

ctx,

175+

cfg: markCompleteReplyConfig({

176+

session: { store: "/tmp/openclaw-external-text-slash-sessions.json" },

177+

} as OpenClawConfig),

178+

agentId: "dev",

179+

agentDir: "/tmp/agent",

180+

agentCfg: undefined,

181+

commandAuthorized: true,

182+

defaultProvider: "openai",

183+

defaultModel: "gpt-5.5",

184+

aliasIndex: { byKey: new Map(), byAlias: new Map() },

185+

provider: "openai",

186+

model: "gpt-5.5",

187+

workspaceDir: "/tmp/workspace",

188+

typing,

189+

});

190+191+

expect(result).toEqual({ handled: false });

192+

expect(handleCommandsMock).not.toHaveBeenCalled();

193+

expect(typing.cleanup).not.toHaveBeenCalled();

194+

});

92195

});