fix: Windows unicode output and config model names
- Force UTF-8 stdout/stderr on Windows to handle LLM unicode output - Replace ─ (U+2500) with - for Windows cp1251 compatibility - Sanitize em-dash in session filenames - Update default model to glm-5.1 in all roles Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,12 @@ import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
# Force UTF-8 output on Windows (cp1251 can't handle LLM unicode output)
|
||||
if sys.stdout.encoding != "utf-8":
|
||||
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
||||
if sys.stderr.encoding != "utf-8":
|
||||
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
|
||||
|
||||
from meeting_room.api_client import APIClient
|
||||
from meeting_room.config import find_workspace_config, load_config, load_discussion_config
|
||||
from meeting_room.engine import DiscussionEngine
|
||||
@@ -201,7 +207,7 @@ def save_session(conversation: list[dict], scenario_name: str, sessions_dir: str
|
||||
"""Save discussion result to a JSON file."""
|
||||
os.makedirs(sessions_dir, exist_ok=True)
|
||||
timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S")
|
||||
safe_name = scenario_name.replace(" ", "-").lower()
|
||||
safe_name = scenario_name.replace(" ", "-").replace("—", "-").lower()
|
||||
filename = f"{timestamp}_{safe_name}.json"
|
||||
filepath = os.path.join(sessions_dir, filename)
|
||||
|
||||
@@ -253,7 +259,7 @@ def _subscribe_cli_handlers(bus: EventEmitter, max_rounds: int) -> None:
|
||||
print()
|
||||
|
||||
print(f"{BOLD}Rounds:{RESET} {data['rounds']}")
|
||||
print(f"{DIM}{'─' * 60}{RESET}\n")
|
||||
print(f"{DIM}{'-' * 60}{RESET}\n")
|
||||
|
||||
def on_round_start(event) -> None:
|
||||
data = event.data
|
||||
@@ -285,7 +291,7 @@ def _subscribe_cli_handlers(bus: EventEmitter, max_rounds: int) -> None:
|
||||
print(f" [Error: {data['error']}]")
|
||||
|
||||
def on_round_end(event) -> None:
|
||||
print(f"{DIM}{'─' * 60}{RESET}\n")
|
||||
print(f"{DIM}{'-' * 60}{RESET}\n")
|
||||
|
||||
def on_discussion_end(event) -> None:
|
||||
data = event.data
|
||||
|
||||
@@ -37,7 +37,7 @@ roles:
|
||||
moderator:
|
||||
name: "Moderator"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.7
|
||||
tools: "none"
|
||||
system_prompt: |
|
||||
@@ -49,7 +49,7 @@ roles:
|
||||
skeptic:
|
||||
name: "Skeptic"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.9
|
||||
tools: "readonly"
|
||||
system_prompt: |
|
||||
@@ -61,7 +61,7 @@ roles:
|
||||
idea_generator:
|
||||
name: "Idea Generator"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 1.0
|
||||
tools: "web"
|
||||
system_prompt: |
|
||||
@@ -74,7 +74,7 @@ roles:
|
||||
analyst:
|
||||
name: "Analyst"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.5
|
||||
tools: "all"
|
||||
system_prompt: |
|
||||
@@ -88,7 +88,7 @@ roles:
|
||||
defender:
|
||||
name: "Defender"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.6
|
||||
tools: "readonly"
|
||||
system_prompt: |
|
||||
@@ -100,7 +100,7 @@ roles:
|
||||
attacker:
|
||||
name: "Attacker"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.9
|
||||
tools: "readonly"
|
||||
system_prompt: |
|
||||
@@ -113,7 +113,7 @@ roles:
|
||||
security:
|
||||
name: "Security"
|
||||
provider: ollama_cloud
|
||||
model: "gpt-4o-mini"
|
||||
model: "glm-5.1"
|
||||
temperature: 0.4
|
||||
tools: "web"
|
||||
system_prompt: |
|
||||
|
||||
Reference in New Issue
Block a user