Revert "refactor(agents): centralize exact execution attribution"

This reverts commit e628b42a49.
This commit is contained in:
joshavant
2026-08-07 13:53:44 -05:00
committed by Josh Avant
parent c6a03a5853
commit 2d80e78886
22 changed files with 80 additions and 665 deletions
+9 -6
View File
@@ -5,6 +5,7 @@ import type { FastMode } from "@openclaw/normalization-core/string-coerce";
import type { AgentInternalEvent } from "../../agents/internal-events.js";
import type { SpawnedRunMetadata } from "../../agents/spawned-context.js";
import type { PromptMode } from "../../agents/system-prompt.types.js";
import type { ExecutionIdentityAdmissionToken } from "../../audit/execution-identity-admission.js";
import type { SourceReplyDeliveryMode } from "../../auto-reply/get-reply-options.types.js";
import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.public.js";
import type { MediaFact } from "../../media/media-facts.js";
@@ -16,7 +17,6 @@ import type {
UserTurnInput,
UserTurnTranscriptRecorder,
} from "../../sessions/user-turn-transcript.types.js";
import type { AgentExecutionAttribution } from "../agent-execution-attribution.js";
import type { ExecApprovalContinuationPromptRange } from "../bash-tools.exec-approval-output.js";
import type { ExecElevatedDefaults } from "../bash-tools.exec-types.js";
import type { BootstrapContextRunKind } from "../bootstrap-mode.js";
@@ -193,8 +193,11 @@ export type AgentCommandOpts = {
mainRestartRecoveryOwnerLease?: MainSessionRecoveryOwnerLease;
/** Gateway already consumed this automatic recovery run's durable reservation. */
mainRestartRecoveryAdmitted?: boolean;
/** Private host-owned execution identity; public ingress callers cannot author it. */
executionAttribution?: AgentExecutionAttribution;
/** Private recovery correlation; public ingress callers cannot author identity evidence. */
executionIdentityAdmission?: {
token: ExecutionIdentityAdmissionToken;
retryOnly: boolean;
};
/** Called when the actual run model is selected, including fallback retries. */
onActiveModelSelected?: (ctx: { provider: string; model: string }) => void | Promise<void>;
/** Called when every candidate in the run's model fallback chain failed. */
@@ -218,7 +221,7 @@ export type AgentCommandOpts = {
/** Restricted option surface for external ingress callsites. */
export type AgentCommandIngressOpts = Omit<
AgentCommandOpts,
"senderIsOwner" | "allowModelOverride" | "executionAttribution"
"senderIsOwner" | "allowModelOverride" | "executionIdentityAdmission"
> & {
/** Trusted sender identity bit for command/channel-action auth; defaults false for ingress. */
senderIsOwner?: boolean;
@@ -226,6 +229,6 @@ export type AgentCommandIngressOpts = Omit<
allowModelOverride: boolean;
};
/** Gateway-only ingress extends the public Plugin SDK surface with private execution correlation. */
/** Gateway-only ingress extends the public Plugin SDK surface with private recovery correlation. */
export type AgentCommandGatewayIngressOpts = AgentCommandIngressOpts &
Pick<AgentCommandOpts, "executionAttribution">;
Pick<AgentCommandOpts, "executionIdentityAdmission">;