Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug for MCP&API]: Slashes in text break local output file saving

Đang mở Phù hợp với người mới
#106 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@LingYi-Liang đang làm issue này rồi.

Từ ngày 3/10/2026.

  • #107 của @LingYi-Liang — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong minimax_mcp/utils.py tại build_output_file(), sau đó kiểm tra đường dẫn lưu cục bộ trong minimax_mcp/server.py. Tái hiện sự cố bằng script TemporaryDirectory được cung cấp và thêm một bài kiểm thử hồi quy bao quát văn bản có dấu gạch chéo kiểu ngày tháng. Hoàn tất có nghĩa là cả hai định dạng ngày tháng đều tạo tệp trực tiếp bên trong thư mục đầu ra được yêu cầu và việc ghi thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Text starting with a date like 2026/10/03 breaks local output saving for
text_to_audio (MINIMAX_API_RESOURCE_MODE=local).

build_output_file() takes the first 10 characters and only replaces spaces.
The result is t2a_2026/10/03_<timestamp>.mp3. The slashes are treated as path
separators, but those directories don't exist. Changing the date to 2026-10-03
lets the file save normally.

Reproduction

Run this from the repository root with the Python dependencies installed. It
imports the unmodified utility and writes test bytes directly to a temporary
directory, without calling the API. Both inputs use the same absolute output
path, which also avoids the separate path-joining issue.

from pathlib import Path
from tempfile import TemporaryDirectory

from minimax_mcp.utils import build_output_file, build_output_path

records = []
with TemporaryDirectory() as directory:
    output_path = build_output_path(str(Path(directory) / "output"))
    for text in ("2026-10-03", "2026/10/03"):
        output_file = build_output_file("t2a", text, output_path, "mp3")
        output_path.parent.mkdir(parents=True, exist_ok=True)
        try:
            with open(output_path / output_file, "wb") as stream:
                stream.write(b"local write probe")
            result = "saved"
        except OSError as error:
            result = type(error).__name__
        parent_matches = output_file.parent == output_path
        print(text, "parent_matches:", parent_matches, "write:", result)
        records.append({"text": text, "parent_matches": parent_matches, "write": result})

Both runs gave this output:

2026-10-03 parent_matches: True write: saved
2026/10/03 parent_matches: False write: FileNotFoundError

Both inputs should save directly inside the requested directory.

Environment

Windows, Python 3.11.9, package version 0.0.19 at
0856b9aef8a9d676bb63bdd6b6426d7b640a3b7a.
Models used and Trace-ID: N/A (local reproduction, no request).

The relevant code is filename construction
and the local audio save path.

I've checked the Python/JS READMEs, MCP guide and existing issues. #73/#74 address
repeated path joining, and #92 covers nested-directory writability; none changes
how text becomes a filename.

Would you be open to a small fix that replaces path separators in the text,
keeps ordinary Unicode characters, and adds a file-write regression test?

Ngôn ngữ chính
Python
Star
1.6k
Fork
284
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MiniMax-AI/MiniMax-MCP

Tất cả issue của MiniMax-AI/MiniMax-MCP

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.