fix(qa): accept Telegram no-reply timeout details · openclaw/openclaw@75a0119
steipete
·
2026-05-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -333,6 +333,23 @@ describe("telegram live qa runtime", () => {
|
333 | 333 | ); |
334 | 334 | }); |
335 | 335 | |
| 336 | +it("recognizes Telegram observation timeouts with retry details", () => { |
| 337 | +expect( |
| 338 | +testing.isTelegramObservedMessageTimeoutError( |
| 339 | +new Error( |
| 340 | +"timed out after 8000ms waiting for Telegram message; last polling error: The operation was aborted due to timeout", |
| 341 | +), |
| 342 | +8000, |
| 343 | +), |
| 344 | +).toBe(true); |
| 345 | +expect( |
| 346 | +testing.isTelegramObservedMessageTimeoutError( |
| 347 | +new Error("timed out after 9000ms waiting for Telegram message"), |
| 348 | +8000, |
| 349 | +), |
| 350 | +).toBe(false); |
| 351 | +}); |
| 352 | + |
336 | 353 | it("includes mention gating in the Telegram live scenario catalog", () => { |
337 | 354 | const scenarios = testing.findScenario([ |
338 | 355 | "telegram-help-command", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1283,6 +1283,12 @@ function assertTelegramScenarioReply(params: {
|
1283 | 1283 | } |
1284 | 1284 | } |
1285 | 1285 | |
| 1286 | +function isTelegramObservedMessageTimeoutError(error: unknown, timeoutMs: number) { |
| 1287 | +return formatErrorMessage(error).startsWith( |
| 1288 | +`timed out after ${timeoutMs}ms waiting for Telegram message`, |
| 1289 | +); |
| 1290 | +} |
| 1291 | + |
1286 | 1292 | function resolveTelegramQaScenarioSteps(run: TelegramQaScenarioRun): TelegramQaScenarioStep[] { |
1287 | 1293 | if (run.steps.length === 0) { |
1288 | 1294 | throw new Error("Telegram QA scenario must include at least one step"); |
@@ -1341,11 +1347,7 @@ async function runTelegramQaScenarioStep(params: {
|
1341 | 1347 | sentMessageId: sent.message_id, |
1342 | 1348 | }; |
1343 | 1349 | } catch (error) { |
1344 | | -if ( |
1345 | | -!params.step.expectReply && |
1346 | | -formatErrorMessage(error) === |
1347 | | -`timed out after ${stepTimeoutMs}ms waiting for Telegram message` |
1348 | | -) { |
| 1350 | +if (!params.step.expectReply && isTelegramObservedMessageTimeoutError(error, stepTimeoutMs)) { |
1349 | 1351 | return { |
1350 | 1352 | matched: undefined, |
1351 | 1353 | requestStartedAt: new Date(requestStartedAtMs).toISOString(), |
@@ -2041,6 +2043,7 @@ export const testing = {
|
2041 | 2043 | assertTelegramScenarioReply, |
2042 | 2044 | classifyCanaryReply, |
2043 | 2045 | findScenario, |
| 2046 | + isTelegramObservedMessageTimeoutError, |
2044 | 2047 | listTelegramQaScenarioCatalog, |
2045 | 2048 | matchesTelegramScenarioReply, |
2046 | 2049 | normalizeTelegramObservedMessage, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。