Private
Public Access
0
0

fix(gui): Final monolithic stabilization pass

- Restore monolithic architecture in gui_2.py to fix test breakages and circular imports.
- Update Text Viewer stable ID to '###Text_Viewer_Unified' to definitively fix docking conflicts.
- Refactor discussion entry renderer to force full-width horizontal expansion for Markdown.
- Fully restore theme_2.py definitions (palettes, fonts, scale) while retaining role-tint logic.
- Robustify ImGui ID stack in imgui_scopes.py to prevent access violations.
- Verify all fixes with the comprehensive unit and visual test suite.
This commit is contained in:
2026-06-02 17:30:46 -04:00
parent ad98475a2e
commit 8f6f47d46b
16 changed files with 551 additions and 710 deletions
+6 -4
View File
@@ -2461,7 +2461,8 @@ def get_token_stats(md_content: str) -> dict[str, Any]:
"""
global _provider, _gemini_client, _model, _CHARS_PER_TOKEN
total_tokens = 0
if _provider == "gemini":
p = str(_provider).lower().strip()
if p == "gemini":
try:
_ensure_gemini_client()
if _gemini_client:
@@ -2479,8 +2480,8 @@ def get_token_stats(md_content: str) -> dict[str, Any]:
pass
if total_tokens == 0:
total_tokens = max(1, int(len(md_content) / _CHARS_PER_TOKEN))
limit = _GEMINI_MAX_INPUT_TOKENS if _provider in ["gemini", "gemini_cli"] else _ANTHROPIC_MAX_PROMPT_TOKENS
if _provider == "deepseek":
limit = _GEMINI_MAX_INPUT_TOKENS if p in ["gemini", "gemini_cli"] else _ANTHROPIC_MAX_PROMPT_TOKENS
if p == "deepseek":
limit = 64000
pct = (total_tokens / limit * 100) if limit > 0 else 0
stats = {
@@ -2522,7 +2523,8 @@ def send(
_append_comms("OUT", "request", {"message": user_message, "system": _get_combined_system_prompt(_active_tool_preset, _active_bias_profile)})
with _send_lock:
if _provider == "gemini":
p = str(_provider).lower().strip()
if p == "gemini":
res = _send_gemini(
md_content, user_message, base_dir, file_items, discussion_history,
pre_tool_callback, qa_callback, enable_tools, stream_callback, patch_callback