Version / 版本号
MiniMax Code Desktop 3.0.67.129 on Windows 11 x64.
Issue area / 问题类型
Local Runtime V2 / user hooks
What happened? / 问题描述
Local Runtime V2 loads documented Markdown hook registrations from %USERPROFILE%\.minimax\hooks, but normal Desktop turns do not dispatch user UserPromptSubmit or user PreToolUse hooks.
The registry is healthy: GET /mavis/api/hooks?agent=mavis returns HTTP 200 and lists the test hooks with the expected events, priorities, and matchers. The script adapters also pass direct documented-envelope tests. However, a new real Desktop session produces neither the UserPromptSubmit prompt marker nor the PreToolUse ^task$ argument mutation.
This is separate from hook parsing and separate from the task tool itself: the native task completes successfully, but receives the original prompt.
Steps to reproduce / 复现步骤
-
Create %USERPROFILE%\.minimax\hooks\test-prompt.md:
---
hookEvent: UserPromptSubmit
type: script
priority: 10
---
```bash
node.exe "%USERPROFILE%/.minimax/hooks/test-prompt.js"
```
-
Make the script read the documented { "input": ..., "output": ... } envelope and return a deterministic prompt marker.
-
Confirm the hook appears in GET /mavis/api/hooks?agent=mavis and passes direct execution with the documented envelope.
-
Create a new Desktop session and send a prompt. The marker is absent.
-
Repeat with a PreToolUse script using matcher ^task$ that prepends a deterministic marker to output.toolArgs.prompt.
-
Invoke native task. The task succeeds, but receives the unmodified prompt.
Bundled-source evidence
The packaged Local Runtime source corroborates the live result:
node_modules/@mavis/local-runtime/src/debug/build-snapshot.ts states that the local turn path does not run UserPromptSubmit hooks and emits an executed count of zero.
node_modules/@mavis/local-runtime-v2/src/compat/v1/agent-host.ts installs a local-v1-user-hooks extension that calls hosted.hooks.beforeToolCall and afterToolCall.
- No corresponding
local-v2-user-hooks bridge exists in the packaged V2 host. The V2 executor can consume assembly.hooks.beforeToolCallHook, but the hosted user-hook service is not wired into that assembly path.
Expected behavior / 预期行为
Normal Local Runtime V2 turns should dispatch the documented loaded user hooks, merge their output according to the bundled Hook contract, honor matchers and priority, and report accurate execution diagnostics.
If user hooks are intentionally unsupported in V2, the registry/API and bundled Hook documentation should say so explicitly and avoid presenting loaded registrations as active turn hooks.
Actual behavior / 实际行为
- Hook registry: loaded.
- Direct adapter/manual execution: passes.
- Real V2
UserPromptSubmit: not dispatched.
- Real V2
PreToolUse ^task$: not dispatched.
- Native task operation: succeeds without the hook mutation.
Local workaround
For project workflow rules, use a delimited global AGENTS.md rule plus an installed skill that performs live project/task discovery. This restores behavior for new sessions but cannot implement general user PreToolUse/PostToolUse semantics.
No application ASAR or official plugin-cache file was modified during diagnosis.
Version / 版本号
MiniMax Code Desktop
3.0.67.129on Windows 11 x64.Issue area / 问题类型
Local Runtime V2 / user hooks
What happened? / 问题描述
Local Runtime V2 loads documented Markdown hook registrations from
%USERPROFILE%\.minimax\hooks, but normal Desktop turns do not dispatch userUserPromptSubmitor userPreToolUsehooks.The registry is healthy:
GET /mavis/api/hooks?agent=mavisreturns HTTP 200 and lists the test hooks with the expected events, priorities, and matchers. The script adapters also pass direct documented-envelope tests. However, a new real Desktop session produces neither theUserPromptSubmitprompt marker nor thePreToolUse ^task$argument mutation.This is separate from hook parsing and separate from the task tool itself: the native task completes successfully, but receives the original prompt.
Steps to reproduce / 复现步骤
Create
%USERPROFILE%\.minimax\hooks\test-prompt.md:Make the script read the documented
{ "input": ..., "output": ... }envelope and return a deterministic prompt marker.Confirm the hook appears in
GET /mavis/api/hooks?agent=mavisand passes direct execution with the documented envelope.Create a new Desktop session and send a prompt. The marker is absent.
Repeat with a
PreToolUsescript using matcher^task$that prepends a deterministic marker tooutput.toolArgs.prompt.Invoke native
task. The task succeeds, but receives the unmodified prompt.Bundled-source evidence
The packaged Local Runtime source corroborates the live result:
node_modules/@mavis/local-runtime/src/debug/build-snapshot.tsstates that the local turn path does not runUserPromptSubmithooks and emits an executed count of zero.node_modules/@mavis/local-runtime-v2/src/compat/v1/agent-host.tsinstalls alocal-v1-user-hooksextension that callshosted.hooks.beforeToolCallandafterToolCall.local-v2-user-hooksbridge exists in the packaged V2 host. The V2 executor can consumeassembly.hooks.beforeToolCallHook, but the hosted user-hook service is not wired into that assembly path.Expected behavior / 预期行为
Normal Local Runtime V2 turns should dispatch the documented loaded user hooks, merge their output according to the bundled Hook contract, honor matchers and priority, and report accurate execution diagnostics.
If user hooks are intentionally unsupported in V2, the registry/API and bundled Hook documentation should say so explicitly and avoid presenting loaded registrations as active turn hooks.
Actual behavior / 实际行为
UserPromptSubmit: not dispatched.PreToolUse ^task$: not dispatched.Local workaround
For project workflow rules, use a delimited global
AGENTS.mdrule plus an installed skill that performs live project/task discovery. This restores behavior for new sessions but cannot implement general userPreToolUse/PostToolUsesemantics.No application ASAR or official plugin-cache file was modified during diagnosis.