pipeio_run env resolution bug: _resolve_snakemake_cmd() finds snakemake on PATH (from rag env) before checking the cogpy fallback. The SNAKEMAKE Makefile variable (step 2 in resolution) isn't being picked up either. Result: flows fail with ModuleNotFoundError: No module named 'snakebids' because they run in the wrong Python env.
Root cause: In src/projio/mcp/pipeio.py, line ~1622, _resolve_snakemake_cmd() is called without arguments even though _resolve_snakemake_cmd(use_conda: str = "") accepts an env name. The use_conda parameter on pipeio_run is typed as bool (for --use-conda flag) rather than str (for env name).
Fix: Either (1) read the project's code.envs.default from projio config and pass it to _resolve_snakemake_cmd, or (2) parse the SNAKEMAKE variable from the flow's Makefile correctly. The Makefile parsing may have a bug — I added SNAKEMAKE := conda run -n cogpy snakemake to the preprocess_ieeg Makefile but it wasn't picked up.
Workaround: run snakemake directly via conda run -n cogpy snakemake ... from the flow directory.
Source context: pixecog¶
PixEcog (pixecog): Neuropixels and ECoG dataset and analysis
Recent commits:
b666c23 TTL masking POC: injection guards experiment — drift is real, not injection contamination
910401b preprocess_ieeg: TTL masking POC notebook exported + docs collected
ef3592f preprocess_motion: report, updated index with report link, docs collect
README:
type: readme
Quick Start for Collaborators¶
Follow this checklist to get started with Pixecog documentation and workflows.
🐀 Pixecog Project — Compact Overview¶
Core principles
- One immutable BIDS raw dataset (
raw/) as the canonical baseline - Each analysis pipeline ha
Related Notes¶
- issue-arash-20260409-232034-115590.md — Same root cause pattern: MCP server uses its own env (rag) instead of the intended cogpy env — pipeio_nb_exec has the same wrong-env problem
- issue-arash-20260411-155019-000942.md — Also a pipeio_run bug involving snakebids sessions; snakebids import error in the current note is a direct symptom of the wrong-env resolution
- issue-arash-20260409-232128-727233.md — pipeio_run passes bad flags to snakemake — related pipeio_run/snakemake invocation defect in the same code path
- issue-arash-20260412-013432-321867.md — Test coverage for mcp/pipeio.py — the file where _resolve_snakemake_cmd() lives and the fix should be validated
- issue-arash-20260409-232102-577698.md — pipeio_run_status runtime crash — another pipeio_run failure mode, likely related infrastructure