MiniMax-AI / MiniMax-AI/minimax-code
[Bug]: Local Runtime V2 loads Markdown hooks but does not dispatch UserPromptSubmit or user PreToolUse
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 141
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 46
Description
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=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.- No corresponding
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 / 实际行为
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with node_modules/@mavis/local-runtime/src/debug/build-snapshot.ts and node_modules/@mavis/local-runtime-v2/src/compat/v1/agent-host.ts, then inspect the V2 assembly path mentioned in the report. Reproduce the documented registry and direct-adapter checks before testing a real Desktop turn. Done means V2 hooks dispatch with matcher, priority, output, and diagnostic behavior, or the registry and documentation explicitly identify them as unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100