fix: Workflow placeholder resolution + complete catalog display
Backend workflow_executor.py: - load_prompt_template() now uses modern resolve_placeholders() from prompt_executor - Calls get_placeholder_example_values() to populate ALL registered placeholders - Passes catalog for |d modifier support - Fixes issue where basis prompts had empty/null placeholder values in workflows Backend placeholder_resolver.py: - get_placeholder_catalog() now includes ALL placeholders from PLACEHOLDER_MAP - Uncategorized placeholders added to "Sonstiges" category - Fixes discrepancy: 111 total placeholders but only ~30 shown in picker Root Cause: - Workflow used old resolve_placeholders() (only PLACEHOLDER_MAP, no variables) - Isolated execution used modern resolve_placeholders() (full variables dict) - Catalog excluded non-registry placeholders from PLACEHOLDER_MAP Impact: - All placeholders now resolve correctly in workflow execution - PlaceholderPicker shows all 111+ placeholders (not just registry ones) Version: 0.9p (workflow module) Part 3: End Node Template Engine - Bug Fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a9fb99411
commit
857c55aeb8
2 files changed
+58
-4
No files matched your search
@@ -1470,4 +1470,33 @@ def get_placeholder_catalog(profile_id: str) -> Dict[str, List[Dict[str, str]]]:
|
||||
'example': str(example)
|
||||
})
|
||||
|
||||
# Add ALL remaining placeholders from PLACEHOLDER_MAP that aren't categorized yet
|
||||
# This ensures PlaceholderPicker shows all 111+ placeholders, not just registry ones
|
||||
all_categorized_keys = set()
|
||||
for items in catalog.values():
|
||||
all_categorized_keys.update(p['key'] for p in items)
|
||||
|
||||
sonstige_category = 'Sonstiges'
|
||||
if sonstige_category not in catalog:
|
||||
catalog[sonstige_category] = []
|
||||
|
||||
for placeholder, resolver in PLACEHOLDER_MAP.items():
|
||||
# Extract key from {{key}}
|
||||
key = placeholder.replace('{{', '').replace('}}', '')
|
||||
|
||||
# Skip if already categorized
|
||||
if key in all_categorized_keys:
|
||||
continue
|
||||
|
||||
try:
|
||||
example = resolver(profile_id)
|
||||
except Exception:
|
||||
example = '[Nicht verfügbar]'
|
||||
|
||||
catalog[sonstige_category].append({
|
||||
'key': key,
|
||||
'description': f'Platzhalter: {key}', # Generic description
|
||||
'example': str(example)
|
||||
})
|
||||
|
||||
return catalog
|
||||
Reference in new issue
Block a user