fix(integrations): strip UTF-8 BOM when reading agent context files (#2283)

* fix(integrations): strip UTF-8 BOM when reading agent context files

* test(integrations): add BOM regression tests for context file read/write

* test(workflows): mock shutil.which in tests that assume CLI is absent

* test(integrations): remove unused manifest variable in BOM test
This commit is contained in:
Ayesha Khalid
2026-04-21 02:00:20 +05:00
committed by GitHub
parent dc057a2314
commit b4c4e86cbc
3 changed files with 55 additions and 6 deletions

View File

@@ -482,7 +482,7 @@ class IntegrationBase(ABC):
)
if ctx_path.exists():
content = ctx_path.read_text(encoding="utf-8")
content = ctx_path.read_text(encoding="utf-8-sig")
start_idx = content.find(self.CONTEXT_MARKER_START)
end_idx = content.find(
self.CONTEXT_MARKER_END,
@@ -547,7 +547,7 @@ class IntegrationBase(ABC):
if not ctx_path.exists():
return False
content = ctx_path.read_text(encoding="utf-8")
content = ctx_path.read_text(encoding="utf-8-sig")
start_idx = content.find(self.CONTEXT_MARKER_START)
end_idx = content.find(
self.CONTEXT_MARKER_END,