Skip to content

Add aitools mcp serve, the stdio proxy for managed MCP servers - #7550

Merged
simonfaltum merged 1 commit into
mainfrom
aitools-mcp/06b-serve
Nov 19, 2026
Merged

simonfaltum merged 1 commit into
mainfrom
aitools-mcp/06b-serve

Conversation

@simonfaltum

@simonfaltum simonfaltum commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

This pull request is part of a stack that adds the hidden databricks aitools mcp command group. It builds on #7540 and adds aitools mcp serve, the stdio command that each installed MCP entry runs.

Changes

  • aitools mcp serve --profile <p> --service <full name> [--agent <name>], hidden. It runs the binding checks, then bridges stdin and stdout to the service endpoint with the profile's credentials.
  • Stdout carries only JSON-RPC, so --output and a log file on stdout are refused. Binding failures exit 2, except a token failure at startup that is not a rejection, such as a network error or a 5xx. That one says the failure is temporary, gives no login hint, and exits 1. mcp add still exits 1 on a binding failure.
  • A profile with no usable credential at startup, such as one with a host, no auth_type and no cached token, gets the login hint and exits 2, as a rejected token does.
  • Login hints name the config file of a pinned profile through DATABRICKS_CONFIG_FILE, with forward slashes at startup as at runtime. mcp.AuthenticateBound takes that file, so the bind checks the same file the hint names.
  • A rejected token fails that request with the login hint, and serve stops with exit 2. A transient token failure (a network error, a timeout, a 5xx from the token endpoint) fails only that request, with no login hint, and serve keeps running.
  • Each token fetch first checks that the profile still names the bound host and workspace, in the config file it was bound to. A profile re-pointed during the session, for example by databricks auth login --profile P --host B, fails that request before any token is fetched, with the binding error. A changed binding is checked again 50 ms later before the request fails, since a write that replaces .databrickscfg can hide the profile for a moment. Serve then stops the same way as after a rejected token: later requests fail at once, and it exits 2.
  • A server with no install record has no remove to suggest. Its per-token check holds the profile to the host and workspace serve bound to at start. A missing profile gets the startup setup message, and a host change says to restart the server, which binds the current host.
  • cmd/root: Execute closes the log file and restores the default logger on return, also after a panic.

Why

Each entry that mcp add writes runs aitools mcp serve. It binds to one profile before it reads stdin, so a profile that points elsewhere at start fails with a message instead of sending a token to another host. The token cache is keyed by profile name and records no host, so the binding is checked again before each token fetch, not only at start.

Decisions to review

  • Only a rejected token or a changed binding stops the proxy: a 400 or 401 from the token endpoint with invalid_grant or invalid_client, or the CLI's U2M client reporting an invalid refresh token. Everything else fails only its request, including anything the check cannot classify. The reason is a laptop that wakes before the network is back: stopping there leaves the agent with a dead server until the entry restarts. Cost: an unclassified error keeps failing requests instead of stopping serve.
  • A changed binding is checked twice, 50 ms apart, before serve stops. Cost: a real re-point stops serve 50 ms later.
  • A log file that is also stderr is allowed, so --log-file stdout works on a Unix terminal. Windows refuses it, because a console is not a regular file there.

Tests

  • cmd/aitools: a rejected token stops the proxy with exit 2, the hint, and no later token request. A transient failure fails only its request, and the next request succeeds. TestCredentialRejected checks each error shape.
  • TestRefreshGuardStopsOnBindingChange and TestServeProxyRepointedProfileSendsNoToken check that a re-pointed profile fails before any token fetch and stops serve. TestCheckBindingWithRetry covers the second check.
  • TestServeBindFailureTokenStatus covers the startup exit codes, including a missing credential, which exits 2 with the hint. TestServeBindHostOnlyProfileNeedsLogin runs the real credential chain on such a profile.
  • TestBindingCheckWithoutRecordChecksStartHost and TestCheckUnrecordedBindingWordsChangesWithoutRecord cover the messages for a server with no install record.
  • cmd/root: the stdout refusal, and logger restore after a panic and a normal return.
  • Acceptance serve-passthrough checks each stdout line is one JSON-RPC message; serve-binding-errors checks exit 2 and the stderr text.
  • go test ./cmd/aitools/ ./libs/aitools/mcp/... and the TestAccept/cmd/aitools/mcp/serve acceptance tests pass.
  • Not tested: a real token refresh end to end, because the fake cannot fail one. Windows: only go vet and a test build ran, so the console behavior is from reading the code.

How to review

Refactors that keep behavior: serve takes add's flag names from mcpconfig, and its tests and helpers were reshaped in cmd/aitools/mcp_serve_test.go and libs/testserver. Read closely: cmd/root/root.go and cmd/root/stdout_protocol*.go for the stdout refusal, libs/aitools/mcp/proxy/bridge.go and run.go for the token failure paths, and bindingCheck, checkBindingWithRetry, and the exit status in cmd/aitools/mcp_serve.go.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Commit: ad9ad88ab | Workflow run

Regression test report

Selected 2 changed tests (limit=20, 0 not selected)

2 tests: regression=2 unreleased=0 coverage=0 failing=0
test branch main (65f3314) latest (v1.27.0)
TestAccept/cmd/aitools/mcp/serve-binding-errors ✅ ❌ ❌
TestAccept/cmd/aitools/mcp/serve-passthrough ✅ ❌ ❌
TestAccept/cmd/aitools/mcp/serve-binding-errors: branch ✅ | main (65f3314) ❌ | latest (v1.27.0) ❌

main (65f3314):

acceptance_test.go:1388: Diff:
        --- cmd/aitools/mcp/serve-binding-errors/output.txt
        +++ /tmp/TestAcceptcmdaitoolsmcpserve-binding-errors240762939/002/output.txt
        @@ -2,40 +2,160 @@
         === The bound profile is not in the config file
         
         >>> errcode [CLI] aitools mcp serve --profile gone --service system.ai.genie_one_mcp
        -Error: MCP server system.ai.genie_one_mcp needs Databricks profile "gone", which does not exist in [TEST_TMP_DIR]/.databrickscfg. Set it up with: databricks auth login --profile gone
        +Error: unknown flag: --service
         
        -Exit code: 2
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
        +Exit code: 1
         stdout bytes: 0
         
         === The profile now points at another host than the one recorded
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp
        -Error: MCP server genie_one_mcp-logfood was set up for https://other.test, but profile "logfood" now points at [DATABRICKS_URL]. Run: databricks aitools mcp remove --names genie_one_mcp-logfood and add it again
        +Error: unknown flag: --service
         
        -Exit code: 2
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
        +Exit code: 1
         stdout bytes: 0
         
         === Flags are required and validated before the binding checks
         
         >>> errcode [CLI] aitools mcp serve --service system.ai.genie_one_mcp
        -Error: --profile is required
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service github
        -Error: --service needs a full service name such as system.ai.github
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --output json
        -Error: --output does not apply to serve: its stdout carries the MCP protocol
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         === A log file on stdout is refused before anything is logged
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --log-file stdout --log-level debug
        -Error: databricks aitools mcp serve writes protocol messages to stdout, so its logs cannot go to stdout; use --log-file stderr or a file
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools mcp [command]
        +
        +Available Commands:
        +  add         Install Databricks managed MCP servers into coding agents
        +  list        List Databricks managed MCP servers installed by this CLI
        +  remove      Remove Databricks managed MCP servers from coding agents
        +
        +Flags:
        +  -h, --help[=true|false]   help for mcp
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools mcp [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         stdout bytes: 0
        
    acceptance_test.go:1166: LOG.stdout: 
FAIL

latest (v1.27.0):

acceptance_test.go:1388: Diff:
        --- cmd/aitools/mcp/serve-binding-errors/output.txt
        +++ /tmp/TestAcceptcmdaitoolsmcpserve-binding-errors2394514802/002/output.txt
        @@ -2,40 +2,178 @@
         === The bound profile is not in the config file
         
         >>> errcode [CLI] aitools mcp serve --profile gone --service system.ai.genie_one_mcp
        -Error: MCP server system.ai.genie_one_mcp needs Databricks profile "gone", which does not exist in [TEST_TMP_DIR]/.databrickscfg. Set it up with: databricks auth login --profile gone
        +Error: unknown flag: --service
         
        -Exit code: 2
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
        +Exit code: 1
         stdout bytes: 0
         
         === The profile now points at another host than the one recorded
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp
        -Error: MCP server genie_one_mcp-logfood was set up for https://other.test, but profile "logfood" now points at [DATABRICKS_URL]. Run: databricks aitools mcp remove --names genie_one_mcp-logfood and add it again
        +Error: unknown flag: --service
         
        -Exit code: 2
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
        +Exit code: 1
         stdout bytes: 0
         
         === Flags are required and validated before the binding checks
         
         >>> errcode [CLI] aitools mcp serve --service system.ai.genie_one_mcp
        -Error: --profile is required
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service github
        -Error: --service needs a full service name such as system.ai.github
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --output json
        -Error: --output does not apply to serve: its stdout carries the MCP protocol
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         
         === A log file on stdout is refused before anything is logged
         
         >>> errcode [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --log-file stdout --log-level debug
        -Error: databricks aitools mcp serve writes protocol messages to stdout, so its logs cannot go to stdout; use --log-file stderr or a file
        +Error: unknown flag: --service
         
        +Usage:
        +  databricks aitools [command]
        +
        +Available Commands:
        +  auto-install Turn the automatic installation of Databricks AI tools on or off
        +  install      Install Databricks skills and plugins for coding agents
        +  list         List installed skills and plugins
        +  uninstall    Uninstall Databricks skills and plugins
        +  update       Update installed skills and plugins
        +  version      Show installed skills and plugins version
        +
        +Flags:
        +  -h, --help[=true|false]   help for aitools
        +
        +Global Flags:
        +      --debug[=true|false]   enable debug logging
        +  -o, --output type          output type: text or json (default text)
        +  -p, --profile string       ~/.databrickscfg profile
        +  -t, --target string        bundle target to use (if applicable)
        +
        +Use "databricks aitools [command] --help" for more information about a command.
        +
        +
         Exit code: 1
         stdout bytes: 0
        
    acceptance_test.go:1166: LOG.stdout: 
FAIL
TestAccept/cmd/aitools/mcp/serve-passthrough: branch ✅ | main (65f3314) ❌ | latest (v1.27.0) ❌

main (65f3314):

acceptance_test.go:1388: Diff:
        --- cmd/aitools/mcp/serve-passthrough/output.txt
        +++ /tmp/TestAcceptcmdaitoolsmcpserve-passthrough1296601234/002/output.txt
        @@ -1,32 +1,4 @@
         
         === Stdout holds one JSON-RPC message per line; the notification gets no reply
        -{"id":1,"instructions":"Fake Databricks MCP service for tests.\n\nThis server is bound to Databricks workspace [DATABRICKS_URL] (CLI profile \"logfood\"). Its tools act on that workspace only.","tools":[],"text":null,"error":null}
        -{"id":2,"instructions":null,"tools":["echo"],"text":null,"error":null}
        -{"id":3,"instructions":null,"tools":[],"text":"hello","error":null}
         
        -=== Diagnostics go to stderr only
        -
        ->>> cat LOG.stderr
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -
        -=== An agent this binary does not know is accepted
        -{"id":1,"instructions":"Fake Databricks MCP service for tests.\n\nThis server is bound to Databricks workspace [DATABRICKS_URL] (CLI profile \"logfood\"). Its tools act on that workspace only.","tools":[],"text":null,"error":null}
        -{"id":2,"instructions":null,"tools":["echo"],"text":null,"error":null}
        -{"id":3,"instructions":null,"tools":[],"text":"hello","error":null}
        -
        ->>> cat LOG.future
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent future-agent
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -unknown agent "future-agent"; it is left out of the User-Agent
        -
        -=== Debug level logs one line per upstream request
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code --log-file LOG.debug --log-level debug
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -upstream request http_method=POST rpc_method=initialize rpc_id=1 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=notifications/initialized rpc_id= status=202 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=tools/call rpc_id=3 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=tools/list rpc_id=2 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        +Exit code: 1
        
    acceptance_test.go:1166: 
        LOG.create-genie_one_mcp-logfood: {
        LOG.create-genie_one_mcp-logfood:   "comment": "Ask questions about your data",
        LOG.create-genie_one_mcp-logfood:   "create_time": "2026-11-19T14:36:05.781238520Z",
        LOG.create-genie_one_mcp-logfood:   "created_by": "tester@databricks.com",
        LOG.create-genie_one_mcp-logfood:   "effective_owner": "tester@databricks.com",
        LOG.create-genie_one_mcp-logfood:   "metastore_id": "7a0e77e9-33cb-ce70-7a0e-77e933cbcf76",
        LOG.create-genie_one_mcp-logfood:   "name": "mcp-services/system.ai.genie_one_mcp",
        LOG.create-genie_one_mcp-logfood:   "updated_by": "tester@databricks.com"
        LOG.create-genie_one_mcp-logfood: }
    acceptance_test.go:1166: 
        LOG.stderr: 
        LOG.stderr: >>> /tmp/TestAccept1390054672/001/databricks aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code
        LOG.stderr: Error: unknown flag: --service
        LOG.stderr: 
        LOG.stderr: Usage:
        LOG.stderr:   databricks aitools mcp [command]
        LOG.stderr: 
        LOG.stderr: Available Commands:
        LOG.stderr:   add         Install Databricks managed MCP servers into coding agents
        LOG.stderr:   list        List Databricks managed MCP servers installed by this CLI
        LOG.stderr:   remove      Remove Databricks managed MCP servers from coding agents
        LOG.stderr: 
        LOG.stderr: Flags:
        LOG.stderr:   -h, --help[=true|false]   help for mcp
        LOG.stderr: 
        LOG.stderr: Global Flags:
        LOG.stderr:       --debug[=true|false]   enable debug logging
        LOG.stderr:   -o, --output type          output type: text or json (default text)
        LOG.stderr:   -p, --profile string       ~/.databrickscfg profile
        LOG.stderr:   -t, --target string        bundle target to use (if applicable)
        LOG.stderr: 
        LOG.stderr: Use "databricks aitools mcp [command] --help" for more information about a command.

latest (v1.27.0):

acceptance_test.go:1388: Diff:
        --- cmd/aitools/mcp/serve-passthrough/output.txt
        +++ /tmp/TestAcceptcmdaitoolsmcpserve-passthrough3398714511/002/output.txt
        @@ -1,32 +1,4 @@
         
         === Stdout holds one JSON-RPC message per line; the notification gets no reply
        -{"id":1,"instructions":"Fake Databricks MCP service for tests.\n\nThis server is bound to Databricks workspace [DATABRICKS_URL] (CLI profile \"logfood\"). Its tools act on that workspace only.","tools":[],"text":null,"error":null}
        -{"id":2,"instructions":null,"tools":["echo"],"text":null,"error":null}
        -{"id":3,"instructions":null,"tools":[],"text":"hello","error":null}
         
        -=== Diagnostics go to stderr only
        -
        ->>> cat LOG.stderr
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -
        -=== An agent this binary does not know is accepted
        -{"id":1,"instructions":"Fake Databricks MCP service for tests.\n\nThis server is bound to Databricks workspace [DATABRICKS_URL] (CLI profile \"logfood\"). Its tools act on that workspace only.","tools":[],"text":null,"error":null}
        -{"id":2,"instructions":null,"tools":["echo"],"text":null,"error":null}
        -{"id":3,"instructions":null,"tools":[],"text":"hello","error":null}
        -
        ->>> cat LOG.future
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent future-agent
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -unknown agent "future-agent"; it is left out of the User-Agent
        -
        -=== Debug level logs one line per upstream request
        -
        ->>> [CLI] aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code --log-file LOG.debug --log-level debug
        -No install record for system.ai.genie_one_mcp on profile "logfood"; using its current host [DATABRICKS_URL]
        -upstream request http_method=POST rpc_method=initialize rpc_id=1 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=notifications/initialized rpc_id= status=202 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=tools/call rpc_id=3 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        -upstream request http_method=POST rpc_method=tools/list rpc_id=2 status=200 duration=DUR session_sent=false session_received=false session_replaced=false
        +Exit code: 1
        
    acceptance_test.go:1166: 
        LOG.create-genie_one_mcp-logfood: {
        LOG.create-genie_one_mcp-logfood:   "comment": "Ask questions about your data",
        LOG.create-genie_one_mcp-logfood:   "create_time": "2026-11-19T14:36:08.395607715Z",
        LOG.create-genie_one_mcp-logfood:   "created_by": "tester@databricks.com",
        LOG.create-genie_one_mcp-logfood:   "effective_owner": "tester@databricks.com",
        LOG.create-genie_one_mcp-logfood:   "metastore_id": "7a0e77e9-cf9f-ea88-7a0e-77e9cf9febb4",
        LOG.create-genie_one_mcp-logfood:   "name": "mcp-services/system.ai.genie_one_mcp",
        LOG.create-genie_one_mcp-logfood:   "updated_by": "tester@databricks.com"
        LOG.create-genie_one_mcp-logfood: }
    acceptance_test.go:1166: 
        LOG.stderr: 
        LOG.stderr: >>> /home/runner/work/cli/cli/acceptance/build/linux_amd64/1.27.0/databricks aitools mcp serve --profile logfood --service system.ai.genie_one_mcp --agent claude-code
        LOG.stderr: Error: unknown flag: --service
        LOG.stderr: 
        LOG.stderr: Usage:
        LOG.stderr:   databricks aitools [command]
        LOG.stderr: 
        LOG.stderr: Available Commands:
        LOG.stderr:   auto-install Turn the automatic installation of Databricks AI tools on or off
        LOG.stderr:   install      Install Databricks skills and plugins for coding agents
        LOG.stderr:   list         List installed skills and plugins
        LOG.stderr:   uninstall    Uninstall Databricks skills and plugins
        LOG.stderr:   update       Update installed skills and plugins
        LOG.stderr:   version      Show installed skills and plugins version
        LOG.stderr: 
        LOG.stderr: Flags:
        LOG.stderr:   -h, --help[=true|false]   help for aitools
        LOG.stderr: 
        LOG.stderr: Global Flags:
        LOG.stderr:       --debug[=true|false]   enable debug logging
        LOG.stderr:   -o, --output type          output type: text or json (default text)
        LOG.stderr:   -p, --profile string       ~/.databrickscfg profile
        LOG.stderr:   -t, --target string        bundle target to use (if applicable)
        LOG.stderr: 
        LOG.stderr: Use "databricks aitools [command] --help" for more information about a command.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: ad9ad88

Run: 44544435298

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 21 19:31
💚​ aws-windows-latest-4core-16gb 1 274 19 9:51
💚​ azure linux-2core-8gb 1 271 21 16:39
💚​ azure-windows-latest-4core-16gb 1 273 19 11:32
💚​ gcp linux-2core-8gb 1 272 21 15:31
💚​ gcp-windows-latest-4core-16gb 1 274 19 9:44
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 36 slowest tests (at least 2 minutes):
duration env testname
7:47 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
4:55 aws-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
4:46 azure-windows-latest-4core-16gb TestAccept
3:57 aws linux-2core-8gb TestExportDir
3:55 aws-windows-latest-4core-16gb TestAccept
3:50 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
3:45 gcp-windows-latest-4core-16gb TestAccept
3:38 gcp-windows-latest-4core-16gb TestSyncFullFileSync
3:35 azure linux-2core-8gb TestImportDir
3:34 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
3:31 azure-windows-latest-4core-16gb TestFilerReadWrite/workspace_files
3:20 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
3:18 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
3:13 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
3:02 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
3:02 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
2:58 gcp linux-2core-8gb TestFilerReadWrite/workspace_files
2:54 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:53 gcp linux-2core-8gb TestFilerRecursiveDelete/workspace_files
2:53 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsDelete
2:46 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsStat
2:43 azure linux-2core-8gb TestExportDir
2:41 gcp-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:37 azure linux-2core-8gb TestFilerWorkspaceNotebook/rJupyterNb.ipynb
2:35 aws linux-2core-8gb TestImportDirDoesNotOverwrite
2:33 gcp linux-2core-8gb TestFilerWorkspaceNotebook/rJupyterNb.ipynb
2:32 azure-windows-latest-4core-16gb TestSyncIncrementalFileSync
2:31 aws linux-2core-8gb TestImportDirWithOverwriteFlag
2:27 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:25 azure-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:09 azure linux-2core-8gb TestLock
2:07 azure linux-2core-8gb TestFilerReadWrite/workspace_files
2:03 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
2:02 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:01 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsDelete
2:00 aws-windows-latest-4core-16gb TestFilerReadDir/workspace_files_extensions

@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 4ecc28f to 2f43e8a Compare November 12, 2026 14:36
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from eec9d1a to 5b1d279 Compare November 12, 2026 14:37
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 2f43e8a to 3c43783 Compare November 12, 2026 17:08
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 5b1d279 to 9187003 Compare November 12, 2026 17:10
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch 2 times, most recently from 4688f64 to ed4190f Compare November 12, 2026 22:00
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 9187003 to 48fac6f Compare November 13, 2026 00:15
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 6634449 to 5c42df0 Compare November 13, 2026 15:05
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 7064bbc to 10450c9 Compare November 13, 2026 15:05
@pietern pietern added the aitools AI tools (databricks aitools) related changes label Nov 16, 2026
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 5c42df0 to ad029dd Compare November 16, 2026 12:47
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 10450c9 to 9ec98a0 Compare November 16, 2026 12:47
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from ad029dd to 851225d Compare November 16, 2026 13:19
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 9ec98a0 to 1d09e53 Compare November 16, 2026 13:19
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 851225d to fd9cdef Compare November 16, 2026 13:32
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 1d09e53 to 01b4249 Compare November 16, 2026 13:32
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from fd9cdef to 6594052 Compare November 16, 2026 14:49
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch 2 times, most recently from 11e6e00 to 2a9b99f Compare November 16, 2026 15:14
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 6594052 to 1174f67 Compare November 16, 2026 15:14
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 2a9b99f to c7d75cb Compare November 16, 2026 15:53
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch 2 times, most recently from 2eafa10 to 0ca1f43 Compare November 17, 2026 10:52
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch 2 times, most recently from 0b9a961 to e653041 Compare November 17, 2026 11:21
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from f2e0cd4 to e41d98d Compare November 17, 2026 19:58
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 3294173 to 752ff9c Compare November 17, 2026 19:58
@simonfaltum
simonfaltum marked this pull request as ready for review November 18, 2026 16:20
@simonfaltum
simonfaltum requested review from a team and lennartkats-db as code owners November 18, 2026 16:20

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me — no issues found.

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me — no issues found.

@anton-107 anton-107 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one blocking issue, posted inline: a profile with no usable credential (config.ErrCannotConfigureDefault) gets a "temporary failure, try again" message with exit 1 and no login hint. I reproduced it with this branch's binary.

Verified on c5aa08b in a separate worktree: unit tests for cmd/aitools, cmd/root, libs/aitools/mcp/... and libs/testserver pass, TestAccept/cmd/aitools/mcp passes, and golangci-lint on the changed packages reports 0 issues.

Merge danger: low, a two-way door. serve is hidden, the whole stack is unmerged, and the cmd/root additions (the StdoutCarriesProtocol annotation, ExitStatusError, the logger restore) are internal. The flags and exit codes do become a contract once a release writes entries that call serve, so settle them before the stack ships.

Non-blocking notes:

  • rebindingAuthenticate re-reads .databrickscfg on every request, while auth login and configure rewrite it in place (ini.File.SaveTo uses os.WriteFile, which truncates and then writes). A read that lands in that window sees no profile. That gives BindProfileNotFound, bindingChanged returns true, and serve stops for good with "the binding changed". The window is microseconds, but a harmless login to another profile can then kill the server. Retrying the check once before stopping would close it.
  • On the no-install-record path, bindingFor makes up an entry. A later drift or missing-profile error then says remove the server with: databricks aitools mcp remove --names system.ai.github, but there is no record to remove.
  • Bind passes the native path to LoginCommand, while the runtime hints use filepath.ToSlash. On Windows the startup and runtime hints spell the same file differently.

Comment thread cmd/aitools/mcp_serve.go Resolved
@simonfaltum

Copy link
Copy Markdown
Member Author

The non-blocking notes are in too:

  • d520822: a binding check that reads as changed runs once more after 50 ms before serve stops, so a .databrickscfg rewrite in progress no longer stops the server.
  • 255d784: without an install record, serve no longer suggests remove. A missing profile gets the same setup message as at startup, and a re-pointed host says to restart the server, which binds it to the current host.
  • 029c1be: the startup login hint names the config file with forward slashes, like the runtime hints.

@anton-107 anton-107 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 2 (c5aa08b..029c1be): the blocking finding is fixed.

I re-ran round 1's case with this head's binary in an isolated HOME. A [legacy] profile with only host = https://legacy.test and no cached token now exits 2 with Run: databricks auth login --profile legacy. At c5aa08b the same profile exited 1 with "a temporary failure ... try again". The auth_type = databricks-cli control exits 2 on both heads.

The claim that the sentinel can't come from a later request holds. ErrCannotConfigureDefault only comes from Credentials.Configure in the SDK's authenticateIfNeeded. Bind runs that on the same cfg that serve then uses for every request, and the provider it caches there is never reset. A later failure comes from the token source.

The 50 ms retry only runs after a check has already failed as a changed binding, so the normal path adds no latency. A re-point that persists still stops serve after one more read; TestServeProxyRepointedProfileSendsNoToken still passes.

go test -count=1 ./cmd/aitools/... ./libs/aitools/mcp/... and TestAccept/cmd/aitools/mcp/serve* pass locally.

@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from 986009a to f9157d1 Compare November 19, 2026 11:42
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 029c1be to 171374b Compare November 19, 2026 11:42
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06a-bridge branch from f9157d1 to 088569a Compare November 19, 2026 14:16
Base automatically changed from aitools-mcp/06a-bridge to main November 19, 2026 14:27
One commit for the restack onto main. The individual commits, up to 029c1be, are in the pull request's history.

Co-authored-by: Isaac <no-reply@databricks.com>
@simonfaltum
simonfaltum force-pushed the aitools-mcp/06b-serve branch from 171374b to ad9ad88 Compare November 19, 2026 14:29
@simonfaltum
simonfaltum added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit cb94103 Nov 19, 2026
28 checks passed
@simonfaltum
simonfaltum deleted the aitools-mcp/06b-serve branch November 19, 2026 15:08
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

❌ Integration test report

Commit: cb94103

Run: 44551534517

Env 💥​PANIC ❌​FAIL 🟨​KNOWN 🤯​MISS 💚​RECOVERED ✅​pass 🙈​skip Time
💥​ aws linux-2core-8gb 1 625 20 984 1409 320:00
💥​ aws-windows-latest-4core-16gb 1 2 694 15 834 1437 320:00
💥​ azure linux-2core-8gb 1 706 15 888 1417 320:00
💥​ azure-windows-latest-4core-16gb 1 6 559 14 946 1445 320:01
💥​ gcp linux-2core-8gb 1 579 20 1017 1415 320:00
💥​ gcp-windows-latest-4core-16gb 1 489 26 1017 1443 320:00
1226 interesting tests: 1203 MISS, 9 RECOVERED, 6 PANIC, 6 KNOWN, 2 FAIL
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🤯​ TestAccept 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cli_defaults 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/cli_defaults/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cli_defaults/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_cross_target 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_permissions 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_permissions/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_permissions/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/config_edits 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/config_edits/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/config_edits/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/dashboard_etag 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/dashboard_etag/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/dashboard_etag/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/flushed_cache 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/flushed_cache/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/flushed_cache/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/formatting_preserved 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/formatting_preserved/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/formatting_preserved/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_fields 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/job_fields/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_fields/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_multiple_tasks 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/job_multiple_tasks/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_multiple_tasks/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_params_variables 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/job_params_variables/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_params_variables/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_pipeline_task 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/job_pipeline_task/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/job_pipeline_task/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/json_status_missing_state 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/json_status_missing_state/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/json_status_missing_state/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/json_status_selectors 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/json_status_selectors/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/json_status_selectors/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/multiple_files 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/multiple_files/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/multiple_files/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/multiple_resources 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/multiple_resources/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/output_json 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/output_json/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/output_json/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/output_no_changes 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/output_no_changes/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/output_no_changes/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/pipeline_fields 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/pipeline_fields/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/pipeline_fields/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/resolve_variables 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/resolve_variables/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/resolve_variables/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/select_basic 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/select_basic/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/select_basic/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/select_multiple 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/select_multiple/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/select_multiple/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/skip_deployment 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/skip_deployment/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/skip_deployment/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/skip_permissions 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/skip_permissions/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/skip_permissions/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/target_override 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/target_override/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/target_override/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/task_rename_revert 🤯​M 🙈​s 🤯​M 🙈​s 🤯​M 🙈​s
🤯​ TestAccept/bundle/config-remote-sync/task_rename_revert/DMS= 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/config-remote-sync/task_rename_revert/DMS=true 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=true/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=true/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/basic 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/basic/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/breakglass 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/breakglass/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/can-manage 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/can-manage/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/destroy-redeploy 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/destroy-redeploy/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/dev-mode 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/dev-mode/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/legacy-state 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/legacy-state/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/missing-snapshot 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/missing-snapshot/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts/DMS=/READPLAN= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts/DMS=/READPLAN=1 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/permissions-change 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/permissions-change/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/select 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/immutable/select/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/mlops-stacks 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/mlops-stacks/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/mlops-stacks/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/spark-jar-task 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/spark-jar-task/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deploy/spark-jar-task/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/alert 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 💚​R
🤯​ TestAccept/bundle/deployment/bind/alert/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 💚​R
🤯​ TestAccept/bundle/deployment/bind/alert/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M 💚​R
🤯​ TestAccept/bundle/deployment/bind/catalog 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/catalog/DMS= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/catalog/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster 🤯​M 🤯​M 🤯​M 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster/DMS= 🤯​M 🤯​M 🤯​M 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster/DMS=true 🤯​M 🤯​M 🤯​M 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=/READPLAN= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=/READPLAN=1 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=true/READPLAN= 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=true/READPLAN=1 🤯​M 🤯​M 🤯​M 🤯​M 🤯​M ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
17:48 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
17:10 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
16:39 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
14:42 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
12:02 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
11:59 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
11:37 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
11:08 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
11:08 gcp linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
10:47 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
10:45 azure-windows-latest-4core-16gb TestAccept/bundle/resources/materialization_sets/batch/DMS=
10:35 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
10:33 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
10:21 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
10:09 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/materialization_sets/immutable/DMS=true
10:08 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:55 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:46 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
9:39 aws linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
9:34 gcp linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
9:28 aws linux-2core-8gb TestAccept/bundle/resources/experiments/basic/DMS=
9:25 gcp linux-2core-8gb TestAccept/bundle/resources/materialization_sets/immutable/DMS=true
9:19 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
9:12 gcp linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=true
9:11 azure linux-2core-8gb TestAccept/bundle/resources/materialization_sets/immutable/DMS=true
9:04 azure linux-2core-8gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
9:01 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
8:57 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
8:53 aws linux-2core-8gb TestAccept/bundle/resources/dashboards/unpublish-out-of-band/DMS=
8:52 azure linux-2core-8gb TestAccept/bundle/resources/grants/schemas/remove_principal/DMS=true
8:47 gcp linux-2core-8gb TestAccept/bundle/resources/materialization_sets/batch/DMS=true
8:47 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
8:40 aws linux-2core-8gb TestAccept/bundle/resources/materialization_sets/immutable/DMS=
8:32 aws linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=yes/PY=yes/READPLAN=1
8:28 aws linux-2core-8gb TestAccept/bundle/resources/materialization_sets/batch/DMS=
8:28 gcp linux-2core-8gb TestAccept/bundle/resources/volumes/rename_case_only/DMS=
8:22 gcp-windows-latest-4core-16gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=yes/DMS=/NBOOK=no/PY=yes/READPLAN=
8:21 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=true
8:15 gcp-windows-latest-4core-16gb TestAccept/bundle/templates/default-python/combinations/serverless/DLT=no/DMS=/NBOOK=yes/PY=no/READPLAN=1
8:09 aws linux-2core-8gb TestAccept/bundle/resources/experiments/basic/DMS=true
8:06 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
8:04 aws linux-2core-8gb TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.11
8:03 azure linux-2core-8gb TestAccept/bundle/resources/models/basic/DMS=true
8:03 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
8:02 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/materialization_sets/batch/DMS=
7:59 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=
7:53 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/materialization_sets/immutable/DMS=
7:52 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS=true
7:48 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=
7:47 aws linux-2core-8gb TestAccept/bundle/resources/materialization_sets/batch/DMS=true
(1080 table rows omitted to keep the report under 60000 bytes)

idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 20, 2026
Part of a stack that adds the hidden `databricks aitools mcp` command
group, on databricks#7550 (`aitools mcp serve`). It adds provider sign-in for
external MCP services such as GitHub, which each user signs in to before
the service's tools work.

## Changes
- `mcp login <service>` prints the sign-in URL, opens it through
`libs/browser`, and waits up to 5 minutes. Server and network errors
while polling are retried until the timeout, which names the last one.
An already signed-in caller gets "Already signed in" and no URL.
- `mcp logout <service>` deletes the caller's credential, even when its
service is no longer visible. `login` and `logout` refuse a changed
profile before any request.
- A FAILED or DEGRADED credential is deleted before the sign-in page
opens.
- Service names are refused only when they contain `/` or a control
character. Other URL syntax, such as `?`, `#` and `%`, is escaped in the
request and is allowed.
- `mcp add --login` signs in to each sign-in-required server that
reached an agent. Its JSON gains a per-server `sign_in` object, given
only to servers that reached an agent; a server that does not need
sign-in gets `NOT_REQUIRED`. A failed sign-in is reported in both
`servers[].sign_in.error` and the top-level `error`, which is intended,
so consumers can read either. The command exits 1 and keeps the
installs.
- `mcp list --check` checks each profile's token, then each server. A
drifted server or one that cannot be read is skipped, and says why. Each
check request ends after 5 seconds. A needed sign-in names the login
command.
- Hints for a server pinned to a config file set
`DATABRICKS_CONFIG_FILE`. `libs/browser` gains `OpenOutputToStderr`, and
its default opener no longer waits for a browser its launcher leaves
running.

## Why
A sign-in is judged on the attempt that runs, so a FAILED or DEGRADED
credential left by an earlier attempt is deleted before the page opens.
A failed poll does not mean the user has left the provider's page, so it
does not end the wait. One unreachable workspace held `list --check` for
the SDK's five-minute retry budget.

## Decisions to review
- `SignIn` returns `(alreadySignedIn, urlShown bool, err error)`, not a
state. The command derives the JSON state and URL from them.
- Polls retry 5xx and network errors. Cost: a longer wait while the
error persists, up to the timeout.
- Service names with `?`, `#` or `%` are accepted, rather than refused
locally. Cost: such names reach the API.
- `list --check` sets `DATABRICKS_CONFIG_FILE` in the process
environment while it checks a profile, because the token store reads the
process environment.
- `logout` sends the DELETE before it looks up the service, so a
credential for a deleted service can be removed. Cost: a mistyped name
costs one request.

## Tests
- `TestOpenDoesNotWaitForLauncherChild` in `libs/browser` failed before
the fix. `cmd/aitools`: `TestAddChecksBoundsAProfileThatNeverAnswers`
hung past five minutes before the fix.
- Polls through server errors and the timeout's last error are covered
in `libs/aitools/mcp`.
- `TestSignInDeletesDegradedCredential` covers the DEGRADED deletion.
`TestPathSafeName` and `TestServiceNameAllowsEscapedURLSyntax` cover the
name check. `TestSignInInstalledRecordsTheSignInOfEachServer` covers
`sign_in` for a server that reached no agent.
- Acceptance `list-check` and `login-flips-active` pass.
- `go test -race ./cmd/aitools/ ./libs/aitools/mcp/...` and
`GOOS=windows go vet` on the same packages pass.
- Not tested: the 5-minute timeout through the CLI (unit tests use
milliseconds), and a real provider sign-in.

## How to review
Refactors that keep behavior: the sign-in helpers shared by `login`,
`logout` and `add --login` (`libs/aitools/mcp/login.go`,
`cmd/aitools/mcp_login.go`). Read closely: the poll loop in
`libs/aitools/mcp/login.go`, the bounded checks in
`cmd/aitools/mcp_list.go`, and the default opener in
`libs/browser/browser.go`, which changes how `browser.Open` waits.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aitools AI tools (databricks aitools) related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants