fix(mcp): initialize task manager so async fs operations don't panic - #9546
Merged
Conversation
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>
skysliences
approved these changes
May 29, 2026
JoaHuang
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/mcp.go(added in v3.60.0) callsInit()+LoadStorages()but skipsbootstrap.InitTaskManager(), unlikecmd/server.go.fs.CopyTaskManager,fs.UploadTaskManager,fs.MoveTaskManagerare therefore nil; any MCPfs_copy/fs_movethat crosses storage targets panics atinternal/fs/copy.goonCopyTaskManager.Addwith nil pointer dereference, surfaced to the MCP client as:Fix: mirror the
cmd/server.gobootstrap order so the MCP command initializes the task manager too.Test plan
fs_copyagainst patched MCP binary returnscopied successfully.