fix(ci): speed up release validation live probes · openclaw/openclaw@1184925
steipete
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1866,6 +1866,8 @@ async function runInstalledAgentTurn(params) {
|
1866 | 1866 | sessionId, |
1867 | 1867 | "--message", |
1868 | 1868 | "Reply with exact ASCII text OK only.", |
| 1869 | +"--thinking", |
| 1870 | +"minimal", |
1869 | 1871 | "--json", |
1870 | 1872 | ], |
1871 | 1873 | cwd: params.cwd, |
@@ -2623,6 +2625,8 @@ async function runAgentTurn(params) {
|
2623 | 2625 | sessionId, |
2624 | 2626 | "--message", |
2625 | 2627 | "Reply with exact ASCII text OK only.", |
| 2628 | +"--thinking", |
| 2629 | +"minimal", |
2626 | 2630 | "--json", |
2627 | 2631 | ], |
2628 | 2632 | logPath: params.logPath, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,20 +8,23 @@ function tomlString(value: string): string {
|
8 | 8 | export function buildCiSafeCodexConfig(params: { |
9 | 9 | projectPath: string; |
10 | 10 | approvalPolicy?: string; |
| 11 | +modelReasoningEffort?: string; |
11 | 12 | sandboxMode?: string; |
12 | 13 | }): string { |
13 | 14 | if (!params.projectPath || typeof params.projectPath !== "string") { |
14 | 15 | throw new Error("projectPath is required."); |
15 | 16 | } |
16 | 17 | const resolvedProjectPath = path.resolve(params.projectPath); |
17 | 18 | const approvalPolicy = params.approvalPolicy ?? "never"; |
| 19 | +const modelReasoningEffort = params.modelReasoningEffort ?? "low"; |
18 | 20 | const sandboxMode = params.sandboxMode ?? "workspace-write"; |
19 | 21 | return [ |
20 | 22 | "# Generated for Codex CI runs.", |
21 | 23 | "# Keep the checked-out repo trusted while avoiding maintainer-local", |
22 | 24 | "# provider/profile overrides that do not exist on CI runners.", |
23 | 25 | `approval_policy = ${tomlString(approvalPolicy)}`, |
24 | 26 | `sandbox_mode = ${tomlString(sandboxMode)}`, |
| 27 | +`model_reasoning_effort = ${tomlString(modelReasoningEffort)}`, |
25 | 28 | "", |
26 | 29 | `[projects.${tomlString(resolvedProjectPath)}]`, |
27 | 30 | 'trust_level = "trusted"', |
@@ -33,6 +36,7 @@ export async function writeCiSafeCodexConfig(params: {
|
33 | 36 | outputPath: string; |
34 | 37 | projectPath: string; |
35 | 38 | approvalPolicy?: string; |
| 39 | +modelReasoningEffort?: string; |
36 | 40 | sandboxMode?: string; |
37 | 41 | }): Promise<string> { |
38 | 42 | if (!params.outputPath || typeof params.outputPath !== "string") { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -988,6 +988,7 @@ async function agentCommandInternal(
|
988 | 988 | runId, |
989 | 989 | stream: evt.stream, |
990 | 990 | data: evt.data ?? {}, |
| 991 | + ...(evt.sessionKey ? { sessionKey: evt.sessionKey } : {}), |
991 | 992 | }); |
992 | 993 | } |
993 | 994 | if ( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -255,7 +255,11 @@ export function runAgentAttempt(params: {
|
255 | 255 | skillsSnapshot: ReturnType<typeof buildWorkspaceSkillSnapshot> | undefined; |
256 | 256 | resolvedVerboseLevel: VerboseLevel | undefined; |
257 | 257 | agentDir: string; |
258 | | -onAgentEvent: (evt: { stream: string; data?: Record<string, unknown> }) => void; |
| 258 | +onAgentEvent: (evt: { |
| 259 | +stream: string; |
| 260 | +data?: Record<string, unknown>; |
| 261 | +sessionKey?: string; |
| 262 | +}) => void; |
259 | 263 | authProfileProvider: string; |
260 | 264 | sessionStore?: Record<string, SessionEntry>; |
261 | 265 | storePath?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -140,7 +140,11 @@ export type RunEmbeddedPiAgentParams = {
|
140 | 140 | onReasoningStream?: (payload: { text?: string; mediaUrls?: string[] }) => void | Promise<void>; |
141 | 141 | onReasoningEnd?: () => void | Promise<void>; |
142 | 142 | onToolResult?: (payload: ReplyPayload) => void | Promise<void>; |
143 | | -onAgentEvent?: (evt: { stream: string; data: Record<string, unknown> }) => void; |
| 143 | +onAgentEvent?: (evt: { |
| 144 | +stream: string; |
| 145 | +data: Record<string, unknown>; |
| 146 | +sessionKey?: string; |
| 147 | +}) => void; |
144 | 148 | lane?: string; |
145 | 149 | enqueue?: CommandQueueEnqueueFn; |
146 | 150 | extraSystemPrompt?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,11 @@ export type SubscribeEmbeddedPiSessionParams = {
|
31 | 31 | blockReplyChunking?: BlockReplyChunking; |
32 | 32 | onPartialReply?: (payload: { text?: string; mediaUrls?: string[] }) => void | Promise<void>; |
33 | 33 | onAssistantMessageStart?: () => void | Promise<void>; |
34 | | -onAgentEvent?: (evt: { stream: string; data: Record<string, unknown> }) => void | Promise<void>; |
| 34 | +onAgentEvent?: (evt: { |
| 35 | +stream: string; |
| 36 | +data: Record<string, unknown>; |
| 37 | +sessionKey?: string; |
| 38 | +}) => void | Promise<void>; |
35 | 39 | /** Best-effort hook invoked immediately before the terminal lifecycle event is emitted. */ |
36 | 40 | onBeforeLifecycleTerminal?: () => void | Promise<void>; |
37 | 41 | enforceFinalTag?: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -203,6 +203,7 @@ type EmbeddedAgentParams = {
|
203 | 203 | onAgentEvent?: (payload: { |
204 | 204 | stream: string; |
205 | 205 | data: Record<string, unknown>; |
| 206 | +sessionKey?: string; |
206 | 207 | }) => Promise<void> | void; |
207 | 208 | }; |
208 | 209 | |
@@ -1147,6 +1148,7 @@ describe("runAgentTurnWithFallback", () => {
|
1147 | 1148 | state.runEmbeddedPiAgentMock.mockImplementationOnce(async (params: EmbeddedAgentParams) => { |
1148 | 1149 | await params.onAgentEvent?.({ |
1149 | 1150 | stream: "codex_app_server.guardian", |
| 1151 | +sessionKey: "agent:main:subagent:codex-child", |
1150 | 1152 | data: { |
1151 | 1153 | phase: "blocked", |
1152 | 1154 | message: "command requires approval", |
@@ -1184,6 +1186,7 @@ describe("runAgentTurnWithFallback", () => {
|
1184 | 1186 | expect(emitAgentEvent).toHaveBeenCalledWith({ |
1185 | 1187 | runId: "run-codex", |
1186 | 1188 | stream: "codex_app_server.guardian", |
| 1189 | +sessionKey: "agent:main:subagent:codex-child", |
1187 | 1190 | data: { |
1188 | 1191 | phase: "blocked", |
1189 | 1192 | message: "command requires approval", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1410,6 +1410,7 @@ export async function runAgentTurnWithFallback(params: {
|
1410 | 1410 | runId, |
1411 | 1411 | stream: evt.stream, |
1412 | 1412 | data: evt.data, |
| 1413 | + ...(evt.sessionKey ? { sessionKey: evt.sessionKey } : {}), |
1413 | 1414 | }); |
1414 | 1415 | } |
1415 | 1416 | // Signal run start only after the embedded agent emits real activity. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -336,6 +336,7 @@ export function createFollowupRunner(params: {
|
336 | 336 | runId, |
337 | 337 | stream: evt.stream, |
338 | 338 | data: evt.data, |
| 339 | + ...(evt.sessionKey ? { sessionKey: evt.sessionKey } : {}), |
339 | 340 | }); |
340 | 341 | } |
341 | 342 | if (evt.stream !== "compaction") { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -525,7 +525,6 @@ async function readSpawnedChildRow(params: {
|
525 | 525 | "sessions.list", |
526 | 526 | { |
527 | 527 | spawnedBy: params.parentSessionKey, |
528 | | -includeLastMessage: true, |
529 | 528 | limit: 20, |
530 | 529 | }, |
531 | 530 | { timeoutMs: 10_000 }, |
@@ -539,6 +538,13 @@ async function readSpawnedChildRow(params: {
|
539 | 538 | .find((entry): entry is Record<string, unknown> => entry?.key === params.childSessionKey); |
540 | 539 | } |
541 | 540 | |
| 541 | +function isActiveCodexSubagentRow(row: Record<string, unknown> | undefined): boolean { |
| 542 | +if (!row) { |
| 543 | +return false; |
| 544 | +} |
| 545 | +return row.hasActiveSubagentRun === true || row.subagentRunState === "active"; |
| 546 | +} |
| 547 | + |
542 | 548 | async function waitForCodexSubagentStarted(params: { |
543 | 549 | childSessionKey: string; |
544 | 550 | client: GatewayClient; |
@@ -555,14 +561,12 @@ async function waitForCodexSubagentStarted(params: {
|
555 | 561 | client: params.client, |
556 | 562 | parentSessionKey: params.parentSessionKey, |
557 | 563 | }); |
558 | | -if ( |
559 | | -lastRow && |
560 | | -params.events.some( |
561 | | -(event) => |
562 | | -event.sessionKey === params.childSessionKey && |
563 | | -event.stream === "codex_app_server.lifecycle", |
564 | | -) |
565 | | -) { |
| 564 | +const hasLifecycleEvent = params.events.some( |
| 565 | +(event) => |
| 566 | +event.sessionKey === params.childSessionKey && |
| 567 | +event.stream === "codex_app_server.lifecycle", |
| 568 | +); |
| 569 | +if (lastRow && (hasLifecycleEvent || isActiveCodexSubagentRow(lastRow))) { |
566 | 570 | return lastRow; |
567 | 571 | } |
568 | 572 | } catch (error) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。