Skip to content

Surface user-owned MCP services in the configure picker - #1162

Open
nachill-databricks wants to merge 4 commits into
databricks:mainfrom
nachill-databricks:achille/configure-lists-custom-mcp-services
Open

nachill-databricks wants to merge 4 commits into
databricks:mainfrom
nachill-databricks:achille/configure-lists-custom-mcp-services

Conversation

@nachill-databricks

@nachill-databricks nachill-databricks commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The picker's background workspace walk (30s budget) probed schemas in arbitrary order, so on large workspaces a user's own service such as main.default.exa could be missing with no hint why.

Change

Probe the main catalog and default schemas first, flag partial results past the deadline, and show a timeout notice in the picker footer pointing to ug mcp add.

Before: services silently missing. After: user-owned services surface earlier, and a timeout notice appears when the listing is partial.

Testing

  • Unit tests added in tests/test_databricks.py and tests/test_mcp.py. uv run pytest -q tests/test_databricks.py tests/test_mcp.py: 654 passed.
  • uvx --from rust-just just lint: passes (ruff check, ruff format --check, ty check).
  • 8 tests in tests/test_agents_init.py and tests/test_e2e_user_agent.py fail on main too, independent of this change.
  • Live run on a real workspace found 4 user MCP services and returned the reason "deadline exceeded while listing MCP services", which main silently dropped.

Not yet verified

  • A workspace with a main.default service.

Before / after

Real runs in a sandbox HOME against a live workspace; workspace hostname and catalog name replaced with and . Picker filtered to "figma".

Before (main):
before
After (this branch): listing timed out on this workspace, so the new fallback note shows. The test service lives outside main.default, so the new probe order isn't visible here; the unit tests cover it.
after

This pull request and its description were written by Isaac.

The picker's background workspace walk (30s budget) probed schemas in
arbitrary order, so on large workspaces a user's own service such as
main.default.exa could still be missing, with no hint why. Probe the
`main` catalog and `default` schemas first, flag partial results past the
deadline, and show a "timed out" footer so users know to use `ug mcp add`.

Co-authored-by: Isaac <no-reply@databricks.com>
@nachill-databricks
nachill-databricks marked this pull request as ready for review October 16, 2026 17:59
@sunishsheth2009

Copy link
Copy Markdown
Collaborator

/ug-review

Comment thread src/ucode/databricks.py Outdated
)
if reason is not None:
return [], reason
timed_out = time.monotonic() > deadline

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · low
what happens if every schema drains but the clock passes the deadline right after? the full list then gets flagged incomplete. can the walk report whether items were left unprobed instead of re-checking the clock?

Comment thread src/ucode/mcp.py Outdated
Comment on lines +1331 to +1332
deadline; on a timeout or error the picker keeps what streamed in (at least `system.ai`) and
the footer says why the list may be incomplete."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation · low
the docstring says the footer explains timeouts and errors, but only timeouts show a warning (test_walk_error_degrades_to_system_ai_only checks that errors stay silent). can we fix the docstring to match?

Comment thread src/ucode/mcp.py Outdated
cancel_event=cancel_event,
on_error=failure.append,
)
if failure and "deadline exceeded" in failure[0]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainability · medium
can we avoid matching on the free-form "deadline exceeded" text from databricks.py? if that wording changes, the warning stops showing without any error, and the test wouldn't catch it because it passes in the same literal. a shared constant or a timed-out flag would fix both.

Comment thread src/ucode/mcp.py Outdated
on_error=failure.append,
)
if failure and "deadline exceeded" in failure[0]:
return "⚠ Timed out listing your MCP services; to add one not shown, use `ug mcp add`"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other · low
this picker is often already ug mcp add, and running it again just reopens the same walk and times out the same way. can we point to ug mcp add --names <catalog.schema.name> instead?

Suggestion:

Suggested change
return "⚠ Timed out listing your MCP services; to add one not shown, use `ug mcp add`"
return (
"⚠ Timed out listing your MCP services; to add one not shown, use "
"`ug mcp add --names <catalog.schema.name>`"
)

Comment thread tests/test_databricks.py
db_mod.list_all_mcp_services(WS, "token")

# The user's likeliest schema leads, so a deadline cut-off still finds it.
assert probed[0] == "main.default"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · low
can this be flaky? probes run on several worker threads, so main.alpha can append before main.default even when dequeued second. can we assert on the dequeue order (e.g. max_workers=1) instead?

Co-authored-by: Isaac <no-reply@databricks.com>
@nachill-databricks

Copy link
Copy Markdown
Contributor Author

/ug-review

Comment thread src/ucode/databricks.py Outdated
Comment on lines +3306 to +3307
if not drained and on_incomplete is not None:
on_incomplete()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · low
should_stop also covers cancel_event, so a cancel (e.g. the picker closing) calls on_incomplete and gets reported as "deadline exceeded". can we only flag when time.monotonic() > deadline, or name the reason so it covers both?

Comment thread src/ucode/databricks.py Outdated
return sorted(names), None
return [], MCP_SERVICES_WALK_TIMEOUT_REASON if incomplete else "no MCP services found"
# Partial results are still returned, but flagged so callers can say the list is incomplete.
return sorted(names), MCP_SERVICES_WALK_TIMEOUT_REASON if incomplete else None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainability · low
(names, reason) now means "failure" when names is empty but "warning" when it isn't, and callers can only tell by checking both. could we return a small dataclass with an explicit incomplete flag?

Comment thread tests/test_databricks.py
assert probed[0] == "main.default"

def test_flags_partial_results_past_deadline(self, monkeypatch):
def slow_walk(workspace, token, *, deadline, probe, collect, on_incomplete, **kwargs):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · medium
both new partial-result tests replace walk_catalog_schemas with a stub, so nothing tests the real path where _collect_concurrently returns False and that triggers on_incomplete. can we run the real walk with a probe that blocks until the deadline?

@github-actions

Copy link
Copy Markdown

Polly AI Review

Blocking issues

  • P2 — src/ucode/mcp.py:1361: can we shorten the footer? its fixed, unwrapped one-row window clips the command to ug mcp add - at 80 columns, hiding --names <catalog.schema.name>.

Security vulnerabilities

None identified in the changed code.

Non-blocking notes

  • src/ucode/databricks.py:3306: can we assert on_incomplete in the existing walker deadline and full-success tests? the new tests stub the walker, leaving the actual completion signal unprotected.
  • tests/test_mcp.py:1141: can we parameterize test_walk_timeout_keeps_system_ai_and_warns over MCP_SERVICES_WALK_TIMEOUT_REASONS? catalog/schema timeout messages are currently untested.
  • tests/test_mcp.py:1156: can we stream a partial service before reporting timeout and assert it remains selectable? shown never passes through the loader, so this assertion cannot catch lost choices.

Approach

The approach fits the existing walker and picker-message interfaces. Tracking whether collection drained avoids falsely reporting a timeout merely because the clock passed the deadline afterward. No broader refactor is needed.

Summary

Diff size (computed): 4 files; +187 / -17 lines (204 changed text lines); 0 binary files.

Category Files Added Deleted Share of changed text lines
Tests and test support 2 116 1 57.4%
Documentation 0 0 0 0.0%
Dependencies and lockfiles 0 0 0 0.0%
Implementation / other 2 71 16 42.6%

Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements.

Changes

Prioritizes main and default schema probes, propagates incomplete-discovery status while retaining results, and adds an actionable picker notice. The diff contains implementation and unit-test changes, with no documentation, dependency, or generated-file changes.

The size is proportional to the outcome. One concrete simplification is to exercise probe priority directly through the existing walker test setup with max_workers=1, avoiding the additional walker wrapper.

Tests

Test-by-test assessment
Test / case Behavior protected Layer Needed? Action / rationale
tests/test_databricks.py::TestListAllMcpServices::test_probes_main_default_first main.default is probed before competing schemas Component, fake HTTP keep Exercises the real walker with deterministic concurrency and guards the priority change.
tests/test_databricks.py::TestListAllMcpServices::test_flags_partial_results_past_deadline Partial names accompany the timeout reason Unit keep Protects aggregation when the walker signals incompleteness; it does not test production of that signal.
tests/test_databricks.py::TestListAllMcpServices::test_fully_drained_walk_is_not_flagged_even_if_deadline_passes_after Completed discovery is not falsely marked incomplete Unit keep Distinct regression boundary: an expired clock alone must not override successful completion.
tests/test_mcp.py::TestConfigureMcpCommand::test_workspace_wide_walk_streams_services_into_picker — modified local fake_walk Existing streaming behavior remains compatible with the callback argument Component keep Accepting on_error preserves the existing scenario without new setup.
tests/test_mcp.py::TestConfigureMcpCommand::test_picker_includes_user_mcp_service_alongside_system_ai User services join initial choices without duplicates Component keep Checks composition of MCP choices using the existing merge helper.
tests/test_mcp.py::TestConfigureMcpCommand::test_walk_timeout_keeps_system_ai_and_warns Timeout returns the warning and fallback command Unit keep Protects message construction, but not rendered visibility. Parameterize timeout reasons and replace the untouched-choice assertion with streamed partial results.
tests/test_mcp.py::TestConfigureMcpCommand::test_walk_error_degrades_to_system_ai_only Non-timeout discovery errors do not produce a timeout footer Unit keep Covers the distinct error-classification branch without a live service.
tests/test_mcp.py:12 — timeout-reason import Supplies the production reason to the timeout scenario Test support keep Supporting import only; no shared fixture or helper behavior changes.

No tests were removed. Existing walker deadline, cancellation, successful-drain, pagination, and probe-error coverage provides relevant foundations. Extend the existing deadline/full-success cases to verify the new callback. A small picker-rendering test at 80 columns would catch the blocking truncation; live-workspace E2E coverage is unnecessary for that assertion.

The PR reports passing focused tests and lint; these were not independently executed. Review used the checksum-verified frozen diff and trusted default-branch context because the supplied base/head commit objects were unavailable locally.

Human verification: open ug mcp add in an 80-column terminal, let discovery time out, and confirm the complete fallback command is visible and discovered choices remain selectable.

Scope

All changes support discovery priority and partial-result reporting. The shared walker also changes skills-discovery probe order, but no incompatible behavior or independent outcome was identified. No clearly unrelated changes or unresolved scope questions were found.


Automated review by Polly · workflow run

…-walk test

Co-authored-by: Isaac <no-reply@databricks.com>
@nachill-databricks

Copy link
Copy Markdown
Contributor Author

/ug-review

Comment thread src/ucode/databricks.py Outdated
# Reasons the walk reports when the deadline cuts it short; callers match on these, not on text.
_WALK_TIMEOUT_CATALOGS_REASON = "deadline exceeded while listing UC catalogs"
_WALK_TIMEOUT_SCHEMAS_REASON = "deadline exceeded while listing UC schemas"
MCP_SERVICES_WALK_TIMEOUT_REASON = "deadline exceeded while listing MCP services"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainability · low
list_all_mcp_services doesn't return this anymore. only mcp.py builds it from timed_out. can we move it to mcp.py, or drop it from the reasons set so the two timeout signals don't overlap?

Comment thread src/ucode/mcp.py Outdated
Comment on lines +506 to +508
reason = walk.error or (MCP_SERVICES_WALK_TIMEOUT_REASON if walk.timed_out else None)
if reason is not None and on_error is not None:
on_error(reason)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainability · low
can we pass the walk's timed_out flag through instead of turning it back into a string? the loader then string-matches against MCP_SERVICES_WALK_TIMEOUT_REASONS, so any new or renamed timeout reason silently drops the warning

Comment thread tests/test_databricks.py
Comment on lines +1776 to +1777
def test_flags_partial_results_past_deadline(self, monkeypatch):
def slow_walk(workspace, token, *, deadline, probe, collect, on_incomplete, **kwargs):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · low
are the stubbed slow_walk/cancelled_walk tests necessary? the real-walk tests below cover the same paths. also, the sleep loop here does nothing because the stub calls on_incomplete(True) either way

Comment thread tests/test_mcp.py
prefix = f"{mcp.MCP_ADD_PREFIX}{mcp.MCP_SERVICE_SELECTION_PREFIX}"
assert sorted(values) == [f"{prefix}main.default.exa", f"{prefix}system.ai.github"]

def test_walk_timeout_keeps_system_ai_and_warns(self, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · medium
these tests all monkeypatch discover_all_mcp_service_names, so its timed_out→on_error mapping is never run. can we stub list_all_mcp_services returning McpServicesWalk(names, timed_out=True) instead?

@github-actions

Copy link
Copy Markdown

Polly AI Review

Blocking issues

None identified.

Security vulnerabilities

None identified in the changed code.

Non-blocking notes

  • src/ucode/mcp.py:1363: at 80 columns, the one-row footer clips at ug mcp add -, hiding the bypass flag. Can we shorten it and check rendering at that width?
  • tests/test_mcp.py:1141: can test_walk_timeout_keeps_system_ai_and_warns exercise the real discovery wrapper with partial results? Stubbing discovery leaves result-to-warning propagation untested.
  • tests/test_mcp.py:1121: can we combine test_picker_includes_user_mcp_service_alongside_system_ai with test_workspace_wide_walk_streams_services_into_picker?
  • tests/test_databricks.py:1776: can we fold test_flags_partial_results_past_deadline into test_real_walk_flags_timeout_when_probe_blocks_past_deadline? The stub reports its own timeout.
  • tests/test_databricks.py:1791: can we fold test_cancel_is_incomplete_but_not_a_timeout into test_real_walk_cancel_is_not_a_timeout, retaining the partial-name assertions?
  • tests/test_databricks.py:1747: can test_probes_main_default_first assert the full four-schema order? It currently checks only the first priority tier.

Approach

Reusing the shared walker and existing picker-message channel is sound. A shorter footer avoids changing the shared picker layout.

The ordering applies to queued probes after schema enumeration; it cannot guarantee discovery of main.default if enumeration consumes the deadline. That limitation predates this change.

Summary

Diff size (computed): 4 files; +298 / -37 lines (335 changed text lines); 0 binary files.

Category Files Added Deleted Share of changed text lines
Tests and test support 2 200 13 63.6%
Documentation 0 0 0 0.0%
Dependencies and lockfiles 0 0 0 0.0%
Implementation / other 2 98 24 36.4%

Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements.

Changes

The change prioritizes main and default during MCP discovery, records incomplete deadline-limited walks, and forwards a recovery notice to the configure picker. The diff contains implementation and focused tests, with no documentation, dependency, or generated-file changes.

The implementation is proportional to the stated outcome. Most avoidable bulk is overlapping test setup, rather than unnecessary production changes.

Tests

Test-by-test assessment

The PR reports 654 passing tests and a passing lint gate. These results were not independently executed. Assessment used the frozen diff and existing tests in the trusted checkout.

Test / case Behavior protected Layer Needed? Action / rationale
tests/test_databricks.py::TestListAllMcpServices::test_aggregates_services_across_catalogs_and_schemas Aggregated, deduplicated names and successful non-timeout result Component: HTTP stubs with real walker keep Preserves existing aggregation assertions while adapting to the result object.
tests/test_databricks.py::TestListAllMcpServices::test_reports_progress_per_schema Per-schema progress callbacks Component keep Distinct callback contract; result-shape update preserves existing coverage.
tests/test_databricks.py::TestListAllMcpServices::test_skips_internal_catalogs Internal catalogs are excluded and the filtered-empty reason survives Component keep Distinct from receiving no catalogs from the backend.
tests/test_databricks.py::TestListAllMcpServices::test_returns_reason_when_no_catalogs Empty catalog listing returns its reason Component keep Preserves the early-return failure contract.
tests/test_databricks.py::TestListAllMcpServices::test_probes_main_default_first main.default receives the first probe Component keep Inline probe recording and the single-worker adapter make ordering observable. Extend the assertion to cover the remaining priority tiers already present in its inputs.
tests/test_databricks.py::TestListAllMcpServices::test_flags_partial_results_past_deadline Partial names accompany a timeout flag Unit: replaced walker consolidate Fold into the real-walker timeout case. Its local slow_walk explicitly signals timeout, so sleeping does not verify deadline detection.
tests/test_databricks.py::TestListAllMcpServices::test_cancel_is_incomplete_but_not_a_timeout Cancellation preserves partial names without reporting timeout Unit: replaced walker consolidate Move its partial-name assertions into the real cancellation scenario and remove the local cancelled_walk setup.
tests/test_databricks.py::TestListAllMcpServices::test_real_walk_flags_timeout_when_probe_blocks_past_deadline A blocked probe causes timeout while completed results survive Component: real walker and threads keep Exercises the collector-to-incomplete callback path. The local probe models the relevant blocking boundary and is released in cleanup.
tests/test_databricks.py::TestListAllMcpServices::test_real_walk_cancel_is_not_a_timeout Real cancellation is distinguished from deadline expiry Component keep Extend the local probe scenario to collect a result before cancellation, absorbing the stubbed cancellation case’s assertions.
tests/test_databricks.py::TestListAllMcpServices::test_fully_drained_walk_is_not_flagged_even_if_deadline_passes_after A completed walk is not retrospectively labeled timed out Unit: replaced walker keep Distinct completion-versus-clock boundary. The local drained_walk isolates that result-classification contract.
tests/test_mcp.py::TestConfigureMcpCommand::test_workspace_wide_walk_streams_services_into_picker Streamed service names become picker choices Unit composition consolidate Merge with the initial-plus-streamed scenario; its modified fake_walk only accommodates the new callback argument.
tests/test_mcp.py::TestConfigureMcpCommand::test_picker_includes_user_mcp_service_alongside_system_ai Initial system choices and streamed user choices coexist without duplicates Unit composition consolidate Use this scenario for the combined streaming test. Its local fake_walk supplies the relevant product composition; generic deduplication already has coverage.
tests/test_mcp.py::TestConfigureMcpCommand::test_walk_timeout_keeps_system_ai_and_warns Timeout reasons produce the recovery-message string Unit: replaced discovery keep Replace the local fake_walk at a lower boundary to exercise real result-to-warning propagation. The untouched initial-choice assertion does not establish retention; add a narrow-terminal rendering check.
tests/test_mcp.py::TestConfigureMcpCommand::test_walk_error_degrades_to_system_ai_only Non-timeout discovery failure produces no timeout footer or additions Unit keep Distinct failure policy. Its local fake_walk is minimal, though the assertions do not establish that a system choice is rendered.

Nine test functions are added and five are modified; none are removed. No shared fixtures or helpers change. Added and modified local helpers are assessed with their parent cases above.

Existing tests cover generic walker cancellation, deadline return, complete draining, raised probes, and picker deduplication. Existing assertions are retained. The concrete gaps are discovery-result-to-footer propagation, the remaining priority tiers, and recovery-hint visibility at standard terminal width. Unit/component coverage is sufficient for scheduling and callbacks; terminal rendering is the distinct UI boundary. A live workspace E2E is not necessary for those assertions.

For manual verification, open the picker in an 80-column terminal against a workspace where discovery times out. Confirm the complete ug mcp add --names <catalog.schema.name> hint is readable and discovered services remain selectable.

Scope

All changed files support the stated discovery and timeout-reporting outcome. No clearly unrelated changes were found.

The ordering change in src/ucode/databricks.py:3291 also affects skills discovery because the walker is shared; no resulting regression was identified.

Context came from the trusted default-branch checkout, which differs from the supplied base/head revisions. Target changes were assessed exclusively from the checksum-verified frozen diff.


Automated review by Polly · workflow run

Co-authored-by: Isaac <no-reply@databricks.com>
@nachill-databricks

Copy link
Copy Markdown
Contributor Author

/ug-review

Comment thread src/ucode/databricks.py
Comment on lines +3305 to +3306
if not drained and on_incomplete is not None:
on_incomplete(time.monotonic() > deadline)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · low
can we key this off cancel_event.is_set() instead of re-reading the clock? if the user cancels and the deadline passes before this line runs, the cancel gets reported as a timeout.

Suggestion:

Suggested change
if not drained and on_incomplete is not None:
on_incomplete(time.monotonic() > deadline)
if not drained and on_incomplete is not None:
on_incomplete(not cancel_event.is_set())

Comment thread tests/test_databricks.py

assert not walk.timed_out

def test_fully_drained_walk_is_not_flagged_even_if_deadline_passes_after(self, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · low
is this test necessary? the stub never calls on_incomplete, so it passes whether or not the real walk re-checks the clock. same goes for the sleep loop in test_flags_partial_results_past_deadline. can we drop them or use the real walk?

@github-actions

Copy link
Copy Markdown

Polly AI Review

Blocking issues

None identified in the frozen diff.

Security vulnerabilities

None identified. Token validation remains ahead of timeout notification; no new credential handling, network destinations, or configuration writes are introduced.

Non-blocking notes

  • src/ucode/databricks.py:3280: can we call on_incomplete(False) when cancellation stops schema discovery before any schema is collected? The new callback contract promises this, but that branch returns silently.
  • tests/test_databricks.py:1791: can we exercise catalog/schema deadlines through the real walker? test_timeout_before_any_probe_sets_timed_out_with_error supplies the notification instead of verifying it.
  • tests/test_databricks.py:1819: can we coordinate the fast probe explicitly? test_real_walk_flags_timeout_when_probe_blocks_past_deadline can fail if listing consumes its 0.3-second budget.
  • Consolidate test_flags_partial_results_past_deadline and test_cancel_is_incomplete_but_not_a_timeout into the real-walk cases, retaining partial-name and error assertions.
  • tests/test_mcp.py:1121: can we fold test_picker_includes_user_mcp_service_alongside_system_ai into the existing streaming case? Generic duplicate merging already has coverage.

Approach

The approach follows existing patterns: structured walk results carry timeout metadata, and the loader returns a footer message through the existing picker interface.

Prioritization starts after catalog/schema enumeration, so it cannot guarantee discovery of main.default when enumeration itself exhausts the budget.

Summary

Diff size (computed): 4 files; +317 / -37 lines (354 changed text lines); 0 binary files.

Category Files Added Deleted Share of changed text lines
Tests and test support 2 221 13 66.1%
Documentation 0 0 0 0.0%
Dependencies and lockfiles 0 0 0 0.0%
Implementation / other 2 96 24 33.9%

Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements.

Changes

The implementation prioritizes schema probes, preserves partial service results, distinguishes timeouts from cancellation, and supplies an actionable picker warning. The remaining changes adapt existing tests and add ordering, timeout, cancellation, and loader coverage. No documentation, dependency, or generated-file changes appear.

The implementation size is reasonable. The concrete reduction opportunity is overlapping test setup, assessed below.

Tests

Test-by-test assessment

Static assessment only; tests and lint were not run. The reported passing results remain author-provided evidence. The frozen base/head commits were unavailable locally, so surrounding context was checked against the trusted default-branch checkout rather than the exact target tree.

Databricks cases belong to TestListAllMcpServices; MCP cases belong to TestConfigureMcpCommand.

Test / case Behavior protected Layer Needed? Action / rationale
tests/test_databricks.py::test_aggregates_services_across_catalogs_and_schemas Aggregation, deduplication, successful result metadata Component keep Adapts the return shape while retaining existing assertions.
tests/test_databricks.py::test_reports_progress_per_schema Progress callbacks and returned names Component keep Preserves distinct progress coverage during return-shape migration.
tests/test_databricks.py::test_skips_internal_catalogs Internal-catalog filtering and its reason Component keep Retains existing filtering assertions.
tests/test_databricks.py::test_returns_reason_when_no_catalogs Empty catalog response Component keep Protects a different boundary from filtering all catalogs.
tests/test_databricks.py::test_probes_main_default_first Preferred first probe Component keep Exercises actual ordering with one worker; directly protects the reported regression.
tests/test_databricks.py::test_flags_partial_results_past_deadline Timeout metadata preserves partial names Unit, stubbed walker consolidate The real blocked-probe case covers the same result fields and additionally verifies detection.
tests/test_databricks.py::test_timeout_before_any_probe_sets_timed_out_with_error Early timeout retains both flag and error Unit, stubbed walker keep Distinct mapping assertion; real catalog/schema deadline notification remains untested.
tests/test_databricks.py::test_cancel_is_incomplete_but_not_a_timeout Cancellation preserves partial names without a timeout Unit, stubbed walker consolidate Move its names/error assertions into the real cancellation case before removing it.
tests/test_databricks.py::test_real_walk_flags_timeout_when_probe_blocks_past_deadline Collector deadline detection and partial-result propagation Component/concurrency keep Covers the actual timeout path; coordinate progress to avoid dependence on a short scheduling window.
tests/test_databricks.py::test_real_walk_cancel_is_not_a_timeout Actual cancellation is not reported as timeout Component/concurrency keep Exercises the collector boundary rather than supplying its notification.
tests/test_databricks.py::test_fully_drained_walk_is_not_flagged_even_if_deadline_passes_after Completion is not retrospectively classified as timeout Unit, stubbed walker keep Protects a distinct boundary that successful-walk assertions do not establish.
tests/test_mcp.py::test_workspace_wide_walk_streams_services_into_picker Background discoveries stream into picker choices Component keep The fake’s added callback parameter preserves existing streaming coverage.
tests/test_mcp.py::test_picker_includes_user_mcp_service_alongside_system_ai User-service choice construction and duplicate merging Component/helper composition consolidate Extend the existing streaming case; tests/test_interactive_picker.py::test_merge_new_choices_dedupes_by_value already covers generic merging.
tests/test_mcp.py::test_walk_timeout_keeps_system_ai_and_warns Partial discoveries and timeout metadata produce the fallback message Component keep Meaningful cross-module propagation coverage. Its unchanged local shown list does not independently establish displayed-choice retention.
tests/test_mcp.py::test_walk_error_degrades_to_system_ai_only Non-timeout errors produce neither additions nor a timeout message Component keep Covers a distinct failure branch, although it does not exercise a displayed picker.
tests/test_mcp.py — added McpServicesWalk import and local test doubles Construction and simulation of discovery results Test support keep Supports the assessed cases; no shared fixture/helper changes or removed test functions were found.

Existing picker message handling provides the rendering contract; a new end-to-end test is not necessary for the loader-return assertion. The concrete missing coverage is real early-deadline notification and pre-probe cancellation.

For verification in a trusted test environment, run uv run pytest -q tests/test_databricks.py tests/test_mcp.py. Manually leave the configure picker open through a deadline: streamed choices should remain, the timeout fallback should appear, and closing early should not report a timeout.

Scope

No clearly unrelated changes were found. The priority sort lives in the shared catalog walker, so skills discovery also receives the new probe order; no separate skills behavior change was identified. The implementation and test changes otherwise support the stated discovery and partial-results outcome.


Automated review by Polly · workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants