This commit is contained in:
team 1
2026-05-09 20:18:14 +02:00
parent 943c213ac0
commit aae4935d69
6 changed files with 427 additions and 24 deletions

View File

@@ -601,7 +601,7 @@ final class AgentRunnerConfig
'prompt' => $prompt,
];
foreach (['action_type', 'target_role'] as $optionalKey) {
foreach (['action_type', 'target_role', 'hide_when_answer_detail_score_at_least'] as $optionalKey) {
if (isset($item[$optionalKey]) && is_scalar($item[$optionalKey])) {
$optionalValue = trim((string) $item[$optionalKey]);
if ($optionalValue !== '') {
@@ -610,6 +610,28 @@ final class AgentRunnerConfig
}
}
if (array_key_exists('requires_answer_anchor', $item) && (is_bool($item['requires_answer_anchor']) || is_scalar($item['requires_answer_anchor']))) {
$action['requires_answer_anchor'] = $item['requires_answer_anchor'];
}
if (isset($item['hide_when_answer_matches_any']) && is_array($item['hide_when_answer_matches_any'])) {
$patterns = [];
foreach ($item['hide_when_answer_matches_any'] as $pattern) {
if (!is_scalar($pattern)) {
continue;
}
$pattern = trim((string) $pattern);
if ($pattern !== '') {
$patterns[] = $pattern;
}
}
if ($patterns !== []) {
$action['hide_when_answer_matches_any'] = array_values(array_unique($patterns));
}
}
$out[] = $action;
}