fix(retrieval): order Claude MCP arguments
This commit is contained in:
1 parent
b67eb844bc
commit
79d981e78b
2 files changed
+20
-2
No files matched your search
@@ -111,10 +111,11 @@ def sync(root, home, clients, enabled, dry_run, update):
|
||||
for client in clients:
|
||||
command_args = [client, 'mcp', 'add']
|
||||
if client == 'claude':
|
||||
command_args += ['--scope', 'user', '-e', f'HF_HOME={target / "model-cache"}']
|
||||
command_args += [NAME, '--scope', 'user', '-e', f'HF_HOME={target / "model-cache"}']
|
||||
else:
|
||||
command_args += ['--env', f'HF_HOME={target / "model-cache"}']
|
||||
command_args += [NAME] + arguments
|
||||
command_args += [NAME]
|
||||
command_args += arguments
|
||||
if update and client in existing_clients:
|
||||
command(client, [client, 'mcp', 'remove', NAME] + (['--scope', 'user'] if client == 'claude' else []), home, False)
|
||||
command(client, command_args, home, False)
|
||||
|
||||
@@ -13,6 +13,23 @@ SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
class SemanticRetrievalTests(unittest.TestCase):
|
||||
def test_claude_registration_places_name_before_environment(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
home = Path(directory) / 'home'
|
||||
calls = []
|
||||
original = MODULE.command
|
||||
original_runtime = MODULE.ensure_runtime
|
||||
MODULE.command = lambda client, arguments, home, dry_run: calls.append((client, arguments))
|
||||
MODULE.ensure_runtime = lambda target, dry_run: target / '.venv' / 'bin' / 'python'
|
||||
try:
|
||||
MODULE.sync(ROOT, home, ['claude'], True, False, False)
|
||||
finally:
|
||||
MODULE.command = original
|
||||
MODULE.ensure_runtime = original_runtime
|
||||
add = calls[0][1]
|
||||
self.assertEqual(add[:5], ['claude', 'mcp', 'add', MODULE.NAME, '--scope'])
|
||||
self.assertIn('-e', add)
|
||||
|
||||
def test_disable_removes_owned_runtime_and_registration(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
home = Path(directory) / 'home'
|
||||
|
||||
Reference in new issue
Block a user