fix: replace remaining glob('*.md') with rglob('*.md') in all adaptors
Follow-up to #349 — the same bug existed in 4 more adaptor files: - base.py (2 locations) — affects all adaptors via inheritance - openai_compatible.py (2 locations) — affects minimax, deepseek, kimi, qwen, openrouter, together, fireworks - markdown.py (1 location) - streaming_adaptor.py (1 location) No glob("*.md") remains in any adaptor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -288,7 +288,7 @@ class SkillAdaptor(ABC):
|
|||||||
if not references_dir.exists():
|
if not references_dir.exists():
|
||||||
return
|
return
|
||||||
|
|
||||||
for ref_file in sorted(references_dir.glob("*.md")):
|
for ref_file in sorted(references_dir.rglob("*.md")):
|
||||||
if ref_file.is_file() and not ref_file.name.startswith("."):
|
if ref_file.is_file() and not ref_file.name.startswith("."):
|
||||||
try:
|
try:
|
||||||
content = ref_file.read_text(encoding="utf-8")
|
content = ref_file.read_text(encoding="utf-8")
|
||||||
@@ -565,7 +565,7 @@ class SkillAdaptor(ABC):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
toc_lines = []
|
toc_lines = []
|
||||||
for ref_file in sorted(refs_dir.glob("*.md")):
|
for ref_file in sorted(refs_dir.rglob("*.md")):
|
||||||
if ref_file.name == "index.md":
|
if ref_file.name == "index.md":
|
||||||
continue
|
continue
|
||||||
title = ref_file.stem.replace("_", " ").title()
|
title = ref_file.stem.replace("_", " ").title()
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ Browse the reference files for detailed information on each topic. All files are
|
|||||||
# Add all reference files
|
# Add all reference files
|
||||||
if refs_dir.exists():
|
if refs_dir.exists():
|
||||||
# Sort for consistent ordering
|
# Sort for consistent ordering
|
||||||
ref_files = sorted(refs_dir.glob("*.md"))
|
ref_files = sorted(refs_dir.rglob("*.md"))
|
||||||
|
|
||||||
for ref_file in ref_files:
|
for ref_file in ref_files:
|
||||||
if ref_file.name == "index.md":
|
if ref_file.name == "index.md":
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ Always prioritize accuracy by consulting the attached documentation files before
|
|||||||
knowledge_dir = temp_path / "knowledge_files"
|
knowledge_dir = temp_path / "knowledge_files"
|
||||||
knowledge_count = 0
|
knowledge_count = 0
|
||||||
if knowledge_dir.exists():
|
if knowledge_dir.exists():
|
||||||
knowledge_count = len(list(knowledge_dir.glob("*.md")))
|
knowledge_count = len(list(knowledge_dir.rglob("*.md")))
|
||||||
|
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
@@ -364,7 +364,7 @@ Always prioritize accuracy by consulting the attached documentation files before
|
|||||||
references = {}
|
references = {}
|
||||||
total_chars = 0
|
total_chars = 0
|
||||||
|
|
||||||
for ref_file in sorted(references_dir.glob("*.md")):
|
for ref_file in sorted(references_dir.rglob("*.md")):
|
||||||
if total_chars >= max_chars:
|
if total_chars >= max_chars:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ class StreamingAdaptorMixin:
|
|||||||
# Reference files
|
# Reference files
|
||||||
refs_dir = skill_dir / "references"
|
refs_dir = skill_dir / "references"
|
||||||
if refs_dir.exists():
|
if refs_dir.exists():
|
||||||
for ref_file in sorted(refs_dir.glob("*.md")):
|
for ref_file in sorted(refs_dir.rglob("*.md")):
|
||||||
if ref_file.is_file() and not ref_file.name.startswith("."):
|
if ref_file.is_file() and not ref_file.name.startswith("."):
|
||||||
content = ref_file.read_text(encoding="utf-8")
|
content = ref_file.read_text(encoding="utf-8")
|
||||||
char_count = len(content)
|
char_count = len(content)
|
||||||
|
|||||||
Reference in New Issue
Block a user