From ae0ebf3693d31a6eb43848a231ec81596c24ea3b Mon Sep 17 00:00:00 2001 From: SaladDay <1203511142@qq.com> Date: Mon, 19 Oct 2026 06:13:39 +0000 Subject: [PATCH] Restore MiniMax Code external Skill discovery The workspace's .minimax, .claude and .agents Skills load as they do in a local run. User roots resolve inside the Session's private HOME. --- apps/daemon/internal/agent/mcode/options.go | 2 +- apps/daemon/internal/agent/mcode/options_test.go | 4 ++-- .../internal/agent/mcode/workspace_native_test.go | 13 +++++++++++++ services/core/deploy/mcode/README.md | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/daemon/internal/agent/mcode/options.go b/apps/daemon/internal/agent/mcode/options.go index 5d0223ea1..b210a4d77 100644 --- a/apps/daemon/internal/agent/mcode/options.go +++ b/apps/daemon/internal/agent/mcode/options.go @@ -56,7 +56,7 @@ func prepareOptions(runtimeRoot string, req proto.PromptRequestPayload, workspac if err := os.WriteFile(filepath.Join(result.DataDir, "AGENTS.md"), []byte(prompt), 0o600); err != nil { return result, err } - config := map[string]any{"logLevel": "error", "skills": map[string]any{"external": map[string]any{"enabled": false}}} + config := map[string]any{"logLevel": "error"} result.Model = optionString(opts, "model") if result.Model == "" { return result, fmt.Errorf("mcode: model is required") diff --git a/apps/daemon/internal/agent/mcode/options_test.go b/apps/daemon/internal/agent/mcode/options_test.go index 1dd26f6a8..3d7c78c82 100644 --- a/apps/daemon/internal/agent/mcode/options_test.go +++ b/apps/daemon/internal/agent/mcode/options_test.go @@ -53,8 +53,8 @@ func TestOptionsRefreshManagedState(t *testing.T) { if _, set := cfg["permissionMode"]; set { t.Fatal("text profile restated the native permission mode") } - if cfg["skills"].(map[string]any)["external"].(map[string]any)["enabled"] != false { - t.Fatal("external discovery enabled") + if _, set := cfg["skills"]; set { + t.Fatal("native Skill discovery was overridden") } if skills, ok := cfg["agents"].(map[string]any)["default"].(map[string]any)["skills"].([]any); !ok || len(skills) != 0 { t.Fatal("text profile selected native Skills") diff --git a/apps/daemon/internal/agent/mcode/workspace_native_test.go b/apps/daemon/internal/agent/mcode/workspace_native_test.go index 0b6afc022..17378f413 100644 --- a/apps/daemon/internal/agent/mcode/workspace_native_test.go +++ b/apps/daemon/internal/agent/mcode/workspace_native_test.go @@ -55,6 +55,13 @@ func TestNativeMCodeWorkspaceTools(t *testing.T) { if err := os.WriteFile(filepath.Join(workspace, "notes.txt"), []byte("alpha\n"), 0600); err != nil { t.Fatal(err) } + skill := filepath.Join(workspace, ".claude", "skills", "probe-phrase") + if err := os.MkdirAll(skill, 0700); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(skill, "SKILL.md"), []byte("---\nname: probe-phrase\ndescription: Gives the probe phrase.\n---\nThe probe phrase is violet-anchor-58.\n"), 0600); err != nil { + t.Fatal(err) + } value, err := NewExecutorFactory(testStateRoot(t), c)(ctx, req) if err != nil { t.Fatal("native Executor preparation failed:", err) @@ -149,6 +156,12 @@ func TestNativeMCodeWorkspaceTools(t *testing.T) { t.Fatalf("Subagent did not run in the workspace: %q %v", child, r.events) } }) + t.Run("workspace Skills load natively", func(t *testing.T) { + r := run(t, workspace, nil, "Use the probe-phrase Skill, then reply with the probe phrase only.") + if !strings.Contains(r.content, "violet-anchor-58") { + t.Fatalf("workspace Skill was not loaded: %q", r.content) + } + }) t.Run("web search control", func(t *testing.T) { const prompt = "Without calling any tool, list the exact names of every tool you can call, comma separated." tools := run(t, workspace, nil, prompt).content diff --git a/services/core/deploy/mcode/README.md b/services/core/deploy/mcode/README.md index 172e6663e..6e7c0cd93 100644 --- a/services/core/deploy/mcode/README.md +++ b/services/core/deploy/mcode/README.md @@ -25,7 +25,7 @@ Each Session has its own native data directory, `$OAC_RUNTIME_HOME/runtime/mcode The text profile rejects workspace, function tools and MCP servers. Workspace execution requires Linux or macOS and an unrestricted Environment network policy ([`workspace.go`](../../../../apps/daemon/internal/agent/mcode/workspace.go)); the adapter enforces no network restriction. -In the workspace profile, the frozen installation's Skills are linked into the Session's `skills` directory under their exact names and loaded through the native `skill` tool; external Skill discovery stays off. Public MCP servers use the Environment origin only, as the [MCP origin contract](../../../../contracts/agents-api/environments.md#public-mcp-connection-origin) describes. With Subagents enabled, child agents use the same native tools. In both profiles the adapter turns off what needs a MiniMax account or outlives a Turn or asks the user: `askUser`, `beta.mcodeTools`, `beta.threadGoal`, `features.mavis`, `features.webSearch`, the Matrix builtin tools and, on the text profile, the bundled Skills, and it leaves `website_deploy` out of `tools`. `web_search: disabled` also removes `web_fetch`. Background Bash is off: the patched CLI gates it on `OAC_RUNTIME_MCODE_BACKGROUND_BASH=off`, and the adapter rejects a CLI that does not report it off. +In the workspace profile, the frozen installation's Skills are linked into the Session's `skills` directory under their exact names and loaded through the native `skill` tool. Native discovery also reads the workspace's `.minimax`, `.claude` and `.agents` Skills, as a local run does. Public MCP servers use the Environment origin only, as the [MCP origin contract](../../../../contracts/agents-api/environments.md#public-mcp-connection-origin) describes. With Subagents enabled, child agents use the same native tools. In both profiles the adapter turns off what needs a MiniMax account or outlives a Turn or asks the user: `askUser`, `beta.mcodeTools`, `beta.threadGoal`, `features.mavis`, `features.webSearch`, the Matrix builtin tools and, on the text profile, the bundled Skills, and it leaves `website_deploy` out of `tools`. `web_search: disabled` also removes `web_fetch`. Background Bash is off: the patched CLI gates it on `OAC_RUNTIME_MCODE_BACKGROUND_BASH=off`, and the adapter rejects a CLI that does not report it off. ## Turns, cancellation and continuation