Skip to content

Commit d99698a

Browse files
committed
fix(exec): keep observer diagnostics internal
1 parent 0af4a62 commit d99698a

3 files changed

Lines changed: 24 additions & 21 deletions

File tree

‎src/agents/bash-tools.exec-approval-followup.test.ts‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import os from "node:os";
1818
import path from "node:path";
1919
import { replaceSessionEntry } from "../config/sessions/session-accessor.js";
2020
import {
21+
onInternalDiagnosticEvent,
2122
onDiagnosticEvent,
2223
resetDiagnosticEventsForTest,
2324
waitForDiagnosticEventsDrained,
@@ -583,7 +584,7 @@ describe("exec approval followup", () => {
583584

584585
it("ends observation after its deadline without competing direct delivery", async () => {
585586
const diagnostics: DiagnosticEventPayload[] = [];
586-
onDiagnosticEvent((event) => {
587+
onInternalDiagnosticEvent((event) => {
587588
diagnostics.push(event);
588589
});
589590
const startedAt = new Date("2026-08-01T00:00:00Z").getTime();
@@ -619,11 +620,17 @@ describe("exec approval followup", () => {
619620
expect(sendMessage).not.toHaveBeenCalled();
620621
expect(diagnostics).toContainEqual(
621622
expect.objectContaining({
622-
type: "exec.approval.followup_observation_ended",
623-
approvalId: "req-observer-deadline",
624-
runId: "exec-approval-followup:req-observer-deadline:nonce:nonce-deadline",
625-
reason: "deadline",
626-
transportErrors: 1,
623+
type: "log.record",
624+
level: "WARN",
625+
message: "Exec approval followup observation ended",
626+
loggerName: "agents/exec-approval-followup",
627+
attributes: {
628+
approvalId: "req-observer-deadline",
629+
runId: "exec-approval-followup:req-observer-deadline:nonce:nonce-deadline",
630+
reason: "deadline",
631+
transportErrors: 1,
632+
deliveryOwner: "accepted_agent_run",
633+
},
627634
}),
628635
);
629636
});

‎src/agents/bash-tools.exec-approval-followup.ts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,17 @@ export async function sendExecApprovalFollowup(
489489
});
490490
if (waitResult.status === "observation_ended") {
491491
emitDiagnosticEvent({
492-
type: "exec.approval.followup_observation_ended",
493-
approvalId: params.approvalId,
494-
runId,
495-
reason: waitResult.reason,
496-
transportErrors: waitResult.transportErrors,
492+
type: "log.record",
493+
level: "WARN",
494+
message: "Exec approval followup observation ended",
495+
loggerName: "agents/exec-approval-followup",
496+
attributes: {
497+
approvalId: params.approvalId,
498+
runId,
499+
reason: waitResult.reason,
500+
transportErrors: waitResult.transportErrors,
501+
deliveryOwner: "accepted_agent_run",
502+
},
497503
});
498504
log.warn(
499505
`Stopped observing accepted exec approval followup ${params.approvalId} after its bounded wait window; run ${runId} remains the sole delivery owner`,

‎src/infra/diagnostic-events.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,6 @@ export type DiagnosticExecApprovalFollowupSuppressedEvent = DiagnosticBaseEvent
554554
phase: "direct_delivery" | "gateway_preflight";
555555
};
556556

557-
export type DiagnosticExecApprovalFollowupObservationEndedEvent = DiagnosticBaseEvent & {
558-
type: "exec.approval.followup_observation_ended";
559-
approvalId: string;
560-
runId: string;
561-
reason: "deadline";
562-
transportErrors: number;
563-
};
564-
565557
type DiagnosticRunBaseEvent = DiagnosticBaseEvent & {
566558
runId: string;
567559
sessionKey?: string;
@@ -821,7 +813,6 @@ export type DiagnosticEventPayload =
821813
| DiagnosticSkillUsedEvent
822814
| DiagnosticExecProcessCompletedEvent
823815
| DiagnosticExecApprovalFollowupSuppressedEvent
824-
| DiagnosticExecApprovalFollowupObservationEndedEvent
825816
| DiagnosticRunStartedEvent
826817
| DiagnosticRunCompletedEvent
827818
| DiagnosticHarnessRunStartedEvent
@@ -946,7 +937,6 @@ const ASYNC_DIAGNOSTIC_EVENT_TYPES = new Set<DiagnosticEventPayload["type"]>([
946937
"skill.used",
947938
"exec.process.completed",
948939
"exec.approval.followup_suppressed",
949-
"exec.approval.followup_observation_ended",
950940
"message.delivery.started",
951941
"message.delivery.completed",
952942
"message.delivery.error",

0 commit comments

Comments
 (0)