Skip to content

Fix CrossHair subprocess missing PYTHONPATH#1476

Merged
KRRT7 merged 1 commit into
mainfrom
fix-crosshair-pythonpath
Feb 13, 2026
Merged

Fix CrossHair subprocess missing PYTHONPATH#1476
KRRT7 merged 1 commit into
mainfrom
fix-crosshair-pythonpath

Conversation

@KRRT7
Copy link
Copy Markdown
Contributor

@KRRT7 KRRT7 commented Feb 13, 2026

Summary

  • Prepend project_root to PYTHONPATH before spawning the CrossHair subprocess in concolic_testing.py, matching the pattern used by every other subprocess (tracer, test runner, benchmarks).
  • Fixes ModuleNotFoundError for project-relative imports (e.g. Django projects) during concolic test generation.

Test plan

  • Existing concolic tests pass (88/88)
  • Verify CrossHair resolves project-relative imports in a Django-style project

@KRRT7 KRRT7 merged commit 544fd7a into main Feb 13, 2026
25 of 27 checks passed
@KRRT7 KRRT7 deleted the fix-crosshair-pythonpath branch February 13, 2026 03:29
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 13, 2026

PR Review Summary

Prek Checks

All checks passed. No formatting or linting issues found.

Mypy

No new type errors introduced. Two pre-existing mypy errors exist in this file (var-annotated on line 47 and no-redef on line 109), but they are not related to this PR's changes.

Code Review

No critical issues found. This is a clean, focused fix:

  • Adds PYTHONPATH propagation to the CrossHair subprocess call in concolic_testing.py, matching the established pattern used in tracer.py (lines 134-158, 177-200)
  • The pattern (os.environ.copy() → check/prepend project_root → pass env=env) is consistent with how all other subprocess calls handle PYTHONPATH in this codebase
  • No security concerns — environment is copied (not shared), and only project_root is prepended
  • No breaking API changes

Test Coverage

File Stmts Covered Coverage
codeflash/verification/concolic_testing.py 61 18 30%

Analysis:

  • The new lines (67-73, 97) are not directly covered by unit tests, but the entire generate_concolic_tests function body (lines 46-132) was already uncovered before this PR
  • Coverage is unchanged — only module-level imports and the function signature are exercised by the test suite
  • This function requires CrossHair and subprocess integration to test, which is validated by the existing 88/88 concolic test suite mentioned in the PR description
  • No coverage regression from this change

Optimization PRs

Checked 7 open codeflash-ai[bot] PRs targeting main. None are eligible for merge — all have CI failures (pre-commit hooks, type-check, or unit test failures).


Last updated: 2026-02-13T03:40Z

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