Skip to content

Commit 03da5f1

Browse files
committed
style: apply linter formatting to cloud testing fixes
- Format async_client.py timeout configuration - Format headers.py security improvements - Format read_note.py error handling Maintains all functionality while conforming to project code style. Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 0632076 commit 03da5f1

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/basic_memory/mcp/async_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def create_client() -> AsyncClient:
1818
# Default httpx timeout is 5 seconds which is too short for file operations
1919
timeout = Timeout(
2020
connect=10.0, # 10 seconds for connection
21-
read=30.0, # 30 seconds for reading response
22-
write=30.0, # 30 seconds for writing request
23-
pool=30.0 # 30 seconds for connection pool
21+
read=30.0, # 30 seconds for reading response
22+
write=30.0, # 30 seconds for writing request
23+
pool=30.0, # 30 seconds for connection pool
2424
)
2525

2626
if proxy_base_url:
@@ -30,7 +30,9 @@ def create_client() -> AsyncClient:
3030
else:
3131
# Default: use ASGI transport for local API (development mode)
3232
logger.debug("Creating ASGI client for local Basic Memory API")
33-
return AsyncClient(transport=ASGITransport(app=fastapi_app), base_url="http://test", timeout=timeout)
33+
return AsyncClient(
34+
transport=ASGITransport(app=fastapi_app), base_url="http://test", timeout=timeout
35+
)
3436

3537

3638
# Create shared async client

src/basic_memory/mcp/tools/headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def inject_auth_header(headers: HeaderTypes | None = None) -> HeaderTypes:
2929

3030
# Log only non-sensitive header keys for debugging
3131
if logger.opt(lazy=True).debug:
32-
safe_headers = {k for k in http_headers.keys() if k.lower() != 'authorization'}
32+
safe_headers = {k for k in http_headers.keys() if k.lower() != "authorization"}
3333
logger.debug(f"HTTP headers present: {list(safe_headers)}")
3434

3535
authorization = http_headers.get("Authorization") or http_headers.get("authorization")

src/basic_memory/mcp/tools/read_note.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def read_note(
131131
)
132132

133133
# Handle both SearchResponse object and error strings
134-
if title_results and hasattr(title_results, 'results') and title_results.results:
134+
if title_results and hasattr(title_results, "results") and title_results.results:
135135
result = title_results.results[0] # Get the first/best match
136136
if result.permalink:
137137
try:
@@ -161,7 +161,7 @@ async def read_note(
161161

162162
# We didn't find a direct match, construct a helpful error message
163163
# Handle both SearchResponse object and error strings
164-
if not text_results or not hasattr(text_results, 'results') or not text_results.results:
164+
if not text_results or not hasattr(text_results, "results") or not text_results.results:
165165
# No results at all
166166
return format_not_found_message(active_project.name, identifier)
167167
else:

0 commit comments

Comments
 (0)