Repository navigation
Remove conditions ty redundant-condition-strict flags as always true/false - #954
Merged
Sun Haoran (haoranpb) merged 1 commit intoOct 8, 2026
Conversation
Sun Haoran (haoranpb)
added this pull request to stack #957
October 7, 2026 12:57
Contributor
Code Coverage OverviewLanguages: Python Python / code-coverage/pytestThe overall line coverage in commit 0a3f853 in the Show a line coverage summary of the most impacted files.
Updated |
Sun Haoran (haoranpb)
force-pushed
the
ty/strict-redundant-condition
branch
from
October 7, 2026 13:46
ec6d7b8 to
ff6192b
Compare
Sun Haoran (haoranpb)
force-pushed
the
ty/strict-redundant-condition
branch
3 times, most recently
from
October 8, 2026 09:23
af18843 to
7bd0832
Compare
Sun Haoran (haoranpb)
force-pushed
the
ty/strict-redundant-condition
branch
from
October 8, 2026 09:59
7bd0832 to
8cf4dec
Compare
Sun Haoran (haoranpb)
force-pushed
the
ty/strict-redundant-condition
branch
2 times, most recently
from
October 8, 2026 10:13
3d67c55 to
8658692
Compare
Sun Haoran (haoranpb)
marked this pull request as ready for review
October 8, 2026 11:06
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactors preserve existing behavior and correctly address the strict ty diagnostics.
0 open findings
What changed in this PR
Removes conditions that ty proves redundant while preserving runtime behavior for artifact analysis, MCP proxying, and CAPI credential patching.
Changes:
- Removes unreachable
Noneguards. - Extracts MCP upstream forwarding to avoid incorrect type narrowing.
| File | Description |
|---|---|
tools/altest/bcbench_analyze_artifacts.py |
Removes a dead None check. |
src/bcbench/agent/shared/mcp_gateway.py |
Extracts upstream forwarding into a helper method. |
src/bcbench/agent/bcal/bc_eval_capi_bridge.py |
Relies on safe getattr handling for None modules. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…false Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 70c54f79-d7a0-4cde-baf2-e53dfff3deb4
Sun Haoran (haoranpb)
force-pushed
the
ty/strict-redundant-condition
branch
from
October 8, 2026 11:24
8658692 to
0a3f853
Compare
Wenjie Fan (gggdttt)
approved these changes
Oct 8, 2026
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.
What
Remove conditions ty
redundant-condition-strictproves always true/false:bc_eval_capi_bridge.py: drop redundantmod is None(getattr(None, ...)already handles it)._normalize_error_message: drop deadNoneguard.mcp_gateway: extract_forward_upstreamso_response_startedchecks are no longer mis-narrowed.Python only.
Part of the stack that makes ty strict (
all = "error") across the whole uv workspace. Each PR fixes one rule in Python code only; the config change lands in #956.