oliver-zehentleitner / maity

cli: maity report keeps the placement's proxy for git ls-remote, so a proxied placement can report

Sign in to report

tsk-mfac5zscnkxs Done An agent

Found 2026-11-23 on PR #2150 (req-80skqp8ykynx, from codex-006#8zgq): in a placement that reaches GitHub only through a proxy, maity report fails before it submits anything.

What happens:

  • The guarded git subprocess (git ls-remote) drops the placement's proxy variables, so github.com does not resolve.
  • The forge-probe fallback runs only after that lookup, so it never gets a chance.
  • The card cannot be reported from that placement.

Goal: the git transport keeps the proxy variables the placement sets (HTTPS_PROXY/HTTP_PROXY/NO_PROXY, either case, and ALL_PROXY), while the rest of the isolation stays as it is. If the lookup still fails, report falls back to the forge probe instead of aborting.

Deliver:

  • First a short findings note on this card, with file:line for where the env is built and dropped.
  • Then the fix with tests, including a counter-check that fails without the fix.
  • One sentence in docs/agents.md or docs/runners.md if behaviour changes.
  • A changelog line.

Boundary:

  • Never pass credentials through. Proxy URLs that carry userinfo stay as the placement set them, and they are never logged.
  • No change to which GIT_* variables are dropped (#2148).

Notes

  1. An agent · Nov 23, 2026, 17:59 UTC

    Findings (6j4u), main 70a0e5ce, from reading the code. Nothing is run yet.

    Where the proxy is dropped

    • cli/src/maity/proc.py:99-105: under a placement, proc.run starts git with clonecheck.kept_env(os.environ) plus NO_PROMPT, GIT_ALLOW_PROTOCOL and the pinned GIT_* set (clonecheck.py:572-590). It does not use os.environ.
    • cli/src/maity/clonecheck.py:61: ENV_KEPT = ("HOME", "LANG", "TMPDIR"), plus the Windows start-up names at :62. kept_env at :919-923 keeps only these, so HTTPS_PROXY/HTTP_PROXY/ALL_PROXY/NO_PROXY (either case) never reach git.

    Why report aborts before the probe

    • gitfacts.collect (gitfacts.py:374) calls _remote_head, which runs ls-remote through _git_required (:274, :78-83). A failed lookup raises FactsError there.
    • That happens before the forge lookup (:376-382), so cli.py:1787 aborts. Report's probe fallback (cli.py:1824, _probed_pr) is never reached.

    Precedents for the variable list

    • ghpr.py:59-62 (maity gh) passes HTTPS_PROXY/HTTP_PROXY/NO_PROXY in both cases, but not ALL_PROXY.
    • runner/skills.py:280-284 (the skill fetch) also passes ALL_PROXY and the trust roots.

    Planned fix

    1. clonecheck: a separate ENV_PROXY tuple (https_proxy, HTTPS_PROXY, http_proxy, HTTP_PROXY, all_proxy, ALL_PROXY, no_proxy, NO_PROXY), added to kept_env. Values are passed as set and never logged. No GIT_* variable changes (#2148's list stays). No trust-root variables: an SSL_CERT_FILE set in front of maity where no hook holds the line (agy) would let a man-in-the-middle read the remote's credential. A proxy cannot: git's https still verifies the server through the tunnel.
    2. report: when the ls-remote lookup fails, collect records it instead of raising, and report asks the hub's probe for the card's linked pull request whose head is the local HEAD. That is the same stand-in as for a merged, deleted branch (f720dd3c). With no such pull request, the refusal names the git error as today.
    3. Tests, a counter-check, one sentence in docs/runners.md, and a changelog line.