Skip to content

verifytypes: pyright produces empty output during install_from_main comparison, causing silent failures #46426

@scbedd

Description

@scbedd

verifytypes check has fragile failure modes when pyright produces no output

Summary

The verifytypes CI check for azure-ai-transcription is consistently failing with exit code 2 (unhandled exception) or exit code 1 (after the fix in #46418). The root cause is that pyright runs for ~71 seconds during the install_from_main comparison step and then exits with code 1 while producing completely empty stdout and stderr. This causes json.loads("") to throw JSONDecodeError.

Observed behavior

  1. The first pyright --verifytypes run (against the PR version of the package) succeeds — 100% type completeness score.
  2. install_from_main sparse-clones main, does uv pip install . --force-reinstall --no-sources --python <path> to replace the package with the main-branch version.
  3. The second pyright --verifytypes --outputjson run (against the main version) hangs for ~71 seconds and exits code 1 with empty stdout and empty stderr.

CI log evidence

From the 2026-04-20 20:01 run (after the fix in #46418):

2026-04-20 20:01:21,488 [INFO] azure-sdk-tools: Installed azure-ai-transcription/azure_ai_transcription-1.0.0b4.tar.gz
2026-04-20 20:02:32,520 [ERROR] azure-sdk-tools: pyright --verifytypes exited with code 1 but did not produce valid JSON output.
stdout: 
stderr:

71 seconds, no output on either stream. This suggests pyright/node.js is either:

  • Being OOM-killed on the hosted agent (exit code mapped to 1)
  • Hitting some internal error that --outputjson suppresses
  • Encountering something about the main-branch version of the package that causes it to spin

Issues found and fixed in #46418

  1. verifytypes.py get_type_complete_score(): json.loads(e.output) on line 202 was unguarded — when pyright exits 1 with empty stdout, JSONDecodeError propagated as an unhandled exception (exit code 2). Now wrapped in try/except with diagnostic logging.

  2. Check.py install_dev_reqs(): logger.error("Failed to install dev requirements:", e) used positional args instead of f-string, causing TypeError in the logging framework and swallowing the actual error message. Fixed to logger.error(f"Failed to install dev requirements: {e}") and raise e → bare raise.

Remaining problem

Even with the fixes in #46418, we still don't know why pyright produces no output for the main-branch version of azure-ai-transcription. The --outputjson flag may be suppressing error output that would otherwise be visible. Since both stdout and stderr are empty, there's no way to diagnose the underlying pyright failure from the current logs.

Suggestions

  • Consider running pyright without --outputjson when the JSON parse fails, to capture human-readable diagnostic output.
  • Or: always log stderr from the pyright invocation even when --outputjson is used, since pyright may write errors to stderr independently of JSON output.
  • Investigate whether the hosted agent has memory pressure that could cause node.js (pyright's runtime) to get killed during the 71-second run.
  • Check whether this is specific to azure-ai-transcription or affects other packages during the install_from_main comparison step.

Affected package

  • azure-ai-transcription (sdk/transcription/azure-ai-transcription)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    EngSysThis issue is impacting the engineering system.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions