mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-17 16:03:06 +00:00
fix: keep step tests and multi-agent chats from inventing an effort override
This commit is contained in:
Generated
+1
-1
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@
|
||||
type LinkedAgentDraft
|
||||
} from './flows/linkedAgentDrafts'
|
||||
import { AGENT_LINKED_STEP_KEYS } from './flows/agentResourceUtils'
|
||||
import { agentTestInputTransforms } from './flows/agentFormFields'
|
||||
import { AGENT_OVERRIDE_KEYS, agentTestInputTransforms } from './flows/agentFormFields'
|
||||
import { sendUserToast } from '$lib/toast'
|
||||
import { quickjsReady } from '$lib/utils/quickjsEval.svelte'
|
||||
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
|
||||
@@ -186,7 +186,13 @@
|
||||
const inputTransforms = agentTestInputTransforms(
|
||||
agentVal.agent ? {} : ((agentVal.input_transforms ?? {}) as Record<string, InputTransform>),
|
||||
args,
|
||||
draft ? AGENT_LINKED_STEP_KEYS : Object.keys(args)
|
||||
// An override the step does not hold is left out: fed from the form it would arrive as an
|
||||
// authored empty value, which clears the agent's saved effort.
|
||||
(draft ? AGENT_LINKED_STEP_KEYS : Object.keys(args)).filter(
|
||||
(key) =>
|
||||
!(AGENT_OVERRIDE_KEYS as readonly string[]).includes(key) ||
|
||||
val.input_transforms?.[key] != undefined
|
||||
)
|
||||
)
|
||||
|
||||
await jobLoader?.runFlowPreview(
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -551,6 +551,12 @@ describe('a step linked to a saved agent', () => {
|
||||
).toBeUndefined()
|
||||
})
|
||||
|
||||
it('does not show the saved effort for steps that fix different ones', () => {
|
||||
const effort = (value: string) => linked({ reasoning_effort: { type: 'static', value } })
|
||||
const wiring = resolveAgentModelWiring([effort('low'), effort('medium')], saved)!
|
||||
expect(wiredFieldValue(wiring, {}, 'reasoning_effort')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('cannot be read until the agent has loaded, or with an expression it cannot place', () => {
|
||||
expect(resolveAgentModelWiring([wired], {})).toBeUndefined()
|
||||
expect(
|
||||
|
||||
@@ -312,26 +312,28 @@ export function resolveAgentModelWiring(
|
||||
|
||||
const fields: AgentModelWiring['fields'] = {}
|
||||
const fixed: AgentModelWiring['fixed'] = {}
|
||||
const disagreed = new Set<ProviderField>()
|
||||
for (const field of PROVIDER_FIELDS) {
|
||||
// Every agent has to supply the field the same way for the composer to speak for
|
||||
// them all. One wired name among agents that otherwise fix it is not agreement:
|
||||
// the control would move that one agent and leave the others where they are.
|
||||
const supplies = new Set(wirings.map((w) => JSON.stringify(fieldSupply(w, field))))
|
||||
|
||||
// Disagreement leaves the field neither editable nor known: a control offered here
|
||||
// would govern one agent while the rest ran on something else.
|
||||
if (supplies.size > 1) continue
|
||||
if (supplies.size > 1) {
|
||||
disagreed.add(field)
|
||||
continue
|
||||
}
|
||||
const supply: FieldSupply = JSON.parse([...supplies][0])
|
||||
if (supply.kind === 'wired') fields[field] = supply.name
|
||||
else if (supply.kind === 'fixed') fixed[field] = supply.value
|
||||
}
|
||||
// An empty input means one thing only where every agent falls back to the same saved pair.
|
||||
// An empty input means one thing only where every agent falls back to the same saved pair,
|
||||
// and a saved value must not stand in for a field the agents disagree about.
|
||||
const saved = new Set(wirings.map((w) => JSON.stringify(w.saved)))
|
||||
return {
|
||||
fields,
|
||||
fixed,
|
||||
someAgentCannotRun,
|
||||
saved: saved.size === 1 ? wirings[0].saved : undefined
|
||||
}
|
||||
const agreed = saved.size === 1 && !disagreed.has('model') && !disagreed.has('reasoning_effort')
|
||||
return { fields, fixed, someAgentCannotRun, saved: agreed ? wirings[0].saved : undefined }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1225,7 +1225,8 @@ components:
|
||||
Path of a reusable `ai_agent` resource (hybrid linking). When set, the agent brain
|
||||
config (provider/model/system prompt/etc.) and tool set are resolved at runtime from
|
||||
that resource; the module's input_transforms then only carry the flow-local inputs
|
||||
(user_message, user_attachments, enabled_tools and the history inputs memory_id and previous_messages).
|
||||
(user_message, user_attachments, enabled_tools and the history inputs memory_id and previous_messages)
|
||||
and, optionally, the `model` and `reasoning_effort` overrides of what the agent saved.
|
||||
tool_inputs:
|
||||
type: object
|
||||
description: |
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user