mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-14 16:02:57 +00:00
fix: a CLI push decides agent identity handling by the tracked file's type
An agent retyped into another resource by a push kept neither its value's `on_behalf_of` as the file stated it nor clear of the old agent's identity. The file's type now decides, and only a deployed agent's identity is claimed back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
aca393d19f
commit
0fc7fe757f
@@ -199,14 +199,16 @@ export function agentOnBehalfOf(
|
||||
localResource: ResourceFile,
|
||||
permissionedAsContext: PermissionedAsContext | undefined
|
||||
): string | undefined {
|
||||
if ((deployed?.resource_type ?? localResource.resource_type) !== "ai_agent") {
|
||||
// What the push writes is the tracked file's type: an agent retyped into
|
||||
// another resource keeps its value exactly as the file states it.
|
||||
if (localResource.resource_type !== "ai_agent") {
|
||||
return undefined;
|
||||
}
|
||||
const local = localResource.value;
|
||||
if (local && typeof local === "object") {
|
||||
delete local.on_behalf_of;
|
||||
}
|
||||
const value = deployed?.value;
|
||||
const value = deployed?.resource_type === "ai_agent" ? deployed.value : undefined;
|
||||
const onBehalfOf =
|
||||
value && typeof value === "object" ? value.on_behalf_of : undefined;
|
||||
if (deployed && onBehalfOf !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user