Skip to content

Add native MCP action to Go worker - #96

Merged
devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/176393-native-mcp-worker
Nov 24, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/176393-native-mcp-worker

Conversation

@Personed

@Personed Personed commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the native MCP catalog action to the Go worker and wires it into mcp.native service handling. It runs the provider CLI from the Bot’s workspace, parses native catalog output, omits Persona’s own entry, and returns inheritance/read-only metadata.

The adapter uses each provider’s default CLI command; Go EngineConfig does not currently expose TypeScript’s optional custom command override, so that shared config model remains unchanged.


Internal Tools Engineer opened this PR for Stoltembergg
Implemented in session Add native MCP action to Go worker
Review with Devin · Open in Devin Desktop


Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 2 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread internal/computers/mcp.go Outdated
Comment on lines +127 to +132
if engine.ComputerID == nil {
return mcp.NativeCatalog{}, errors.New("请先选择 Bot 的工作电脑和 Harness。")
}
result, err := c.MCP(ctx, *engine.ComputerID, botID, worker.MCPInput{
Action: "native",
Config: &worker.MCPConfig{Provider: engine.Config.Provider},

@devin-ai-integration devin-ai-integration Bot Nov 23, 2026 •

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.

🔴 Catálogo MCP nativo indisponível em instalações locais novas

Ao consultar o catálogo de um Bot recém-configurado no computador local, o worker usa um diretório de trabalho ainda inexistente. O Harness não inicia, e o painel de aplicativos não mostra as conexões nativas.

Learn more

O painel de aplicativos consulta as conexões nativas em refreshNative. A associação feita por Assign grava o computador, mas não cria a pasta de trabalho do Bot. Para o computador local, workDir calcula o caminho em agent.sqlite.files, e MCP apenas repassa esse caminho ao worker. nativeMCP usa o caminho como diretório atual do processo; se ele não existe, nem um Harness instalado consegue iniciar. A implementação TypeScript cria a pasta local antes de iniciar o processo.

Exemplo: Em uma instalação Go nova, configure o Bot 7 com Pi instalado, vincule-o ao computador local e abra as conexões nativas no painel de aplicativos. Sem agent.sqlite.files/7/workspace, o painel mostra um erro de leitura em vez do catálogo. Atualizar o painel não cria a pasta.

Recommended fix: Garanta que o diretório de trabalho do Bot exista no computador vinculado antes de iniciar o Harness. Para o alvo local, prepare o caminho retornado por workDir; não use outro diretório como fallback, pois o catálogo pode depender da configuração do workspace. Adicione um teste com um diretório de dados vazio, um Bot vinculado e um CLI de teste, sem executar uma conversa antes da consulta.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +55 to +59
cmd := exec.CommandContext(run, path, args...)
cmd.Env, cmd.Stderr = env, io.Discard
cmd.Dir = cwd
cmd.Stdout = &nativeOutputWriter{buf: &out, limit: nativeOutputLimit}
err = cmd.Run()

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.

🔴 Catálogo MCP não carrega com CLIs instaladas pelo npm no Windows

Ao abrir o catálogo no Windows, ResolveProgram pode encontrar o atalho .cmd instalado pelo npm. O worker tenta executá-lo sem um interpretador, e a consulta falha mesmo com o Harness instalado.

Learn more

O worker encontra o programa antes de ler o catálogo. No Windows, ResolveProgram aceita o primeiro caminho retornado por where.exe que corresponda às extensões suportadas, inclusive .cmd e .bat. Esses arquivos são scripts em lote, não executáveis que o Windows possa iniciar diretamente. A versão TypeScript usa nativeMcp com cross-spawn, que trata esses scripts. O teste Go fornece executable, um binário, e não passa pelo caso de um atalho de npm.

Example: Em um computador Windows em que o programa pi é encontrado apenas como pi.cmd, selecione no painel um Bot cujo catálogo chega a esse computador. A consulta encontra a CLI, mas falha antes de executar mcp list --json.

Recommended fix: Trate .cmd e .bat em um helper de execução para Windows que os inicie por um interpretador com escape apropriado. Preserve o diretório do Bot, o ambiente, o cancelamento e o limite de saída. Adicione um teste Windows que passe um arquivo .cmd válido ao worker.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Personed and others added 2 commits November 23, 2026 22:19
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The engine document's computerId is only written when the engine runs, so Bots configured through Assign but not yet run, and Bots whose assignment changed after their last session, resolved the wrong computer. The computers binding is the source switchSession mirrors.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit 3ff2867 into main Nov 24, 2026
22 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/176393-native-mcp-worker branch November 24, 2026 07:55
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.

1 participant