Replace unicode arrows with ASCII in log/output strings

Windows cp1252 console encoding can't handle → (U+2192), causing
UnicodeEncodeError in logging. Replaced with -> in all runtime strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
master
PeninsulaInd 2026-03-18 18:56:48 -05:00
parent 48d2e47835
commit 305b3161c4
5 changed files with 14 additions and 14 deletions

View File

@ -394,7 +394,7 @@ class Agent:
# Log to daily memory # Log to daily memory
if self._memory: if self._memory:
try: try:
self._memory.log_daily(f"[Execution] {prompt[:200]}\n {result[:500]}") self._memory.log_daily(f"[Execution] {prompt[:200]}\n-> {result[:500]}")
except Exception as e: except Exception as e:
log.warning("Failed to log execution to memory: %s", e) log.warning("Failed to log execution to memory: %s", e)

View File

@ -40,7 +40,7 @@ _pipeline_err_log.setLevel(logging.INFO)
HEARTBEAT_OK = "HEARTBEAT_OK" HEARTBEAT_OK = "HEARTBEAT_OK"
# Only tasks in these statuses are eligible for xlsx ClickUp matching. # Only tasks in these statuses are eligible for xlsx ->ClickUp matching.
# "to do" is excluded to prevent accidental matches and AutoCora race conditions. # "to do" is excluded to prevent accidental matches and AutoCora race conditions.
# To force-reuse an xlsx for a "to do" task, set status to "running cora" first. # To force-reuse an xlsx for a "to do" task, set status to "running cora" first.
_CORA_ELIGIBLE_STATUSES = frozenset({"running cora", "error"}) _CORA_ELIGIBLE_STATUSES = frozenset({"running cora", "error"})
@ -136,7 +136,7 @@ class Scheduler:
resp.raise_for_status() resp.raise_for_status()
answer = resp.json()["choices"][0]["message"]["content"].strip() answer = resp.json()["choices"][0]["message"]["content"].strip()
result = "YES" in answer.upper() result = "YES" in answer.upper()
log.debug("LLM plural check: '%s' vs '%s' %s (%s)", a, b, result, answer) log.debug("LLM plural check: '%s' vs '%s' ->%s (%s)", a, b, result, answer)
except Exception as e: except Exception as e:
log.warning("LLM plural check failed for '%s' vs '%s': %s", a, b, e) log.warning("LLM plural check failed for '%s' vs '%s': %s", a, b, e)
result = False result = False
@ -542,8 +542,8 @@ class Scheduler:
# Move to "automation underway" on ClickUp immediately # Move to "automation underway" on ClickUp immediately
client.update_task_status(task_id, self.config.clickup.automation_status) client.update_task_status(task_id, self.config.clickup.automation_status)
log.info("Executing ClickUp task: %s %s", task.name, tool_name) log.info("Executing ClickUp task: %s ->%s", task.name, tool_name)
self._notify(f"Executing ClickUp task: **{task.name}** Skill: `{tool_name}`") self._notify(f"Executing ClickUp task: **{task.name}** ->Skill: `{tool_name}`")
self._register_execution(task_id, task.name, tool_name) self._register_execution(task_id, task.name, tool_name)
try: try:
@ -821,7 +821,7 @@ class Scheduler:
"""Try to match a watched .xlsx file to a ClickUp task and run the pipeline.""" """Try to match a watched .xlsx file to a ClickUp task and run the pipeline."""
filename = xlsx_path.name filename = xlsx_path.name
# Normalize filename stem for matching # Normalize filename stem for matching
# e.g., "precision-cnc-machining" "precision cnc machining" # e.g., "precision-cnc-machining" ->"precision cnc machining"
stem = xlsx_path.stem.lower().replace("-", " ").replace("_", " ") stem = xlsx_path.stem.lower().replace("-", " ").replace("_", " ")
stem = re.sub(r"\s+", " ", stem).strip() stem = re.sub(r"\s+", " ", stem).strip()
@ -1277,7 +1277,7 @@ class Scheduler:
task.id, task.id,
f"New Cora XLSX distributed — resetting from error to running cora.", f"New Cora XLSX distributed — resetting from error to running cora.",
) )
log.info("Distributor: reset task %s (%s) from error running cora", task.id, task.name) log.info("Distributor: reset task %s (%s) from error ->running cora", task.id, task.name)
except Exception as e: except Exception as e:
log.warning("Distributor: failed to reset task %s: %s", task.id, e) log.warning("Distributor: failed to reset task %s: %s", task.id, e)
@ -1289,7 +1289,7 @@ class Scheduler:
except OSError as e: except OSError as e:
log.warning("Could not move %s to processed: %s", filename, e) log.warning("Could not move %s to processed: %s", filename, e)
log.info("Cora distributor: %s %s", filename, ", ".join(copied_to)) log.info("Cora distributor: %s ->%s", filename, ", ".join(copied_to))
self._notify( self._notify(
f"Cora distributor: **{filename}** copied to {', '.join(copied_to)}.\n" f"Cora distributor: **{filename}** copied to {', '.join(copied_to)}.\n"
f"Matched tasks: {', '.join(matched_names)}", f"Matched tasks: {', '.join(matched_names)}",
@ -1505,7 +1505,7 @@ class Scheduler:
def _check_cora_file_status(self, cora_tasks) -> dict[str, str]: def _check_cora_file_status(self, cora_tasks) -> dict[str, str]:
"""For each 'running cora' task, check where its xlsx sits on the network. """For each 'running cora' task, check where its xlsx sits on the network.
Returns a dict of task_id human-readable status note. Returns a dict of task_id ->human-readable status note.
""" """
from .tools.linkbuilding import _fuzzy_keyword_match, _normalize_for_match from .tools.linkbuilding import _fuzzy_keyword_match, _normalize_for_match
@ -1519,7 +1519,7 @@ class Scheduler:
"content_processed": Path(self.config.content.cora_inbox) / "processed", "content_processed": Path(self.config.content.cora_inbox) / "processed",
} }
# Build a map: normalized_stem set of folder keys # Build a map: normalized_stem ->set of folder keys
file_locations: dict[str, set[str]] = {} file_locations: dict[str, set[str]] = {}
for folder_key, folder_path in folders.items(): for folder_key, folder_path in folders.items():
if not folder_path.exists(): if not folder_path.exists():

View File

@ -347,7 +347,7 @@ def submit_autocora_jobs(target_date: str = "", ctx: dict | None = None) -> str:
client.update_task_status(tid, "automation underway") client.update_task_status(tid, "automation underway")
submitted.append(group["keyword"]) submitted.append(group["keyword"])
log.info("Submitted AutoCora job: %s %s", group["keyword"], job_id) log.info("Submitted AutoCora job: %s -> %s", group["keyword"], job_id)
# Build response # Build response
lines = [f"AutoCora submission ({label}):"] lines = [f"AutoCora submission ({label}):"]

View File

@ -489,7 +489,7 @@ def _build_optimization_prompt(
f"Generate `{work_dir}/optimization_instructions.md` — a surgical playbook " f"Generate `{work_dir}/optimization_instructions.md` — a surgical playbook "
f"for the human editor with these sections:\n\n" f"for the human editor with these sections:\n\n"
f"1. **Executive Summary** — one-paragraph overview of optimization opportunity\n" f"1. **Executive Summary** — one-paragraph overview of optimization opportunity\n"
f"2. **Heading Changes** — specific H1/H2/H3 modifications with beforeafter\n" f"2. **Heading Changes** — specific H1/H2/H3 modifications with before/after\n"
f"3. **Sections to Expand** — which sections need more content and what to add\n" f"3. **Sections to Expand** — which sections need more content and what to add\n"
f"4. **Entity Integration Points** — exact locations to weave in missing entities\n" f"4. **Entity Integration Points** — exact locations to weave in missing entities\n"
f"5. **Meta Tag Updates** — title tag and meta description recommendations\n" f"5. **Meta Tag Updates** — title tag and meta description recommendations\n"
@ -645,7 +645,7 @@ def _finalize_optimization(
for name, fpath in found_files.items(): for name, fpath in found_files.items():
dest = net_dir / name dest = net_dir / name
dest.write_bytes(fpath.read_bytes()) dest.write_bytes(fpath.read_bytes())
log.info("Copied %s %s", fpath, dest) log.info("Copied %s -> %s", fpath, dest)
except OSError as e: except OSError as e:
log.warning("Could not copy deliverables to network path %s: %s", net_dir, e) log.warning("Could not copy deliverables to network path %s: %s", net_dir, e)

View File

@ -1270,7 +1270,7 @@ def submit_press_release(
if link_list: if link_list:
output_parts.append("\n**Links:**") output_parts.append("\n**Links:**")
for link in link_list: for link in link_list:
output_parts.append(f' - "{link["anchor"]}" {link["url"]}') output_parts.append(f' - "{link["anchor"]}" -> {link["url"]}')
if link_warnings: if link_warnings:
output_parts.append("\n**Link warnings:**") output_parts.append("\n**Link warnings:**")