fix(release): stabilize threaded Telegram stream QA · openclaw/openclaw@dd60c6b
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
File tree
extensions/qa-lab/src/providers/mock-openai
| Original file line number | Diff line number | Diff line change |
|---|
@@ -221,6 +221,26 @@ describe("qa mock openai server", () => {
|
221 | 221 | expect(partialBody).toContain('"type":"response.output_text.delta"'); |
222 | 222 | expect(partialBody).toContain("QA_PARTIAL_OK"); |
223 | 223 | |
| 224 | +const telegramStreamResponse = await fetch(`${server.baseUrl}/v1/responses`, { |
| 225 | +method: "POST", |
| 226 | +headers: { |
| 227 | +"content-type": "application/json", |
| 228 | +}, |
| 229 | +body: JSON.stringify({ |
| 230 | +stream: true, |
| 231 | +input: [ |
| 232 | +makeUserInput( |
| 233 | +"Telegram reply-chain marker QA. Reply exactly: QA-TELEGRAM-REPLY-CHAIN-OK", |
| 234 | +), |
| 235 | +makeUserInput("Quiet streaming QA check. Reply exactly: QA-TELEGRAM-STREAM-SINGLE-OK"), |
| 236 | +], |
| 237 | +}), |
| 238 | +}); |
| 239 | +expect(telegramStreamResponse.status).toBe(200); |
| 240 | +const telegramStreamBody = await telegramStreamResponse.text(); |
| 241 | +expect(telegramStreamBody).toContain("QA-TELEGRAM-STREAM-SINGLE-OK"); |
| 242 | +expect(telegramStreamBody).not.toContain("QA-TELEGRAM-REPLY-CHAIN-OK"); |
| 243 | + |
224 | 244 | const telegramLongResponse = await fetch(`${server.baseUrl}/v1/responses`, { |
225 | 245 | method: "POST", |
226 | 246 | headers: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -156,6 +156,7 @@ const QA_GROUP_VISIBLE_REPLY_TOOL_PROMPT_RE = /qa group visible reply tool check
|
156 | 156 | const QA_GROUP_MESSAGE_UNAVAILABLE_FALLBACK_PROMPT_RE = |
157 | 157 | /qa group message unavailable fallback check/i; |
158 | 158 | const QA_TELEGRAM_CURRENT_SESSION_STATUS_PROMPT_RE = /telegram current session_status qa check/i; |
| 159 | +const QA_TELEGRAM_STREAM_SINGLE_MARKER = "QA-TELEGRAM-STREAM-SINGLE-OK"; |
159 | 160 | const QA_TELEGRAM_LONG_FINAL_THREE_CHUNK_PROMPT_RE = /telegram long final three chunk qa check/i; |
160 | 161 | const QA_TELEGRAM_LONG_FINAL_PROMPT_RE = /telegram long final qa check/i; |
161 | 162 | const QA_SUBAGENT_DIRECT_FALLBACK_PROMPT_RE = /subagent direct fallback qa check/i; |
@@ -1526,6 +1527,19 @@ async function buildResponsesPayload(
|
1526 | 1527 | }, |
1527 | 1528 | ]); |
1528 | 1529 | } |
| 1530 | +if ( |
| 1531 | +QA_STREAMING_PROMPT_RE.test(allInputText) && |
| 1532 | +allInputText.includes(QA_TELEGRAM_STREAM_SINGLE_MARKER) |
| 1533 | +) { |
| 1534 | +return buildAssistantEvents([ |
| 1535 | +{ |
| 1536 | +id: "msg_mock_telegram_quiet_stream", |
| 1537 | +phase: "final_answer", |
| 1538 | +streamDeltas: splitMockStreamingText(QA_TELEGRAM_STREAM_SINGLE_MARKER), |
| 1539 | +text: QA_TELEGRAM_STREAM_SINGLE_MARKER, |
| 1540 | +}, |
| 1541 | +]); |
| 1542 | +} |
1529 | 1543 | if (QA_STREAMING_PROMPT_RE.test(allInputText) && exactReplyDirective) { |
1530 | 1544 | return buildAssistantEvents([ |
1531 | 1545 | { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -61,10 +61,11 @@ describe("setupCommand", () => {
|
61 | 61 | |
62 | 62 | const logs = runtime.log.mock.calls.map((call) => String(call[0])).join("\n"); |
63 | 63 | expect(logs).toContain( |
64 | | -"Setup complete: local config, workspace, and session directories are ready.", |
| 64 | +"Setup complete: config, workspace, and session directories are ready.", |
65 | 65 | ); |
| 66 | +expect(logs).toContain("openclaw onboard"); |
66 | 67 | expect(logs).toContain("openclaw configure"); |
67 | | -expect(logs).toContain("openclaw setup --wizard"); |
| 68 | +expect(logs).toContain("openclaw channels add"); |
68 | 69 | }); |
69 | 70 | }); |
70 | 71 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。