fix: stabilize code agent trace and gateway flow
This commit is contained in:
@@ -22,8 +22,8 @@ const expectedBlockedGuardCommand = `${guardCommand} --expect-blocked`;
|
||||
const digestPattern = /^sha256:[a-f0-9]{64}$/u;
|
||||
const commitPattern = /^[a-f0-9]{7,40}$/u;
|
||||
const minCodeAgentFrontendTimeoutMs = 35000;
|
||||
const defaultCodeAgentBackendTimeoutMs = 150000;
|
||||
const minCodeAgentBackendTimeoutMs = 150000;
|
||||
const defaultCodeAgentBackendTimeoutMs = 600000;
|
||||
const minCodeAgentBackendTimeoutMs = 600000;
|
||||
|
||||
export function normalizeCommit(value) {
|
||||
if (typeof value !== "string") return "unknown";
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
|
||||
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const expectedPorts = Object.freeze({ frontend: 16666, api: 16667 });
|
||||
const codeAgentBackendTimeoutMs = "150000";
|
||||
const codeAgentTransportTimeoutMs = "180000";
|
||||
const codeAgentBackendTimeoutMs = "600000";
|
||||
const codeAgentTransportTimeoutMs = "660000";
|
||||
const legacyPublicPorts = new Set([6666, 6667]);
|
||||
const duplicateMappingAllowed = new Set(["hwlab-box-simu", "hwlab-gateway-simu"]);
|
||||
const tomlBareKeyPattern = /^[A-Za-z0-9_-]+$/u;
|
||||
|
||||
@@ -23,7 +23,7 @@ const webRoot = path.join(repoRoot, "web/hwlab-cloud-web");
|
||||
const defaultLiveUrl = "http://74.48.78.17:16666/";
|
||||
const helpOwner = "codex_1779444232735_1";
|
||||
const legacyFailureWindowMs = 4500;
|
||||
const codeAgentLongTimeoutMs = 180000;
|
||||
const codeAgentLongTimeoutMs = 600000;
|
||||
const localAgentFixtureDelayMs = 5200;
|
||||
const codeAgentE2ePrompts = Object.freeze([
|
||||
{
|
||||
@@ -2631,8 +2631,10 @@ function hasCodeAgentLongTimeoutContract(files) {
|
||||
const app = files.app;
|
||||
return (
|
||||
/DEFAULT_API_TIMEOUT_MS\s*=\s*4500/u.test(app) &&
|
||||
/DEFAULT_CODE_AGENT_TIMEOUT_MS\s*=\s*180000/u.test(app) &&
|
||||
/async function sendAgentMessage[\s\S]*?fetchJson\("\/v1\/agent\/chat"[\s\S]*?timeoutMs:\s*CODE_AGENT_TIMEOUT_MS/u.test(app) &&
|
||||
/DEFAULT_CODE_AGENT_TIMEOUT_MS\s*=\s*600000/u.test(app) &&
|
||||
/DEFAULT_CODE_AGENT_SUBMIT_TIMEOUT_MS\s*=\s*60000/u.test(app) &&
|
||||
/async function sendAgentMessage[\s\S]*?fetchJson\("\/v1\/agent\/chat"[\s\S]*?timeoutMs:\s*CODE_AGENT_SUBMIT_TIMEOUT_MS/u.test(app) &&
|
||||
/shortConnection:\s*true/u.test(functionBody(app, "sendAgentMessage")) &&
|
||||
/timeoutMs\s*=\s*API_TIMEOUT_MS/u.test(functionBody(app, "fetchJson")) &&
|
||||
/timeoutName\s*=\s*path/u.test(functionBody(app, "fetchJson")) &&
|
||||
/HWLAB_CLOUD_WEB_CONFIG/u.test(app) &&
|
||||
@@ -2719,8 +2721,8 @@ function hasCodeAgentConversationUxStates({ app, styles }) {
|
||||
!/function\s+messageAttributionPanel\s*\(/u.test(app) &&
|
||||
!/codeAgentAttributionFromMessage/u.test(app) &&
|
||||
/DEFAULT_API_TIMEOUT_MS\s*=\s*4500/u.test(app) &&
|
||||
/DEFAULT_CODE_AGENT_TIMEOUT_MS\s*=\s*180000/u.test(app) &&
|
||||
/timeoutMs:\s*CODE_AGENT_TIMEOUT_MS/u.test(app) &&
|
||||
/DEFAULT_CODE_AGENT_TIMEOUT_MS\s*=\s*600000/u.test(app) &&
|
||||
/timeoutMs:\s*CODE_AGENT_SUBMIT_TIMEOUT_MS/u.test(app) &&
|
||||
/HWLAB_CLOUD_WEB_CONFIG/u.test(app) &&
|
||||
/正在处理这次 Code Agent 请求/u.test(app) &&
|
||||
/旧 4500ms/u.test(app) &&
|
||||
|
||||
Reference in New Issue
Block a user