Skip to content

refactor(ai): ai callers use the HTTP entry point #3791

Description

@dan-petty

Problem

Slice 1 of #3758 (part 3 of #1314). Eight modules of src/devops_cli/ai/ build their HTTP client with new_http_client or new_async_http_client: gateway.py, pool_load.py, library/docs_ingester.py, providers/__init__.py, models/ollama.py, rag/embeddings.py, spend/pricing.py. About 50 test files in tests/ai/ and tests/review/ still use stub_web, public_dns, scripted_resolver, record_connects, patches of httpx2.Client methods, MockTransport clients built by hand, or patches of private client methods of LLMClient.

Expected

Every caller in src/devops_cli/ai/ builds its client through devops_cli.http.entry (http_client, async_http_client). Every test of these callers uses the web and dns fixtures and patches no httpx2 class and no devops_cli name for HTTP.

Acceptance criteria

  • No file in src/devops_cli/ai/ names new_http_client, new_async_http_client, get_shared_client or get_shared_async_client.
  • No test in tests/ai/ or tests/review/ uses stub_web, public_dns, scripted_resolver, record_connects or tests/web_fakes.py.
  • No test in these directories patches an httpx2 class or socket.getaddrinfo, and none builds a MockTransport client by hand.
  • Each caller keeps its timeouts, redirect rules and egress level.
  • uv run devops ci is green.

Existing tool considered

Not applicable. The slice uses the seams of parts 1 and 2 (the dns and web fixtures, devops_cli.http.entry) and adds no tool.

Related

Parent: #3758. Umbrella: #1314.

Activity

  1. added
    source/agent
    type/refactor
    scope/ai
    status/new
    value/medium
    effort/medium
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/refactor. The refactor prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. It is a planned refactor slice with no user-facing defect or security gap.
    • Value: Medium. It removes duplicate client-construction paths and unifies test doubles for the AI module.
    • Effort: Medium. Eight source modules and about fifty test files change, but the swap pattern is fixed.
    • Related: refactor(cli): callers use the HTTP entry point, old factories go #3758, which asks for a different change. Both move AI-module callers to the HTTP entry point, but #3758 covers all 36 modules while the candidate covers only the 8 modules in src/devops_cli/ai/.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 6, 2026
  5. removed
    status/in-review
    on Nov 6, 2026
  6. added a commit that references this issue on Nov 6, 2026
  7. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 16:15 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/aisource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions