feat: add code agent provider profiles

This commit is contained in:
Codex
2026-05-26 01:47:11 +08:00
parent c0d1dac33d
commit 83cf496fcd
11 changed files with 469 additions and 136 deletions
@@ -1264,6 +1264,57 @@ export async function runDevCloudWorkbenchLayoutSmoke(args = {}) {
safety: layoutSafety()
});
} catch (error) {
if (isBrowserExecutionEnvironmentError(error)) {
const summary = `Workbench layout smoke skipped because the browser could not run: ${error.message}`;
return sanitizeLayoutReport({
$schema: "https://hwlab.pikastech.local/schemas/dev-gate-report.schema.json",
$id: reportModeId("layout"),
reportVersion: "v1",
status: "skip",
issue: "pikasTech/HWLAB#273",
taskId: "dev-cloud-workbench-layout",
commitId: observeSourceIdentity().reportCommitId,
acceptanceLevel: "dev_cloud_workbench_layout",
devOnly: true,
prodDisabled: true,
reportLifecycle: layoutReportLifecycle(useLiveUrl, "blocked"),
task: "DC-DCSN-P0-2026-003",
mode: "layout-browser",
sourceMode: layoutSourceMode,
url,
generatedAt: new Date().toISOString(),
sourceContract: layoutSourceContract(),
validationCommands: layoutValidationCommands(),
localSmoke: layoutLocalSmoke("skip"),
dryRun: layoutDryRun(),
devPreconditions: layoutDevPreconditions(useLiveUrl, "blocked"),
evidenceLevel: useLiveUrl ? "BLOCKED" : "SOURCE",
devLive: false,
summary,
viewports: layoutViewports.map(({ id, width, height }) => ({ id, width, height })),
checks: [
{
id: "layout-browser-runtime",
status: "skip",
summary,
evidence: ["browser launch failed", "use G14 k3s/CI Playwright base image for browser smoke"]
}
],
blockers: [
{
type: "environment_blocker",
scope: "layout-browser-runtime",
status: "open",
summary
}
],
artifacts: {
screenshotDir: artifactRoot,
reportPath: args.reportPath ?? null
},
safety: layoutSafety()
});
}
return sanitizeLayoutReport({
$schema: "https://hwlab.pikastech.local/schemas/dev-gate-report.schema.json",
$id: reportModeId("layout"),
@@ -9206,6 +9257,11 @@ function escapeRegExp(value) {
return String(value).replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
}
function isBrowserExecutionEnvironmentError(error) {
const message = String(error?.message ?? error ?? "");
return /Executable doesn't exist|Please run the following command to download new browsers|does not support chromium|Host system is missing dependencies|browserType\.launch|Failed to launch|No usable sandbox|Missing X server|Target page, context or browser has been closed/iu.test(message);
}
export function printSmokeHelp() {
return {
status: "usage",