Merge pull request #1281 from pikasTech/fix/1278-hwpod-repro-red
fix: add JD01 hwpod freeze sentinel repro
This commit is contained in:
@@ -195,8 +195,8 @@ nodes:
|
|||||||
baseImageRef: config/hwlab-node-control-plane.yaml#targets[1].tekton.toolsImage.output
|
baseImageRef: config/hwlab-node-control-plane.yaml#targets[1].tekton.toolsImage.output
|
||||||
envRecipeRef: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.${NODE}.sentinels.${nodeLower}-web-probe-sentinel.runtime
|
envRecipeRef: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.${NODE}.sentinels.${nodeLower}-web-probe-sentinel.runtime
|
||||||
targetValidation:
|
targetValidation:
|
||||||
scenarioId: workbench-dsflash-go-single-turn-smoke
|
scenarioId: workbench-dsflash-go-hwpod-two-turn-freeze-repro
|
||||||
maxSeconds: 300
|
maxSeconds: 360
|
||||||
serviceUnavailablePolicy: structured-failure
|
serviceUnavailablePolicy: structured-failure
|
||||||
secrets:
|
secrets:
|
||||||
sources:
|
sources:
|
||||||
|
|||||||
@@ -25,6 +25,26 @@ sentinel:
|
|||||||
promptSource: promptSet
|
promptSource: promptSet
|
||||||
repeat: 1
|
repeat: 1
|
||||||
|
|
||||||
|
- id: workbench-dsflash-go-hwpod-two-turn-freeze-repro
|
||||||
|
enabled: true
|
||||||
|
cadence: 10m
|
||||||
|
observeTargetPath: /workbench
|
||||||
|
sampleIntervalMs: 1000
|
||||||
|
screenshotIntervalMs: 60000
|
||||||
|
maxRunSeconds: 360
|
||||||
|
providerProfile: dsflash-go
|
||||||
|
providerProfileMode: exact
|
||||||
|
promptSetRef: config/hwlab-web-probe-sentinel/prompt-set.dsflash-go.yaml#sentinel.promptSet
|
||||||
|
reportViewRef: config/hwlab-web-probe-sentinel/report-views.multi-sentinel.yaml#sentinel.reportViews
|
||||||
|
commandSequence:
|
||||||
|
- type: newSession
|
||||||
|
- type: selectProvider
|
||||||
|
provider: dsflash-go
|
||||||
|
- type: sendPrompt
|
||||||
|
text: hi
|
||||||
|
- type: sendPrompt
|
||||||
|
text: 看看有什么hwpod可用
|
||||||
|
|
||||||
- id: workbench-dsflash-go-tool-call-10x
|
- id: workbench-dsflash-go-tool-call-10x
|
||||||
enabled: true
|
enabled: true
|
||||||
cadence: 10m
|
cadence: 10m
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export function runSentinelQuickVerify(state: SentinelCicdState, reason: string,
|
|||||||
const scenario = findScenario(state, scenarioId);
|
const scenario = findScenario(state, scenarioId);
|
||||||
if (scenario === null) return { ok: false, status: "blocked", reason: "scenario-not-found", scenarioId, valuesRedacted: true };
|
if (scenario === null) return { ok: false, status: "blocked", reason: "scenario-not-found", scenarioId, valuesRedacted: true };
|
||||||
const commandSequence = arrayAt(scenario, "commandSequence").map(record);
|
const commandSequence = arrayAt(scenario, "commandSequence").map(record);
|
||||||
const needsPromptSet = commandSequence.some((item) => stringAt(item, "type") === "sendPrompt");
|
const needsPromptSet = commandSequence.some((item) => stringAt(item, "type") === "sendPrompt" && inlinePromptText(item) === null);
|
||||||
const prompts = needsPromptSet
|
const prompts = needsPromptSet
|
||||||
? readPromptSetForScenario(state, scenario)
|
? readPromptSetForScenario(state, scenario)
|
||||||
: { ok: true as const, prompts: [], summary: { source: "not-required", promptCount: 0, valuesRedacted: true } };
|
: { ok: true as const, prompts: [], summary: { source: "not-required", promptCount: 0, valuesRedacted: true } };
|
||||||
@@ -198,7 +198,7 @@ export function runSentinelQuickVerify(state: SentinelCicdState, reason: string,
|
|||||||
if (toAccountId !== null) args.push("--to-account-id", toAccountId);
|
if (toAccountId !== null) args.push("--to-account-id", toAccountId);
|
||||||
}
|
}
|
||||||
if (type === "sendPrompt") {
|
if (type === "sendPrompt") {
|
||||||
args.push("--text", prompts.prompts[promptIndex % prompts.prompts.length] ?? "");
|
args.push("--text", inlinePromptText(item) ?? prompts.prompts[promptIndex % prompts.prompts.length] ?? "");
|
||||||
args.push("--expected-action-wait-ms", String(numberAtNullable(item, "expectedActionWaitMs") ?? 45000));
|
args.push("--expected-action-wait-ms", String(numberAtNullable(item, "expectedActionWaitMs") ?? 45000));
|
||||||
promptIndex += 1;
|
promptIndex += 1;
|
||||||
}
|
}
|
||||||
@@ -437,6 +437,10 @@ function appendScenarioObserveCommandArgs(args: string[], item: Record<string, u
|
|||||||
if (item.waitProjectManagementReady === true && !args.includes("--wait-project-management-ready")) args.push("--wait-project-management-ready");
|
if (item.waitProjectManagementReady === true && !args.includes("--wait-project-management-ready")) args.push("--wait-project-management-ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inlinePromptText(item: Record<string, unknown>): string | null {
|
||||||
|
return stringAtNullable(item, "text") ?? stringAtNullable(item, "prompt") ?? stringAtNullable(item, "value");
|
||||||
|
}
|
||||||
|
|
||||||
function finalizeQuickVerifyFailure(state: SentinelCicdState, input: {
|
function finalizeQuickVerifyFailure(state: SentinelCicdState, input: {
|
||||||
readonly runId: string;
|
readonly runId: string;
|
||||||
readonly scenarioId: string;
|
readonly scenarioId: string;
|
||||||
|
|||||||
@@ -539,7 +539,11 @@ function buildObserveCommandPlan(config: WebProbeSentinelServiceConfig, scenario
|
|||||||
const type = stringAt(item, "type");
|
const type = stringAt(item, "type");
|
||||||
const argv = ["bun", "scripts/cli.ts", "web-probe", "observe", "command", "<observerId>", "--type", type];
|
const argv = ["bun", "scripts/cli.ts", "web-probe", "observe", "command", "<observerId>", "--type", type];
|
||||||
if (type === "selectProvider") argv.push("--provider", stringAt(item, "provider"));
|
if (type === "selectProvider") argv.push("--provider", stringAt(item, "provider"));
|
||||||
if (type === "sendPrompt") argv.push("--text-stdin");
|
if (type === "sendPrompt") {
|
||||||
|
const inlineText = inlinePromptText(item);
|
||||||
|
if (inlineText === null) argv.push("--text-stdin");
|
||||||
|
else argv.push("--text", "<inline-command-text>");
|
||||||
|
}
|
||||||
if (type === "loginAccount" || type === "listSessions" || type === "logout") {
|
if (type === "loginAccount" || type === "listSessions" || type === "logout") {
|
||||||
const accountId = stringOrNull(item.accountId);
|
const accountId = stringOrNull(item.accountId);
|
||||||
if (accountId !== null) argv.push("--account-id", accountId);
|
if (accountId !== null) argv.push("--account-id", accountId);
|
||||||
@@ -551,7 +555,7 @@ function buildObserveCommandPlan(config: WebProbeSentinelServiceConfig, scenario
|
|||||||
if (toAccountId !== null) argv.push("--to-account-id", toAccountId);
|
if (toAccountId !== null) argv.push("--to-account-id", toAccountId);
|
||||||
}
|
}
|
||||||
appendObserveCommandArgs(argv, item, { skipText: type === "sendPrompt" });
|
appendObserveCommandArgs(argv, item, { skipText: type === "sendPrompt" });
|
||||||
return { phase: `observe-command-${type}`, argv, stdinSource: type === "sendPrompt" ? "prompt-source" : "none" } satisfies CommandPlanStep;
|
return { phase: `observe-command-${type}`, argv, stdinSource: type === "sendPrompt" ? inlinePromptText(item) === null ? "prompt-source" : "inline-text-redacted" : "none" } satisfies CommandPlanStep;
|
||||||
});
|
});
|
||||||
const analyze: CommandPlanStep = {
|
const analyze: CommandPlanStep = {
|
||||||
phase: "observe-analyze",
|
phase: "observe-analyze",
|
||||||
@@ -561,6 +565,10 @@ function buildObserveCommandPlan(config: WebProbeSentinelServiceConfig, scenario
|
|||||||
return [start, ...commands, analyze];
|
return [start, ...commands, analyze];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inlinePromptText(item: Record<string, unknown>): string | null {
|
||||||
|
return stringOrNull(item.text) ?? stringOrNull(item.prompt) ?? stringOrNull(item.value);
|
||||||
|
}
|
||||||
|
|
||||||
function appendObserveCommandArgs(argv: string[], item: Record<string, unknown>, options: { readonly skipText?: boolean } = {}): void {
|
function appendObserveCommandArgs(argv: string[], item: Record<string, unknown>, options: { readonly skipText?: boolean } = {}): void {
|
||||||
const mappings: readonly (readonly [string, string])[] = [
|
const mappings: readonly (readonly [string, string])[] = [
|
||||||
["path", "--path"],
|
["path", "--path"],
|
||||||
|
|||||||
Reference in New Issue
Block a user