Add FastMCP server and startup path - #67
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude Please review this PR throughly., If any manual tests or anything else is needed please ask. Please do not leave any decisison tree or dry runs. go to eeach line of code, do a dry run, make a dependency tree, dry run those codes, find bugs and tell me. Even if you think this might be not an issue, but dry run is telling yo,u, tell me,. USe a real productin case where you will make a test suite, dry run it, see the procvess, report if it breaks, and tell me again, |
|
Claude finished @Atharva-Kanherkar's task in 4m 36s —— View job PR Review: Add FastMCP server and startup path
|
| Missing Test | Risk |
|---|---|
recall_episodes with all 3 modes |
mode routing could silently break |
recall_memories / recall_procedures |
no coverage of retriever integration |
record_procedure_outcome (success + not-found) |
double-get race is untested |
create_mcp_server / create_http_app |
FastMCP tool registration untested |
_map_exception branches |
all 5 exception types uncovered |
_prepare_media with file_path branch |
file validation path untested |
_prepare_media with empty base64 |
ValueError("Cannot store empty media payload") uncovered |
resolve_contradiction |
no test |
HTTP /health endpoint |
no test |
| Invalid transport / port ≤ 0 | ServerConfig.validate paths uncovered |
Summary
| Severity | Count | Items |
|---|---|---|
| 🔴 Critical | 2 | Temp file leak on exception; event loop blocking |
| 🟡 Medium | 5 | Private _collection access; recall_episodes validation; streamable_http_path disconnect; redundant validate_startup; platform-dependent mime extension |
| 🟠 Test Gap | 1 | Concurrent forgetting cycle test doesn't reflect real production race |
| 🔵 Minor | 2 | Naming in test fixture; __main__.py invocation note |
The two critical bugs need to be fixed before merge. The event loop blocking bug (#2) in particular will cause observable hangs in any production HTTP deployment once the memory store grows beyond a few hundred records.
|
@claude re review. i added patches to only real blockers/ |
|
Claude finished @Atharva-Kanherkar's task in 1m 21s —— View job Re-review: Patches for Critical BlockersTasks
🔴 Critical #1 — Temp File Leak: ✅ Fixed
path = Path(handle.name)
try:
media_type = MediaStore.resolve_media_type(path, requested_media_type)
except Exception:
path.unlink(missing_ok=True)
raise
return PreparedMedia(path=path, media_type=media_type, cleanup=True)The One note: 🔴 Critical #2 — Event Loop Blocking: ✅ Fixed
report = await asyncio.get_running_loop().run_in_executor(
None,
functools.partial(
self.runtime().forgetting_service.run_cycle,
dry_run=dry_run,
),
)Correctly offloads the sync 🟠 Test Gap — Concurrent Forgetting Cycle: ✅ FixedThe new test ( def slow_run_cycle(*, dry_run: bool):
started.set()
future = asyncio.run_coroutine_threadsafe(release.wait(), loop)
future.result(timeout=2) # blocks the executor thread
return original(dry_run=dry_run)
This tests the actual production race condition. ✅ Summary
Both blockers are correctly patched. The remaining medium/minor items from the first review (private This PR is unblocked from the two critical issues. Ready to merge once CI passes. |

Summary
Testing
Notes