Skip to content

fix(mcp): initialize task manager so async fs operations don't panic - #9546

Merged
okatu-loli merged 1 commit into
mainfrom
fix/mcp-cmd-init-task-manager
Jun 1, 2026
Merged

fix(mcp): initialize task manager so async fs operations don't panic#9546
okatu-loli merged 1 commit into
mainfrom
fix/mcp-cmd-init-task-manager

Conversation

@okatu-loli

@okatu-loli okatu-loli commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cmd/mcp.go (added in v3.60.0) calls Init() + LoadStorages() but skips bootstrap.InitTaskManager(), unlike cmd/server.go.

  • fs.CopyTaskManager, fs.UploadTaskManager, fs.MoveTaskManager are therefore nil; any MCP fs_copy / fs_move that crosses storage targets panics at internal/fs/copy.go on CopyTaskManager.Add with nil pointer dereference, surfaced to the MCP client as:

    panic recovered in fs_copy tool handler:
    runtime error: invalid memory address or nil pointer dereference
    
  • Fix: mirror the cmd/server.go bootstrap order so the MCP command initializes the task manager too.

Test plan

  • stdio JSON-RPC fs_copy against patched MCP binary returns copied successfully.
  • Same call against unpatched binary reproducibly panics.

cmd/mcp.go (added in v3.60.0) calls Init() and LoadStorages() but skips
bootstrap.InitTaskManager(). As a result fs.CopyTaskManager,
fs.UploadTaskManager, fs.MoveTaskManager and friends are nil, and any
MCP fs_copy / fs_move on a cross-storage target panics at
internal/fs/copy.go (CopyTaskManager.Add) with a nil-pointer dereference
that the MCP handler surfaces as:

    panic recovered in fs_copy tool handler:
    runtime error: invalid memory address or nil pointer dereference

Mirror the cmd/server.go bootstrap order so the MCP command initializes
the task manager too.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@okatu-loli
okatu-loli merged commit 7385594 into main Jun 1, 2026
12 checks passed
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.

3 participants