Skip to content

Commit aa06ada

Browse files
committed
fix: address review findings in dynamic tool list PR
- Fix get_blocked_tools docstring: says "concurrently" but checks run sequentially (two awaits, no asyncio.gather) - Fix _viewer_credentials docstring: says users.update, should be users.update_role - Broaden _login retry to catch httpx.RequestError alongside RuntimeError for network errors and timeouts - Add comment explaining why viewer E2E tests skip on Outline 1.5.0 (users.update_role invalidates API keys) https://claude.ai/code/session_0122umEU4tP9VMzCTrV6SdZN
1 parent 80a8913 commit aa06ada

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/mcp_outline/features/dynamic_tools/filtering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async def get_blocked_tools(
190190
) -> set[str]:
191191
"""Return tool names *api_key* cannot access.
192192
193-
Performs two independent checks **concurrently** (results
193+
Performs two independent checks sequentially (results
194194
unioned):
195195
196196
1. ``auth.info`` — blocks tools by user role via ``min_role``

tests/e2e/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _login(
124124
for attempt in range(retries):
125125
try:
126126
return _login_once(email, password)
127-
except RuntimeError as exc:
127+
except (RuntimeError, httpx.RequestError) as exc:
128128
last_exc = exc
129129
if attempt < retries - 1:
130130
time.sleep(2 * (attempt + 1))
@@ -437,7 +437,7 @@ def _viewer_credentials(outline_stack, _outline_credentials):
437437
"""Log in as ``user@example.com`` and set role to viewer.
438438
439439
Uses the admin session token to demote the second Dex user
440-
to ``viewer`` via ``users.update``. Returns
440+
to ``viewer`` via ``users.update_role``. Returns
441441
``(full_access_key, scoped_keys, access_token)``.
442442
443443
**Order matters**: all API keys must be created *before*

tests/e2e/test_dynamic_tool_list.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ async def test_http_header_filters_tools(
532532
# -------------------------------------------------------------------
533533

534534
# READ_TOOLS (viewer tools) already computed by _build_expected_tools()
535+
#
536+
# NOTE: These tests are skipped on Outline 1.5.0 because
537+
# ``users.update_role`` invalidates existing API keys. The
538+
# ``_viewer_credentials`` fixture detects this and calls
539+
# ``pytest.skip``. Role-based filtering is still covered by
540+
# unit tests in ``tests/features/test_dynamic_tools.py``.
535541

536542

537543
async def test_viewer_full_access_key_blocks_writes(

0 commit comments

Comments
 (0)