From a466e0cdb4cbc65c21ae5550219866f2fd159270 Mon Sep 17 00:00:00 2001 From: akadeepesh Date: Wed, 7 Oct 2026 11:15:50 +0530 Subject: [PATCH] fix(watcher): respect manual include/exclude settings in debug context packaging --- contextzip/watcher.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contextzip/watcher.py b/contextzip/watcher.py index 9834fe4..6907b9b 100644 --- a/contextzip/watcher.py +++ b/contextzip/watcher.py @@ -513,11 +513,19 @@ def _package_debug_context( ) referenced_paths: list[Path] = [] else: + # Honour the project's manual include/exclude choices — a file + # the user put in always_exclude must not leak into the debug + # zip just because a stack trace happened to mention it. + from contextzip.project_config import load_project_config + + project_cfg = load_project_config(project_dir) result = process_buffer( raw_buffer=raw_text, project_dir=project_dir, ecosystems=ecosystems, ecosystem_display=ecosystem_display, + always_exclude=project_cfg.always_exclude, + always_include=project_cfg.always_include, ) if result is None: