Repository navigation
fix(services): remove unjustified type:ignore and narrow bare except - #12
Merged
Harikeshav-R merged 1 commit intoSep 11, 2026
Conversation
edge_gateway/app.py's get_items and create_item both silenced mypy's [no-any-return] on `return data_resp.json()` with a type: ignore, even though both functions are declared -> dict[str, Any]. Assign to an explicitly-typed local first instead -- mypy treats the annotation as authoritative, so the return type-checks with no ignore needed. loadgen/runner.py's _execute_single_request caught bare `except Exception` around a call that can only raise httpx.RequestError subclasses. A bare catch there would silently record a real bug (e.g. a TypeError from a malformed RequestSpec) as a fake "failed request" metric instead of failing the load-gen run loudly. Narrow to `except httpx.RequestError`. Implements build-plan step A1.1/A1.8 (fix on already-completed services). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh
Harikeshav-R
deleted the
fix/edge-gateway-type-ignore-loadgen-except
branch
September 11, 2026 19:49
Merged
7 tasks done
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.
Build-Plan Step Implemented
Checkpoint Execution & Output
Two pre-existing, unrelated items excluded above, both isolated by direct
investigation to the same root cause: constructing a real
httpx.AsyncClient()with no explicit
transport=(i.e. httpx's real default transport, notMockTransport/ASGITransport) triggers a Windows-local-only OpenSSL Uplinkcrash between psycopg-binary and httpx on this dev machine. This is not
present on CI (
ubuntu-latest,.github/workflows/ci.yml).tests/unit/services/test_edge_gateway.py'sclientfixture entersedge_gateway.app.lifespan, which constructs exactly such a client. Iverified the two changed lines directly instead, by calling
get_itemsand
create_itemwithapp.state.http_clientmocked and bypassinglifespanentirely -- both return the expecteddictwith no ignore.test_loadgen.py::test_run_loadgen_with_owned_client_and_zero_rpscallsrun_loadgen(config)with noclient=, sorun_loadgenconstructs itsown default-transport client internally. All 10 other tests in that file
pass, including the new regression test added by this PR.
ADRs Relied On
Mock Registry Disclosures
Documentation Updates
documented contract or tunable changed.
Definition of Done
make checkgreen (see checkpoint output; two pre-existing Windows-local-only items excluded and independently verified, not related to this change)# MOCKED:marker without a row in docs/MOCKS.mdContext
A
/code-reviewpass against PR #6 flagged two unjustified silencing patterns(AGENTS.md §5.4): a
type: ignore[no-any-return]used twice inedge_gateway/app.pywhere a typed local variable is the real fix, and abare
except Exceptioninloadgen/runner.pythat could mask a genuine bugas a fake failed-request metric. Both are fixed here with no behavior change
to the legitimate paths (httpx transient errors are still recorded as failed
requests; only non-httpx exceptions now propagate).
Base branch is
feat/policies-and-loadgen(PR #6, still open), sinceservices/only exists on that branch's stack.🤖 Generated with Claude Code
https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh