Skip to content

Commit 37137a5

Browse files
committed
Update ctx.py
1 parent f271644 commit 37137a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/ctx.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ def format_search_results(results: List[Dict[str, Any]], include_snippets: bool
262262
# Inline compact snippet (no fences to keep token count small)
263263
lines.append(f" {ln}")
264264

265+
return "\n".join(lines)
266+
265267

266268

267269
def _ensure_two_paragraph_questions(text: str) -> str:
@@ -565,11 +567,12 @@ def _generate_plan(enhanced_prompt: str, context: str, note: str) -> str:
565567

566568
plan = plan.strip()
567569

568-
# Validate that it looks like a plan
569-
if plan and ("EXECUTION PLAN" in plan.upper() or any(plan.startswith(f"{i}.") for i in range(1, 10))):
570-
return plan
571-
else:
570+
# Relaxed validation: return any non-empty plan; add header if missing
571+
if not plan:
572572
return ""
573+
if "EXECUTION PLAN" not in plan.upper():
574+
plan = "EXECUTION PLAN:\n" + plan
575+
return plan
573576

574577
except Exception:
575578
# Plan generation failed - not critical, just skip it

0 commit comments

Comments
 (0)