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:
2026-05-04 07:14:34 +03:00
parent 962b0beddd
commit ae7fb35d4b
2 changed files with 16 additions and 10 deletions

View File

@@ -10,6 +10,12 @@ import os
import sys import sys
from datetime import datetime 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.api_client import APIClient
from meeting_room.config import find_workspace_config, load_config, load_discussion_config from meeting_room.config import find_workspace_config, load_config, load_discussion_config
from meeting_room.engine import DiscussionEngine 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.""" """Save discussion result to a JSON file."""
os.makedirs(sessions_dir, exist_ok=True) os.makedirs(sessions_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S") 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" filename = f"{timestamp}_{safe_name}.json"
filepath = os.path.join(sessions_dir, filename) filepath = os.path.join(sessions_dir, filename)
@@ -253,7 +259,7 @@ def _subscribe_cli_handlers(bus: EventEmitter, max_rounds: int) -> None:
print() print()
print(f"{BOLD}Rounds:{RESET} {data['rounds']}") 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: def on_round_start(event) -> None:
data = event.data data = event.data
@@ -285,7 +291,7 @@ def _subscribe_cli_handlers(bus: EventEmitter, max_rounds: int) -> None:
print(f" [Error: {data['error']}]") print(f" [Error: {data['error']}]")
def on_round_end(event) -> None: def on_round_end(event) -> None:
print(f"{DIM}{'' * 60}{RESET}\n") print(f"{DIM}{'-' * 60}{RESET}\n")
def on_discussion_end(event) -> None: def on_discussion_end(event) -> None:
data = event.data data = event.data

View File

@@ -37,7 +37,7 @@ roles:
moderator: moderator:
name: "Moderator" name: "Moderator"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.7 temperature: 0.7
tools: "none" tools: "none"
system_prompt: | system_prompt: |
@@ -49,7 +49,7 @@ roles:
skeptic: skeptic:
name: "Skeptic" name: "Skeptic"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.9 temperature: 0.9
tools: "readonly" tools: "readonly"
system_prompt: | system_prompt: |
@@ -61,7 +61,7 @@ roles:
idea_generator: idea_generator:
name: "Idea Generator" name: "Idea Generator"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 1.0 temperature: 1.0
tools: "web" tools: "web"
system_prompt: | system_prompt: |
@@ -74,7 +74,7 @@ roles:
analyst: analyst:
name: "Analyst" name: "Analyst"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.5 temperature: 0.5
tools: "all" tools: "all"
system_prompt: | system_prompt: |
@@ -88,7 +88,7 @@ roles:
defender: defender:
name: "Defender" name: "Defender"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.6 temperature: 0.6
tools: "readonly" tools: "readonly"
system_prompt: | system_prompt: |
@@ -100,7 +100,7 @@ roles:
attacker: attacker:
name: "Attacker" name: "Attacker"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.9 temperature: 0.9
tools: "readonly" tools: "readonly"
system_prompt: | system_prompt: |
@@ -113,7 +113,7 @@ roles:
security: security:
name: "Security" name: "Security"
provider: ollama_cloud provider: ollama_cloud
model: "gpt-4o-mini" model: "glm-5.1"
temperature: 0.4 temperature: 0.4
tools: "web" tools: "web"
system_prompt: | system_prompt: |