Skip to content

perf(harness): lazy import httpx - #357

Merged
msoedov merged 2 commits into
mainfrom
perf/harness-lazy-httpx
Oct 18, 2026
Merged

msoedov merged 2 commits into
mainfrom
perf/harness-lazy-httpx

Conversation

@msoedov

@msoedov msoedov commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Uses Python 3.15 lazy import (PEP 810) for httpx in agentic_security_harness/deciders.py. Only JevDecider needs it, and it was ~75% of the harness import time.

  • import agentic_security_harness.cli: ~150 ms -> ~60-80 ms; httpx is not loaded unless JevDecider runs.
  • black 26.3.1 cannot parse lazy import; bumped to 26.10.1. flake8 reports E402 for imports after a lazy import, so it sits at the end of the import block.

Also moves the function-local import fire in cli.py to a top-level lazy import fire (same behavior, no timing change).

Tests: 479 passed, 5 skipped on 3.15.0. pre-commit clean.

🤖 Generated with Claude Code

@msoedov
msoedov force-pushed the perf/harness-lazy-httpx branch from 4a2fac4 to b89cf55 Compare October 18, 2026 16:49
@msoedov
msoedov merged commit b6a5669 into main Oct 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant