Repository navigation
test(api): strictly type plugin model and chunk merger tests - #45230
Open
ShousenZHANG wants to merge 1 commit into
Open
ShousenZHANG wants to merge 1 commit into
ShousenZHANG wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-01 04:54:31.546507941 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-01 04:54:06.050435054 +0000
@@ -4140,20 +4140,6 @@
--> tests/unit_tests/core/plugin/backwards_invocation/test_app.py:439:16
ERROR Object of class `Account` has no attribute `app_id` [missing-attribute]
--> tests/unit_tests/core/plugin/backwards_invocation/test_app.py:440:16
-ERROR Object of class `NoneType` has no attribute `context_tokens` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:408:12
-ERROR Object of class `NoneType` has no attribute `max_output_tokens` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:409:12
-ERROR Object of class `NoneType` has no attribute `output_parameter` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:410:12
-ERROR Object of class `NoneType` has no attribute `context_tokens` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:434:12
-ERROR Object of class `NoneType` has no attribute `max_output_tokens` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:435:12
-ERROR Object of class `NoneType` has no attribute `max_output_tokens` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:454:12
-ERROR Object of class `NoneType` has no attribute `output_parameter` [missing-attribute]
- --> tests/unit_tests/core/plugin/backwards_invocation/test_model.py:455:12
ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
--> tests/unit_tests/core/plugin/entities/test_plugin_daemon.py:313:40
ERROR Argument `object` is not assignable to parameter `method` with type `str` in function `httpx._api.request` [bad-argument-type]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45230 +/- ##
=======================================
Coverage 89.85% 89.85%
=======================================
Files 6249 6249
Lines 398125 398125
Branches 80223 80223
=======================================
+ Hits 357739 357744 +5
+ Misses 34076 34070 -6
- Partials 6310 6311 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Refs #24645, following #45221.
Enable strict Pyrefly checking for the plugin model backwards-invocation and chunk-merger tests. Annotate the existing tests, use the model types exercised by the parameterized cases, and explicitly check that resolved token limits exist before reading their fields.
Existing cases, assertions and dependency patches are preserved. The converter's empty-list input now has an explicit element type.
Evidence
Production type checking uses the Tencent provider source path for the Windows worktree. Tests run through the local Windows wrapper for readline/libmagic.
Merge Danger
Reversible; scope is two test modules and their strict-check exclusions. With the existing fixtures and parameterized inputs, the tests keep their invocation, billing, MIME, conversion and chunk-integrity assertions. Production behavior is unchanged.
Screenshots
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsBackend commands were run individually on Windows; there are no frontend or documentation changes.
From Codex