Cải thiện kiến trúc agent: thread-safety, native function calling, ch…#389
Open
mekongai wants to merge 1 commit into666ghj:mainfrom
Open
Cải thiện kiến trúc agent: thread-safety, native function calling, ch…#389mekongai wants to merge 1 commit into666ghj:mainfrom
mekongai wants to merge 1 commit into666ghj:mainfrom
Conversation
…eckpoint resume, context budget P0 - SimulationRunner: thêm RLock (_state_lock) bảo vệ tất cả class-level dicts (_run_states, _processes, _action_queues, _monitor_threads, _stdout_files, _stderr_files, _graph_memory_enabled) tránh race condition khi đa luồng. P0 - ReportAgent: thay custom <tool_call> string-parsing bằng OpenAI native function calling (chat_with_tools). Thêm _get_openai_tools() chuyển đổi tool definitions sang OpenAI JSON schema format. Cập nhật system prompt loại bỏ hướng dẫn XML format. Áp dụng cho cả generate_report và chat(). P1 - ReportAgent: thêm section checkpoint resume — trước khi generate mỗi section, kiểm tra section_XX.md đã tồn tại; nếu có thì load và skip, cho phép tiếp tục từ điểm crash. Thêm ReportManager.load_section_checkpoint(). P1 - LLMClient: thêm estimate_tokens() và estimate_messages_tokens() ước tính token không cần tiktoken. Trong _generate_section_react, khi context vượt 28K tokens thì tự động xóa cặp tool message cũ nhất. P2 - ZepToolsService.interview_agents: cập nhật comment — đã xác nhận dùng direct call đến SimulationRunner.interview_agents_batch(), không qua HTTP. https://claude.ai/code/session_01PaYamLFZVbuSVZgjrHu81G
koyouko
added a commit
to koyouko/MiroFish
that referenced
this pull request
Mar 30, 2026
… Copilot) Replaces the single-provider LLM client with a unified 5-provider client. Adds thread-safety improvements to simulation_runner from upstream PR 666ghj#389, GitHub Copilot OAuth token support from upstream PR 666ghj#383, and translates all backend Python modules to English. Providers supported: Anthropic (Claude), OpenAI, GitHub Copilot (OAuth), Ollama (local), and the original MiniMax/GLM default. Co-Authored-By: koyouko <koyouko@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…eckpoint resume, context budget
P0 - SimulationRunner: thêm RLock (_state_lock) bảo vệ tất cả class-level dicts
(_run_states, _processes, _action_queues, _monitor_threads, _stdout_files,
_stderr_files, _graph_memory_enabled) tránh race condition khi đa luồng.
P0 - ReportAgent: thay custom <tool_call> string-parsing bằng OpenAI native
function calling (chat_with_tools). Thêm _get_openai_tools() chuyển đổi
tool definitions sang OpenAI JSON schema format. Cập nhật system prompt
loại bỏ hướng dẫn XML format. Áp dụng cho cả generate_report và chat().
P1 - ReportAgent: thêm section checkpoint resume — trước khi generate mỗi
section, kiểm tra section_XX.md đã tồn tại; nếu có thì load và skip,
cho phép tiếp tục từ điểm crash. Thêm ReportManager.load_section_checkpoint().
P1 - LLMClient: thêm estimate_tokens() và estimate_messages_tokens() ước tính
token không cần tiktoken. Trong _generate_section_react, khi context vượt
28K tokens thì tự động xóa cặp tool message cũ nhất.
P2 - ZepToolsService.interview_agents: cập nhật comment — đã xác nhận dùng
direct call đến SimulationRunner.interview_agents_batch(), không qua HTTP.
https://claude.ai/code/session_01PaYamLFZVbuSVZgjrHu81G