-
Notifications
You must be signed in to change notification settings - Fork 169
feat(logging): support tool logs and per-task log storage #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive logging support for tool operations and per-task log storage to improve debugging and monitoring capabilities.
- Implements ZMQ-based logging infrastructure for collecting logs from MCP servers
- Adds per-task log file storage with context-aware logging
- Integrates logging setup across all MCP servers with banner suppression
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/logging/logger.py | Core logging infrastructure with ZMQ handlers, task context management, and file-based per-task logging |
| src/tool/manager.py | Integration of task context variables into MCP server parameters |
| src/tool/mcp_servers/*.py | Addition of logging setup and banner suppression across all MCP servers |
| common_benchmark.py | Integration of logging context for benchmark task execution |
| pyproject.toml | Addition of pyzmq dependency for ZMQ-based logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| if __name__ == "__main__": | ||
| mcp.run(transport="stdio") | ||
| mcp.run(transport="stdio",show_banner=False) |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after comma in function call parameters. Should be mcp.run(transport=\"stdio\", show_banner=False)
| mcp.run(transport="stdio",show_banner=False) | |
| mcp.run(transport="stdio", show_banner=False) |
|
|
||
| if __name__ == "__main__": | ||
| mcp.run(transport="stdio") | ||
| mcp.run(transport="stdio",show_banner=False) |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after comma in function call parameters. Should be mcp.run(transport=\"stdio\", show_banner=False)
| mcp.run(transport="stdio",show_banner=False) | |
| mcp.run(transport="stdio", show_banner=False) |
|
|
||
| if __name__ == "__main__": | ||
| mcp.run(transport="stdio") | ||
| mcp.run(transport="stdio",show_banner=False) |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after comma in function call parameters. Should be mcp.run(transport=\"stdio\", show_banner=False)
| mcp.run(transport="stdio",show_banner=False) | |
| mcp.run(transport="stdio", show_banner=False) |
| mcp.run(transport="stdio",show_banner=False) | ||
| else: | ||
| # For HTTP transport, include port and path options | ||
| mcp.run(transport="streamable-http", port=args.port, path=args.path) | ||
| mcp.run(transport="streamable-http", port=args.port, path=args.path,show_banner=False) |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after comma in function call parameters. Should be mcp.run(transport=\"stdio\", show_banner=False) and mcp.run(transport=\"streamable-http\", port=args.port, path=args.path, show_banner=False)
|
|
||
| if __name__ == "__main__": | ||
| mcp.run(transport="stdio") | ||
| mcp.run(transport="stdio",show_banner=False) |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after comma in function call parameters. Should be mcp.run(transport=\"stdio\", show_banner=False)
| mcp.run(transport="stdio",show_banner=False) | |
| mcp.run(transport="stdio", show_banner=False) |
|
|
||
| def remove_all_console_handlers(): | ||
| """ | ||
| 移除当前进程中所有 logger 上的 console handler (StreamHandler/RichHandler)。 |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be in English to maintain code consistency, as the rest of the codebase uses English comments.
| 移除当前进程中所有 logger 上的 console handler (StreamHandler/RichHandler)。 | |
| Remove all console handlers (StreamHandler/RichHandler) from all loggers in the current process. |
| log_dir: str | Path | None = None, # 日志存储目录 | ||
| log_filename: str = "miroflow.log", # 默认日志文件名 | ||
| to_console: bool = True, # 是否显示到 console |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be in English to maintain code consistency, as the rest of the codebase uses English comments.
| log_dir: str | Path | None = None, # 日志存储目录 | |
| log_filename: str = "miroflow.log", # 默认日志文件名 | |
| to_console: bool = True, # 是否显示到 console | |
| log_dir: str | Path | None = None, # Directory to store log files | |
| log_filename: str = "miroflow.log", # Default log file name | |
| to_console: bool = True, # Whether to display logs to console |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Describe this PR
What changed?
Why?
Related issues
Checklist for PR
Write a descriptive PR title following the Angular commit message format:
<type>(<scope>): <subject>feat(agent): add pdf tool via mcp,perf: make llm client async,fix(utils): load custom config via importlibfeat,fix,docs,style,refactor,perf,test,build,ci,revertcheck-pr-titleCI job will validate your title formatUpdate README❌ Missing type and colonfeat add new feature❌ Missing colon after typeFeature: add new tool❌ Invalid type (should befeat)feat(Agent): add tool❌ Scope should be lowercasefeat(): add tool❌ Empty scope not allowedfeat(my_scope): add tool❌ Underscores not allowed in scopefeat(my space): add tool❌ Space not allowed in scopefeat(scope):add tool❌ Missing space after colonfeat(scope):❌ Empty subjectRun lint and format locally:
uv tool run ruff@0.8.0 check --fix .uv tool run ruff@0.8.0 format .lintenforces ruff default format/lint rules on all new codes.