Skip to content

Commit 95bbc0a

Browse files
steipeteampagent
andauthored
1 parent a2ad7c7 commit 95bbc0a

7 files changed

Lines changed: 244 additions & 26 deletions

‎extensions/qa-lab/src/reply-failure.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const VISIBLE_REPLY_LEAK_PATTERNS = [
1010

1111
const TOOL_BACKED_FAILURE_PATTERNS = [
1212
/\btool\s+[a-z0-9_.-]+\s+not found\b/i,
13-
/^status:\s*blocked\b/im,
13+
/^status\s*[:=]\s*(?:blocked|failed)\b/im,
1414
];
1515

1616
export function extractQaVisibleReplyLeakText(text: string): string | undefined {

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ describe("qa scenario catalog causality", () => {
8080
readFlowAssertExpression(action).includes("finalMatches.length === 1"),
8181
);
8282
expect(liveMultiRestart.execution.retryCount).toBe(0);
83+
expect(liveMultiRestart.execution.runtime).toBe("openclaw");
84+
expect(liveMultiRestart.runtimePairLane).toBeUndefined();
8385
expect(JSON.stringify(liveMultiRestart.gatewayConfigPatch)).toContain(
8486
'"alsoAllow":["qa_restart_wait","qa_restart_unsafe_probe"]',
8587
);
86-
expect(liveMultiRestartContract).toContain("assistantToolCallCounts.exec");
88+
expect(liveMultiRestartContract).toContain("pendingCodeModeExecNeedle");
89+
expect(liveMultiRestartContract).toContain("summary.hasPendingCodeModeWait");
8790
expect(liveMultiRestartContract).toContain("checkpoint");
8891
expect(liveMultiRestartContract).toContain("restarts=3");
8992
for (const fixturePath of [
@@ -95,16 +98,23 @@ describe("qa scenario catalog causality", () => {
9598
]) {
9699
expect(liveMultiRestartPrompt).toContain(fixturePath);
97100
}
98-
expect(liveMultiRestartPrompt).toContain("your only work in this turn is the next checkpoint");
99101
expect(liveMultiRestartPrompt).toContain(
100-
"Make exactly one `exec` call with `restartSafe: true`",
102+
"On this original user turn, perform only checkpoint 1",
103+
);
104+
expect(liveMultiRestartPrompt).toContain(
105+
"After the third Gateway-recovery system message, perform the audit and final report",
106+
);
107+
expect(liveMultiRestartPrompt).toContain(
108+
"make exactly one `exec` call with `restartSafe: true`",
101109
);
102110
expect(liveMultiRestartPrompt).toContain(
103111
"expired, or aborted `wait` result after restart is expected",
104112
);
105-
expect(liveMultiRestartPrompt).toContain("`CHECKPOINT-N` is internal tool output");
106113
expect(liveMultiRestartPrompt).toContain(
107-
"Do not send any assistant text before the final audit report",
114+
"Do not issue another `exec` until a new Gateway-recovery system message arrives",
115+
);
116+
expect(liveMultiRestartPrompt).toContain(
117+
'.some(candidate => candidate.toolName === "qa_restart_unsafe_probe")',
108118
);
109119
expect(liveMultiRestartPrompt).toContain("Do not read the `restart-audit/` directory path");
110120
expect(liveMultiRestartContract).toContain("sendInbound");
@@ -114,6 +124,9 @@ describe("qa scenario catalog causality", () => {
114124
expect(liveMultiRestartContract).toContain('"saveAs":"inbound"');
115125
expect(liveMultiRestartContract).toContain("probeText: config.finalMarker");
116126
expect(liveMultiRestartContract).toContain(
127+
"pendingCodeModeExecNeedle: `CHECKPOINT-${checkpoint}`",
128+
);
129+
expect(liveMultiRestartContract).not.toContain(
117130
"assistantToolCallCounts.wait ?? 0) > (summary.completedToolCallCounts.wait ?? 0)",
118131
);
119132
expect(checkpointTranscriptIndex).toBeGreaterThanOrEqual(0);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("QA runtime-pair scenario catalog", () => {
2121
.length,
2222
]),
2323
);
24-
expect(laneCounts).toEqual({ core: 36, extended: 8, soak: 2 });
24+
expect(laneCounts).toEqual({ core: 35, extended: 8, soak: 2 });
2525
});
2626

2727
it("declares every release agentic scenario in the core lane", () => {
@@ -41,7 +41,6 @@ describe("QA runtime-pair scenario catalog", () => {
4141
"goal-followthrough-live",
4242
"plugin-hook-health-sentinel",
4343
"codex-legacy-read-tool-vocabulary",
44-
"gateway-restart-multi-live",
4544
"streaming-final-integrity",
4645
"cron-model-created-explicit-authority",
4746
"cron-model-created-one-shot-recurring",
@@ -85,7 +84,7 @@ describe("QA runtime-pair scenario catalog", () => {
8584
expect(longContextFlow).not.toContain("patchConfig");
8685
});
8786

88-
it("selects the pinned gateway restart pair explicitly and implicitly at GPT-5.4", () => {
87+
it("keeps the pinned gateway restart scenario owned by the OpenClaw runtime", () => {
8988
const scenarioId = "gateway-restart-multi-live";
9089
const scenario = readQaScenarioById(scenarioId);
9190
const scenarios = readQaScenarioPack().scenarios;
@@ -94,7 +93,8 @@ describe("QA runtime-pair scenario catalog", () => {
9493
primaryModel: "openai/gpt-5.4",
9594
};
9695

97-
expect(scenario.runtimePairLane).toBe("core");
96+
expect(scenario.runtimePairLane).toBeUndefined();
97+
expect(scenario.execution).toMatchObject({ kind: "flow", runtime: "openclaw" });
9898
expect(readQaScenarioExecutionConfig(scenarioId)).toMatchObject({
9999
requiredProviderMode: "live-frontier",
100100
requiredProvider: "openai",
@@ -119,7 +119,7 @@ describe("QA runtime-pair scenario catalog", () => {
119119

120120
expect(explicitIds).toEqual([scenarioId]);
121121
expect(implicitIds).toContain(scenarioId);
122-
expect(runtimePairLane.scenarioIds).toContain(scenarioId);
122+
expect(runtimePairLane.scenarioIds).not.toContain(scenarioId);
123123
expect(runtimePairLane.excludedLaneScenarios.map((excluded) => excluded.id)).not.toContain(
124124
scenarioId,
125125
);

‎extensions/qa-lab/src/suite-runtime-agent-session.test.ts‎

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,129 @@ describe("qa suite runtime agent session helpers", () => {
575575
});
576576
});
577577

578+
it("matches pending Code Mode waits to the exec checkpoint that created their run", async () => {
579+
const tempRoot = await makeTempDir("qa-session-transcript-code-mode-wait-");
580+
const sessionKey = "agent:qa:code-mode-wait";
581+
const sessionId = "session-code-mode-wait";
582+
await seedQaSession({ tempRoot, sessionKey, sessionId });
583+
584+
for (const message of [
585+
{
586+
role: "assistant",
587+
content: [
588+
{
589+
type: "toolCall",
590+
id: "checkpoint-1-exec",
591+
name: "exec",
592+
arguments: { code: "await qa_restart_wait(); return 'CHECKPOINT-1';" },
593+
},
594+
],
595+
},
596+
{
597+
role: "toolResult",
598+
toolCallId: "checkpoint-1-exec",
599+
toolName: "exec",
600+
details: { status: "waiting", runId: "checkpoint-1-run" },
601+
isError: false,
602+
},
603+
{
604+
role: "assistant",
605+
content: [
606+
{
607+
type: "toolCall",
608+
id: "checkpoint-1-wait",
609+
name: "wait",
610+
arguments: { runId: "checkpoint-1-run" },
611+
},
612+
],
613+
},
614+
{
615+
role: "toolResult",
616+
toolCallId: "checkpoint-1-wait",
617+
toolName: "wait",
618+
details: { status: "completed" },
619+
isError: false,
620+
},
621+
{
622+
role: "assistant",
623+
content: [
624+
{
625+
type: "toolCall",
626+
id: "audit-exec",
627+
name: "exec",
628+
arguments: { code: "return await catalog.search('qa_restart_unsafe_probe');" },
629+
},
630+
],
631+
},
632+
{
633+
role: "toolResult",
634+
toolCallId: "audit-exec",
635+
toolName: "exec",
636+
details: { status: "waiting", runId: "audit-run" },
637+
isError: false,
638+
},
639+
{
640+
role: "assistant",
641+
content: [
642+
{
643+
type: "toolCall",
644+
id: "audit-wait",
645+
name: "wait",
646+
arguments: { runId: "audit-run" },
647+
},
648+
],
649+
},
650+
]) {
651+
await appendQaTranscriptMessage({ tempRoot, sessionKey, sessionId, message });
652+
}
653+
654+
await expect(
655+
readSessionTranscriptSummary({ gateway: { tempRoot } } as never, sessionKey, {
656+
pendingCodeModeExecNeedle: "CHECKPOINT-1",
657+
}),
658+
).resolves.toMatchObject({ hasPendingCodeModeWait: false });
659+
660+
for (const message of [
661+
{
662+
role: "assistant",
663+
content: [
664+
{
665+
type: "toolCall",
666+
id: "checkpoint-2-exec",
667+
name: "exec",
668+
arguments: { code: "await qa_restart_wait(); return 'CHECKPOINT-2';" },
669+
},
670+
],
671+
},
672+
{
673+
role: "toolResult",
674+
toolCallId: "checkpoint-2-exec",
675+
toolName: "exec",
676+
details: { status: "waiting", runId: "checkpoint-2-run" },
677+
isError: false,
678+
},
679+
{
680+
role: "assistant",
681+
content: [
682+
{
683+
type: "toolCall",
684+
id: "checkpoint-2-wait",
685+
name: "wait",
686+
arguments: { runId: "checkpoint-2-run" },
687+
},
688+
],
689+
},
690+
]) {
691+
await appendQaTranscriptMessage({ tempRoot, sessionKey, sessionId, message });
692+
}
693+
694+
await expect(
695+
readSessionTranscriptSummary({ gateway: { tempRoot } } as never, sessionKey, {
696+
pendingCodeModeExecNeedle: "CHECKPOINT-2",
697+
}),
698+
).resolves.toMatchObject({ hasPendingCodeModeWait: true });
699+
});
700+
578701
it("only exposes authenticated successful tool results with finite owner timestamps", async () => {
579702
const tempRoot = await makeTempDir("qa-session-transcript-tool-event-timestamps-");
580703
const sessionKey = "agent:qa:tool-event-timestamps";

0 commit comments

Comments
 (0)