Repository navigation
Log AitoolsMcpEvent from aitools mcp and the serve proxy - #7554
Draft
simonfaltum wants to merge 22 commits into
Draft
simonfaltum wants to merge 22 commits into
simonfaltum wants to merge 22 commits into
Conversation
Contributor
|
Commit: Regression test reportSelected 20 changed tests (limit=20, 0 not selected) 20 tests: regression=20 unreleased=0 coverage=0 failing=0
TestAccept/cmd/aitools/mcp/add-agent-not-installed: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-default-config: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-remove-agent-clis: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-text: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): 16 more failure details omitted, see the full report in the run. |
Collaborator
✅ Integration test reportCommit: f20df6b
Top 3 slowest tests (at least 2 minutes):
|
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 12, 2026 14:44
2dd54b7 to
a1fd867
Compare
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 12, 2026 14:47
62533cc to
a1d0d64
Compare
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 12, 2026 17:15
a1fd867 to
b90afff
Compare
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 12, 2026 17:16
a1d0d64 to
55e2a1d
Compare
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 13, 2026 10:45
b90afff to
0aa2ee4
Compare
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 13, 2026 11:06
55e2a1d to
a603d10
Compare
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 13, 2026 12:28
0aa2ee4 to
2dbdfe3
Compare
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 13, 2026 12:28
a603d10 to
1391f64
Compare
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 13, 2026 13:28
1fff1da to
e9bad5b
Compare
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 13, 2026 14:27
1391f64 to
c3e93cc
Compare
simonfaltum
force-pushed
the
aitools-mcp/09-pickers
branch
from
November 13, 2026 15:06
b30caa0 to
43a64fd
Compare
The MCP commands and the proxy now buffer an AitoolsMcpEvent for the telemetry upload at exit: one result per (service, agent) for add and remove, one per service for login and logout, and PROXY_STARTED and SIGN_IN_PROMPTED from serve. Events carry enums and counts only; no host, profile, workspace ID, custom service or schema name, path or error text. The event mirrors the lumberjack schema for aitools MCP, which is not merged yet. The enum values for the MCP error categories are added next to the install ones, and the commands use them in place of local constants. Profile, sign-in and list failures that had no typed category now report NO_PROFILE, PROFILE_REQUIRED, MCP_PERMISSION_DENIED, MCP_LOCATION_NOT_FOUND and MCP_NAME_CONFLICT. The fake /telemetry-ext now reports the batch size, as the server does. Before, a batch of two or more events was resent by the CLI's retry. Co-authored-by: Isaac <no-reply@databricks.com>
mcp add now refuses an agent named with --agents whose config directory is missing. These cases add for claude-code (and codex in mcp-add) in a fresh HOME, so they create the directories first. The telemetry events do not change. Co-authored-by: Isaac <no-reply@databricks.com>
A sign-in that fails before its URL is printed, such as a read of the workspace ID, prompted nobody, so it no longer logs SIGN_IN_PROMPTED. The serve command sets the proxy's recorder where it builds the challenge, so the challenge is never handed over without one. Co-authored-by: Isaac <no-reply@databricks.com>
The MCP sign-in commands set their config for the telemetry upload, which also turns on root's auth enrichment. An AUTH_FAILED error already names the login command for its profile, so enrichment now leaves such an error as it is, and the user gets one set of next steps. Co-authored-by: Isaac <no-reply@databricks.com>
remove resolved the profile before it touched any file, so an offline run could wait on the network first, even with telemetry disabled. The edit now runs first; the upload's profile is resolved afterwards, with a three second budget, and only when telemetry is on. Co-authored-by: Isaac <no-reply@databricks.com>
PROXY_STARTED was logged before the startup checks, so a start the lookup rejected uploaded as a clean start. It is now logged once the checks have run, as AUTH_FAILED when they fail. A binding that fails AUTH_FAILED uploads with its profile, whose host the binding has already checked. A profile whose host changed still uploads nothing, since the binding never contacts a host the record does not name. A rejected refresh token clears the upload config, so the exit upload does not ask the token endpoint again. Co-authored-by: Isaac <no-reply@databricks.com>
Login and logout log nothing when no server was reached, since their upload has no config. A sign-in state that was never learned is left unset rather than PENDING. A remove that only drops records logs its REMOVE, since the state changes. add --login logs SIGN_IN UNCHANGED when the credential was already active and the question was skipped. The bound profile count keys profiles by config file as well as name, as list does. Co-authored-by: Isaac <no-reply@databricks.com>
mcpServiceType parsed the system.ai schema name itself and repeated the table's leaves. It now uses the shared schema constant and the known table, so an unknown system.ai leaf is OTHER_SYSTEM and a service outside system.ai is CUSTOM. A test checks that every known leaf has its own enum. Co-authored-by: Isaac <no-reply@databricks.com>
The four telemetry scripts share one mcp_events helper that filters the uploads with print_requests.py. Their API posts carry MSYS_NO_PATHCONV so Windows keeps the path, the required failures use musterr, the invalid Codex config is a committed input, and the CLI calls are traced. The fake /telemetry-ext reports an unreadable batch as an error, as its neighbors do. Co-authored-by: Isaac <no-reply@databricks.com>
The server result's doc now names the categories a proxy start and a SIGN_IN_PROMPTED carry. The user-content test uses slices and maps from the standard library, and its comment no longer claims a host check the test does not make. Co-authored-by: Isaac <no-reply@databricks.com>
simonfaltum
force-pushed
the
aitools-mcp/10-telemetry
branch
from
November 13, 2026 15:12
f6918d2 to
48880f0
Compare
The config of a telemetry upload that the command does not otherwise use never refreshes its token: the command may exit before a refresh finishes, and a rotated single-use refresh token would be lost. serve's session keeps its refreshing config, and its upload gets a config of its own. Co-authored-by: Isaac <no-reply@databricks.com>
remove writes its output first, then resolves the auth of its upload, only when a server was touched. The upload is skipped when a server recorded for its profile no longer matches the profile's host, workspace or config file, so the token is not sent to a host the server was not set up against. The auth resolution is the one install uses, logged at debug level and bounded by the same budget. Co-authored-by: Isaac <no-reply@databricks.com>
The three commands no longer set their profile's config for the upload themselves. withTelemetryAuth resolves it in the background, as install does, and the run waits for it once it has logged an event. The events upload with the auth root resolves, so root's auth enrichment still applies to their errors; the MCP login hint stays the only set of next steps. Co-authored-by: Isaac <no-reply@databricks.com>
A start that fails its checks has no upload to make: a binding that failed has no profile the upload may authenticate with, and a rejected credential would only repeat its rejected request. serve logs its start once the checks have passed, and an event that names a rejected credential is not logged. Co-authored-by: Isaac <no-reply@databricks.com>
… docs An add whose sign-in failed before reading a state reports PENDING. A record-only removal that fails to save is reported FAILED. The service enum is one lookup that falls back to OTHER_SYSTEM. The server result doc says which outcomes carry an error category. Test comments name their test. Co-authored-by: Isaac <no-reply@databricks.com>
The upload authenticates with a config a command sets once its binding checks have passed, in place of the one cmdctx.ConfigUsed holds, and a run can refuse its upload after a rejected credential. Commands that bind a profile use this instead of resolving the profile's auth in the background. Co-authored-by: Isaac <no-reply@databricks.com>
add, login, logout, remove and serve no longer resolve the upload's auth in the background, as install does. Each one sets the config of the profile it bound once its binding checks have passed, and an upload never refreshes a token. remove sets it only when the removed servers share one profile and none of the servers recorded for it has drifted. serve sets it at exit, after its refresh guard has run, and a rejected credential refuses the upload. Errors of these commands are no longer enriched by the root command, since their upload no longer sets the command's config. The auth error hint that skipped that enrichment, and cmdctx.ClearConfigUsed, are removed. A removal that prunes an entry is reported CHANGED, and a failed state save reports it FAILED. Co-authored-by: Isaac <no-reply@databricks.com>
…usal and removal outcomes An authenticate call that waits on the page an earlier cancelled call showed records its outcome as a prompt too, so a sign-in that completes there is ACTIVE rather than PENDING. The proto mirror says a retry reports its own outcome. Tests cover the upload refusal after a rejected credential, a pruned entry reported CHANGED (FAILED when the state is not saved), and a failed state read after another event. Co-authored-by: Isaac <no-reply@databricks.com>
…umented enum mirrors signInEventOf is the one SIGN_IN event builder, used by add --login and login. A misplaced test doc comment moves to its test, and remove's doc says the edit needs no network. The rejected-start case of the telemetry acceptance tests is replaced by a unit test that a rejected startup read logs nothing. KnownLeaves has its own test, and the enum values that no code names have comments that they mirror the schema. Co-authored-by: Isaac <no-reply@databricks.com>
A 401 that does not ask for a sign-in is answered with the auth failure, but the run's exit-time upload still authenticated with the credential the workspace had just rejected. The proxy now reports that answer to the command, which refuses the upload as a refresh failure does. Co-authored-by: Isaac <no-reply@databricks.com>
… output The SDK logs a failed host metadata lookup as a warning through its global logger, and the upload's resolution runs on a background context that reaches it. A command that succeeded then printed a warning that only its telemetry upload caused. The upload's resolver now logs the failure at debug and falls back to the user config, as the SDK does. Co-authored-by: Isaac <no-reply@databricks.com>
…MCP helpers boundProfileCount now groups servers through the same helper mcp list uses, so the count matches the listing in every case, including a config file that does not resolve. KnownLeaves is marked as kept for its tests, the sign-in constructors return their command directly, the pruned-install test setup is a named helper, and the enum comments say that the schema mirrors are not sent by the CLI. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is part of the stack that adds the hidden
databricks aitools mcpcommand group, on top of #7552. It adds typedAitoolsMcpEventtelemetry for the management commands and forserve's start and sign-in prompts. The telemetry schema is not merged yet, so this pull request stays a draft.Changes
AitoolsMcpEvent, its server result and their enums inlibs/telemetry/protos. The MCP error categories joinAitoolsErrorCategory; their JSON strings are unchanged.addlogsADDandSIGN_IN;loginandlogoutlogSIGN_INandSIGN_OUT;removelogsREMOVEwhen it touched a server;servelogsPROXY_STARTEDandSIGN_IN_PROMPTED.libs/telemetrygets an upload slot (SetUploadConfig,RefuseUpload,UploadConfig).installis unchanged.system.aiisCUSTOM, and its name is not sent.Why
The MCP commands and the proxy have no telemetry, so their use cannot be measured. Background auth resolution, as
installuses, could send a refreshed token or another profile's credential, or upload under a profile the command did not bind.Decisions to review
PROFILE_NOT_FOUNDandPROFILE_HOST_CHANGEDare never sent, since the token must not reach a host the record does not name, andAUTH_FAILEDwould repeat the rejected request. These failures are undercounted.removemay wait for the upload after printing its output.serveloses itsPROXY_STARTED. The enum names and JSON keys must match the telemetry schema change.Tests
aitools_mcp_test.gopins the JSON keys.mcp_telemetry_test.gocovers each service, outcome, profile count and rejected credentials. The touched packages pass with-race.TestMcpRemoveUploadIgnoresEnvironmentTokenchecks that an upload never uses another workspace's token.TestMcpRemoveUploadSkipsDriftedProfilechecks the drift guard, andTestBoundUploadConfigNeverRefreshesthe refresh rule.TestUnauthorizedRecordsRejectedCredentialcovers a 401 from the service, andTestSetUploadConfigLogsNoWarningForFailedHostMetadatathe metadata warning.TestUploadRefusedSendsNothingcovers the upload slot.acceptance/cmd/aitools/telemetry/mcp-add,mcp-remove,mcp-sign-inandmcp-serveprint the events each command uploaded.Not tested: the command-funnel events, which come with the funnel pull request, and a live workspace.
This pull request and its description were written by Isaac.