mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-27 00:02:35 +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
@@ -46,10 +46,12 @@ test("anyone else claims nothing", () => {
|
||||
expect(local.value.on_behalf_of).toBeUndefined();
|
||||
});
|
||||
|
||||
test("other resources are left alone", () => {
|
||||
const deployed = { resource_type: "json", value: { on_behalf_of: "u/bob" } } as any;
|
||||
const local = { resource_type: "json", value: { on_behalf_of: "u/x" } } as any;
|
||||
expect(agentOnBehalfOf(deployed, local, ctx(true))).toBeUndefined();
|
||||
expect(local.value.on_behalf_of).toBe("u/x");
|
||||
expect(deployed.value.on_behalf_of).toBe("u/bob");
|
||||
test("other resources are left alone, an agent retyped into one included", () => {
|
||||
for (const deployedType of ["json", "ai_agent"]) {
|
||||
const deployed = { resource_type: deployedType, value: { on_behalf_of: "u/bob" } } as any;
|
||||
const local = { resource_type: "json", value: { on_behalf_of: "u/x" } } as any;
|
||||
expect(agentOnBehalfOf(deployed, local, ctx(true))).toBeUndefined();
|
||||
expect(local.value.on_behalf_of).toBe("u/x");
|
||||
expect(deployed.value.on_behalf_of).toBe("u/bob");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user