From f116f027cfbeef1c52c6b63974e3ca089990d64c Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 2 Jun 2026 03:12:27 -0400 Subject: [PATCH] fix(gui): Resolve MiniMax compression error and fix Markdown table rendering - Correctly route 'minimax' provider in run_discussion_compression. - Fix MiniMax base URL to api.minimax.io to match main sender. - Refactor read-mode discussion entries to always use a scrollable child with auto-resize. - Remove redundant text wrapping that caused Markdown tables to squash vertically. - Clean up duplicate separators in discussion hub. --- src/ai_client.py | 10 ++++++++++ src/gui_2.py | 10 ++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ai_client.py b/src/ai_client.py index 4ee29df6..9d02bd2a 100644 --- a/src/ai_client.py +++ b/src/ai_client.py @@ -2659,6 +2659,16 @@ def run_discussion_compression(discussion_text: str) -> str: return r.json()["choices"][0]["message"]["content"] except Exception as e: return f"ERROR: DeepSeek compression failed: {e}" + elif _provider == "minimax": + _ensure_minimax_client() + if _minimax_client: + resp = _minimax_client.chat.completions.create( + model=_model, + messages=[{"role": "user", "content": prompt}], + temperature=0.0, + max_tokens=2048 + ) + return resp.choices[0].message.content or "" elif _provider == "gemini_cli": adapter = GeminiCliAdapter(binary_path="gemini") resp_data = adapter.send(prompt, model=_model) diff --git a/src/gui_2.py b/src/gui_2.py index 3523587f..ae061b71 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -3189,8 +3189,6 @@ def render_discussion_entry(app: App, entry: dict, index: int) -> None: draw_list.add_rect_filled(p_min, p_max, imgui.get_color_u32(bg_col), 4.0) draw_list.channels_merge() imgui.separator() - imgui.separator() - imgui.separator() def render_discussion_entry_read_mode(app: App, entry: dict, index: int) -> None: content = entry["content"] @@ -3212,11 +3210,11 @@ def render_discussion_entry_read_mode(app: App, entry: dict, index: int) -> None pattern = re.compile(r"\[Definition: (.*?) from (.*?) \(line (\d+)\)\](\s+```[\s\S]*?```)?") matches, is_nerv = list(pattern.finditer(content)), theme.is_nerv_active() if not matches: - with theme.ai_text_style(): - markdown_helper.render(content, context_id=f'disc_{index}') + with imscope.child(f"read_content_{index}", size_x=0, size_y=0, flags=imgui.WindowFlags_.no_scroll_with_mouse | imgui.WindowFlags_.always_auto_resize): + with theme.ai_text_style(): + markdown_helper.render(content, context_id=f'disc_{index}') else: - with imscope.child(f"read_content_{index}", size_y=400, flags=True): - if app.ui_word_wrap: imgui.push_text_wrap_pos(imgui.get_content_region_avail().x) + with imscope.child(f"read_content_{index}", size_x=0, size_y=400, flags=True): last_idx = 0 for m_idx, match in enumerate(matches): before = content[last_idx:match.start()]