fix(channels): make contract checks portable and complete - #7267
Open
kaiwangleo wants to merge 4 commits into
Open
fix(channels): make contract checks portable and complete#7267kaiwangleo wants to merge 4 commits into
kaiwangleo wants to merge 4 commits into
Conversation
kaiwangleo
requested a deployment
to
ai-review-approved
August 25, 2026 06:05 — with
GitHub Actions
Waiting
|
Hi @kaiwangleo, thank you for your first Pull Request! 🎉 📋 About PR TemplateTo help maintainers review your PR faster, please make sure to include:
Complete PR information helps speed up the review process. You can edit the PR description to add these details. 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
hongxicheng
requested review from
yutai78786
and removed request for
hongxicheng
August 25, 2026 06:21
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.


Closes #7264
What Problem This Solves
The existing channel contract gate can report success without proving that every registered built-in channel has a runnable contract test. On a Windows checkout using a non-UTF-8 default code page, the previous checker read UTF-8 Python sources with the platform default encoding and could raise
UnicodeDecodeError. Its filename/regular-expression scan also missedSIPChannel, which is exported fromsip/__init__.py, and did not reliably cover OneBot, WeChat, WeCom, XiaoYi, or Yuanbao.The local channel runner had corresponding portability and discovery gaps: it used legacy package checks and extras, could misclassify changed files, and did not consistently include untracked files or preserve required failure status. This made a green local result insufficient evidence of complete built-in channel coverage.
Evidence
The baseline behavior was reproduced by inspecting the checker and registry: the checker used implicit
Path.read_text()encoding, scanned onlychannel.py, and reported incomplete coverage for the registered channels. The runner also contained the legacy package name and derived changed channels from filenames rather than registry keys.The implementation in this PR is verified by these concrete results:
python -X utf8=0 scripts/check_channel_contracts.pyreports 18 total, 18 tested, and 0 missing channels.448 passed, 1 skipped.pytest tests/contract -q:406 passed, 1 skipped.pytest tests/unit -q:8065 passed, 19 skipped.bash -n scripts/check-channels.sh, repository pre-commit hooks, Mypy, Black, Flake8, Pylint, actionlint, and targetedgit diff --checkpassed.Summary
SIPChannel, validate canonicalBaseChannelinheritance and contract paths, and fail closed on ambiguous or disabled contract factories.scripts/check-channels.shfor QwenPaw package/test extras, linked worktrees, tracked and untracked changes, registry-based mapping, and required-check exit codes..gitattributespaths.Scope and compatibility
This PR covers built-in channel contract coverage and its local/CI gates. Plugin-provided channels remain responsible for coverage in their own test scope. Optional channel unit tests remain supplemental and non-blocking in the local runner.
The implementation is organized into three focused commits so the coverage fixtures, static gate, and local runner can be reviewed independently. The branch is synchronized with the current upstream
main; maintainers can split the commits into separate PRs if preferred.No optional channel dependency is imported by the static checker.