Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds error handling for the default remote config and makes type safety improvements while reducing workflow frequency.
- Adds a try-except fallback mechanism when fetching the default Dev-Sidecar remote config
- Improves type annotations by changing
raw_configfromdict | listto the more preciseJSON5Objecttype - Reduces GitHub Actions workflow frequency from every 30 minutes to every 8 hours
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/main.py | Wraps default_remote config download in try-except block with fallback to a cached result on failure |
| src/Config.py | Updates type annotation for raw_config to JSON5Object and adds type ignore directives for SheasCealerConfig's narrower type |
| .github/workflows/main.yml | Reduces scheduled workflow runs from twice per hour to once every 8 hours |
Comments suppressed due to low confidence (1)
src/main.py:60
- Only the default_remote config has error handling, but the other config sources (SheasCealerConfig, GithubConfig for 8odream, and LocalConfig for manual) can also fail with RuntimeError or other exceptions. According to the project's merge order (default_remote → 8odream → Sheas Cealer → manual), if any of these later sources fail, the entire script will crash. Consider adding similar try-except blocks for the other config sources to improve resilience, or document why only default_remote needs this protection.
# 获取 Sheas Cealer 配置,默认为空列表
sheas_cealer = SheasCealerConfig(
"SpaceTimee/Cealing-Host/raw/main/Cealing-Host.json", "Sheas Cealer"
)
# 读取 8odream 配置
_8odream = GithubConfig(
"8odream/Devsidecar-8odream-config/raw/main/config.json", "8odream"
)
# 读取 手动配置
manual = LocalConfig(manual_path, "Manual")
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
|
@cute-omega I've opened a new pull request, #35, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Update raw_config docstring to reflect JSON5Object type Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
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.
No description provided.