Skip to content

Commit c1e91d1

Browse files
committed
test(qa): fail Telegram tools diagnostics promptly
1 parent c5875ed commit c1e91d1

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

‎extensions/qa-lab/src/live-scenario-timeouts.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ function runCompletionPolicyFlow(
330330
}
331331

332332
describe("live subagent scenario timeouts", () => {
333+
it("fails Telegram tools diagnostics without retrying or extending the reply wait", () => {
334+
const scenario = requireFlowScenario(readQaScenarioById("telegram-tools-compact-command"));
335+
const replyWait = scenario.execution.flow?.steps
336+
.flatMap((step) => step.actions)
337+
.find(
338+
(action) => typeof action === "object" && action !== null && "waitForOutbound" in action,
339+
);
340+
341+
expect(scenario.execution.retryCount).toBe(0);
342+
expect(replyWait).toMatchObject({
343+
waitForOutbound: {
344+
timeoutMs: 60_000,
345+
},
346+
});
347+
});
348+
333349
it.each([
334350
{
335351
id: "issue-109025-completion-policy-live",

‎extensions/qa-lab/src/scenario-catalog-channels.test.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,34 @@ describe("qa scenario catalog channel contracts", () => {
198198
expect(config?.requiredChannelDriver).toBe("crabline");
199199
});
200200

201+
it("checks Telegram tools content only after capturing the scenario-owned reply", () => {
202+
const scenario = requireFlowScenario(readQaScenarioById("telegram-tools-compact-command"));
203+
const actions = scenario.execution.flow?.steps.flatMap((step) => step.actions) ?? [];
204+
const replyWaitIndex = actions.findIndex(
205+
(action) => typeof action === "object" && action !== null && "waitForOutbound" in action,
206+
);
207+
const inventoryAssertIndex = actions.findIndex(
208+
(action) => typeof action === "object" && action !== null && "assert" in action,
209+
);
210+
const replyWait = actions[replyWaitIndex];
211+
const inventoryAssert = actions[inventoryAssertIndex];
212+
213+
expect(replyWait).toMatchObject({
214+
waitForOutbound: {
215+
conversation: { id: "telegram-command-room", kind: "channel" },
216+
sinceIndex: { ref: "startIndex" },
217+
},
218+
saveAs: "firstReply",
219+
});
220+
expect(replyWait).not.toHaveProperty("waitForOutbound.textIncludes");
221+
expect(inventoryAssert).toMatchObject({
222+
assert: {
223+
expr: expect.stringContaining("config.expectedAny.every"),
224+
},
225+
});
226+
expect(inventoryAssertIndex).toBeGreaterThan(replyWaitIndex);
227+
});
228+
201229
it("rejects malformed string matcher lists before running a flow", () => {
202230
expect(() =>
203231
validateQaScenarioExecutionConfig({

‎qa/scenarios/channels/telegram-tools-compact-command.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ scenario:
1717
execution:
1818
kind: flow
1919
channel: telegram
20+
retryCount: 0
2021
summary: Request compact tools through Telegram and verify inventory text.
2122
config:
2223
expectedAny: [exec, Use /tools verbose for descriptions.]
@@ -38,8 +39,8 @@ flow:
3839
- waitForOutbound:
3940
conversation: { id: telegram-command-room, kind: channel }
4041
sinceIndex: { ref: startIndex }
41-
textIncludes: exec
4242
timeoutMs: 60000
43+
saveAs: firstReply
4344
- call: sleep
4445
args: [1000]
4546
- set: joinedReply

0 commit comments

Comments
 (0)