Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added new_file.txt
Empty file.
12 changes: 12 additions & 0 deletions pdd/agentic_change_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DEFAULT_MAX_RETRIES,
)
from pdd.load_prompt_template import load_prompt_template
from pdd.preprocess import preprocess
from pdd.sync_order import (
build_dependency_graph,
topological_sort,
Expand Down Expand Up @@ -594,6 +595,17 @@ def run_agentic_change_orchestrator(
if not prompt_template:
return False, f"Missing prompt template: {template_name}", total_cost, model_used, []

# Preprocess to expand <include> tags and escape curly braces
# This prevents KeyError when templates or included files contain JSON with braces
# See: Issue #392, compare with agentic_architecture_orchestrator.py:299-302
exclude_keys = list(context.keys())
prompt_template = preprocess(
prompt_template,
recursive=True,
double_curly_brackets=True,
exclude_keys=exclude_keys
)

try:
formatted_prompt = prompt_template.format(**context)
except KeyError as e:
Expand Down
Loading