-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix incorrect type annotations and errors #3250
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
Merged
Merged
Conversation
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
Contributor
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.
Copilot wasn't able to review any files in this pull request.
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
Copilot stopped work on behalf of
LIghtJUNction due to an error
November 1, 2025 19:09
LIghtJUNction
approved these changes
Nov 1, 2025
Member
|
@copilot 继续 |
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
[WIP] Fix incorrect type annotations and errors
Fix incorrect type annotations and errors
Nov 2, 2025
Copilot finished work on behalf of
LIghtJUNction
November 2, 2025 06:10
Member
|
@copilot 解决冲突 |
Contributor
Author
已成功解决所有合并冲突! 冲突解决详情:
合并后状态:
最新提交: edf8e00 |
Copilot finished work on behalf of
LIghtJUNction
November 2, 2025 06:54
Member
|
检查完毕,安全 |
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.
Finding and fixing incorrect type annotations
Systematically fixed all incorrect type annotations throughout the AstrBot codebase, changing the incorrect pattern
Type = Noneto the correctType | None = Nonesyntax following Python 3.10+ best practices.Changes Made
Fixed 19 files with incorrect type annotations across multiple modules:
CLI and Utilities:
astrbot/cli/commands/cmd_conf.py- Fixedkeyparameter type annotationastrbot/cli/commands/cmd_init.py- AddedPathtype annotation forastrbot_rootparameterastrbot/cli/utils/plugin.py- Fixed backup_path None checksCore Utilities:
astrbot/core/utils/pip_installer.py- Fixed installer parametersastrbot/core/utils/io.py- Fixed download_image_by_url parametersPlatform Adapters:
astrbot/core/platform/platform_metadata.py- Fixed dataclass fieldsastrbot/core/platform/register.py- Fixed register_platform_adapter parametersastrbot/core/platform/astr_message_event.py- Fixed request_llm and get_group parametersastrbot/core/platform/astrbot_message.py- Fixed MessageMember and Group dataclassesPlatform Sources:
astrbot/core/platform/sources/discord/components.py- Fixed DiscordEmbed and DiscordButton parametersastrbot/core/platform/sources/discord/client.py- Fixed proxy parameterastrbot/core/platform/sources/discord/discord_platform_adapter.py- Fixed params parameterastrbot/core/platform/sources/qqofficial/qqofficial_message_event.py- Fixed message parametersastrbot/core/platform/sources/wechatpadpro/xml_data_parser.py- Fixed raw_message parameterastrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py- Fixed session_id parameterProvider and Configuration:
astrbot/core/provider/provider.py- Fixed text_chat and text_chat_stream abstract methodsastrbot/core/provider/register.py- Fixed register_provider_adapter parametersastrbot/core/config/astrbot_config.py- Fixed schema and replace_config parametersDashboard:
astrbot/dashboard/routes/config.py- Fixed conf_id parameterMerge Conflict Resolution
Successfully resolved all merge conflicts with the dev branch:
message_session.py,sqlite_v3.py,persona_mgr.py,platform_message_history_mgr.py) were properly removedastrbot/cli/utils/version_comparator.py- Kept dev branch version which already contained the type annotation fixesValidation
ruff formatType = Nonepatterns fixed throughout the codebaseThe changes are focused and consistent, correcting type annotations without altering any functionality.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.