Skip to content

Commit 67f8683

Browse files
committed
fix: reduce strict-agentic activation logging
1 parent 2fa86c6 commit 67f8683

3 files changed

Lines changed: 16 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai
4848
- Telegram: deliver generated media completions back into forum topics by preserving topic IDs across requester-agent handoff. (#83556) Thanks @fuller-stack-dev.
4949
- Gateway: defer update-check startup until after readiness so package update checks no longer block sidecar-ready startup, while preserving update broadcasts and shutdown cleanup. (#83520) Thanks @samzong.
5050
- Telegram: keep `/btw` and read-only status commands from aborting active runs, and avoid retaining raw update payloads in timed-out spool tombstones. Refs #83272.
51+
- Agents: log strict-agentic execution contract diagnostics only when the planning-only retry path actually triggers.
5152
- Agents/video: hide `video_generate` reference-audio parameters unless a registered video provider supports audio inputs.
5253
- Plugins: fall back to npm for official ClawHub updates when artifact downloads are unavailable, including beta-to-default fallback and dry-run version reporting.
5354
- Plugins/xAI: echo PKCE challenge fields during OAuth authorization-code token exchange for xAI token-endpoint compatibility. (#83499) Thanks @fuller-stack-dev.

src/agents/pi-embedded-runner/run.incomplete-turn.test.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {
5353
return mockedLog.warn.mock.calls.map(([message]) => String(message));
5454
}
5555

56-
function infoMessages(): string[] {
57-
return mockedLog.info.mock.calls.map(([message]) => String(message));
58-
}
59-
6056
function expectWarnMessageWith(text: string): void {
6157
expect(warnMessages().join("\n")).toContain(text);
6258
}
@@ -353,11 +349,14 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {
353349
},
354350
]);
355351
expect(result.meta.livenessState).toBe("blocked");
356-
expect(infoMessages().join("\n")).toContain(
357-
"strict-agentic execution contract active: runId=run-strict-agentic-auto-activated",
352+
expect(warnMessages().join("\n")).toContain(
353+
"strict-agentic execution contract triggered: runId=run-strict-agentic-auto-activated",
354+
);
355+
expect(warnMessages().join("\n")).toContain(
356+
"provider=openai-codex/gpt-5.4 harness=codex contract=strict-agentic configured=unspecified",
358357
);
359-
expect(infoMessages().join("\n")).toContain(
360-
"provider=openai-codex/gpt-5.4 harness=codex configured=unspecified",
358+
expect(mockedLog.info.mock.calls.map(([message]) => String(message)).join("\n")).not.toContain(
359+
"strict-agentic execution contract active",
361360
);
362361
});
363362

src/agents/pi-embedded-runner/run.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -998,14 +998,7 @@ export async function runEmbeddedPiAgent(
998998
modelId,
999999
});
10001000
const executionContract = strictAgenticActive ? "strict-agentic" : "default";
1001-
const configuredExecutionContractForLog = configuredExecutionContract ?? "default";
1002-
if (strictAgenticActive) {
1003-
log.info(
1004-
`strict-agentic execution contract active: runId=${params.runId} sessionId=${params.sessionId} ` +
1005-
`provider=${sanitizeForLog(provider)}/${sanitizeForLog(modelId)} harness=${sanitizeForLog(agentHarness.id)} ` +
1006-
`configured=${configuredExecutionContract ?? "unspecified"}`,
1007-
);
1008-
}
1001+
const configuredExecutionContractForLog = configuredExecutionContract ?? "unspecified";
10091002
const maxPlanningOnlyRetryAttempts = resolvePlanningOnlyRetryLimit(executionContract);
10101003
const maxReasoningOnlyRetryAttempts = DEFAULT_REASONING_ONLY_RETRY_LIMIT;
10111004
const maxEmptyResponseRetryAttempts = DEFAULT_EMPTY_RESPONSE_RETRY_LIMIT;
@@ -2804,9 +2797,14 @@ export async function runEmbeddedPiAgent(
28042797
}
28052798
planningOnlyRetryAttempts += 1;
28062799
planningOnlyRetryInstruction = nextPlanningOnlyRetryInstruction;
2800+
const planningOnlyRetryLogPrefix =
2801+
executionContract === "strict-agentic"
2802+
? "strict-agentic execution contract triggered"
2803+
: "planning-only turn detected";
28072804
log.warn(
2808-
`planning-only turn detected: runId=${params.runId} sessionId=${params.sessionId} ` +
2809-
`provider=${provider}/${modelId} contract=${executionContract} configured=${configuredExecutionContractForLog} — retrying ` +
2805+
`${planningOnlyRetryLogPrefix}: runId=${params.runId} sessionId=${params.sessionId} ` +
2806+
`provider=${provider}/${modelId} harness=${sanitizeForLog(agentHarness.id)} ` +
2807+
`contract=${executionContract} configured=${configuredExecutionContractForLog} — retrying ` +
28102808
`${planningOnlyRetryAttempts}/${maxPlanningOnlyRetryAttempts} with act-now steer`,
28112809
);
28122810
continue;

0 commit comments

Comments
 (0)