Skip to content

Commit 506eca0

Browse files
committed
fix the unimplemneted files printing bugs
1 parent cdf1463 commit 506eca0

File tree

1 file changed

+41
-7
lines changed

1 file changed

+41
-7
lines changed

workflows/agents/memory_agent_concise.py

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,24 +1338,58 @@ def is_implemented(plan_file: str) -> bool:
13381338
"""Check if a file from plan is implemented (with fuzzy matching)"""
13391339
# Normalize paths for comparison
13401340
plan_file_normalized = plan_file.replace("\\", "/").strip("/")
1341+
plan_filename = plan_file_normalized.split("/")[-1] # Extract filename
13411342

13421343
for impl_file in self.implemented_files:
13431344
impl_file_normalized = impl_file.replace("\\", "/").strip("/")
1345+
impl_filename = impl_file_normalized.split("/")[-1] # Extract filename
13441346

1345-
# Check if plan_file ends with impl_file (partial path match)
1346-
# or impl_file ends with plan_file (reverse partial match)
1347+
# Strategy 1: Exact path match
1348+
if plan_file_normalized == impl_file_normalized:
1349+
return True
1350+
1351+
# Strategy 2: One path ends with the other (partial path match)
13471352
if plan_file_normalized.endswith(
13481353
impl_file_normalized
13491354
) or impl_file_normalized.endswith(plan_file_normalized):
13501355
# Ensure match is at a path boundary (not middle of directory name)
1351-
if (
1352-
plan_file_normalized.endswith("/" + impl_file_normalized)
1353-
or plan_file_normalized == impl_file_normalized
1354-
or impl_file_normalized.endswith("/" + plan_file_normalized)
1355-
):
1356+
if plan_file_normalized.endswith(
1357+
"/" + impl_file_normalized
1358+
) or impl_file_normalized.endswith("/" + plan_file_normalized):
13561359
return True
1360+
1361+
# Strategy 3: Same filename (fallback for different directory structures)
1362+
# Only match if filenames are identical and reasonably unique (length > 5)
1363+
if plan_filename == impl_filename and len(plan_filename) > 5:
1364+
return True
1365+
13571366
return False
13581367

1368+
# def is_implemented(plan_file: str) -> bool:
1369+
# """Check if a file from plan is implemented (with fuzzy matching)"""
1370+
# # Normalize paths for comparison
1371+
# plan_file_normalized = plan_file.replace("\\", "/").strip("/")
1372+
1373+
# for impl_file in self.implemented_files:
1374+
# impl_file_normalized = impl_file.replace("\\", "/").strip("/")
1375+
1376+
# # Check if plan_file ends with impl_file (partial path match)
1377+
# # or impl_file ends with plan_file (reverse partial match)
1378+
# if plan_file_normalized.endswith(
1379+
# impl_file_normalized
1380+
# ) or impl_file_normalized.endswith(plan_file_normalized):
1381+
# # Ensure match is at a path boundary (not middle of directory name)
1382+
# if (
1383+
# plan_file_normalized.endswith("/" + impl_file_normalized)
1384+
# or plan_file_normalized == impl_file_normalized
1385+
# or impl_file_normalized.endswith("/" + plan_file_normalized)
1386+
# ):
1387+
# return True
1388+
# return False
1389+
1390+
# unimplemented = [f for f in self.all_files_list if not is_implemented(f)]
1391+
# return unimplemented
1392+
13591393
unimplemented = [f for f in self.all_files_list if not is_implemented(f)]
13601394
return unimplemented
13611395

0 commit comments

Comments
 (0)