Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#106 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@LingYi-Liang ci sta già lavorando.

Dal 3/10/2026.

  • #107 di @LingYi-Liang — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia in minimax_mcp/utils.py, in build_output_file(), quindi esamina il percorso di salvataggio locale in minimax_mcp/server.py. Riproduci il problema con lo script TemporaryDirectory fornito e aggiungi un test di regressione che copra testo con barre oblique in stile data. Il lavoro è completato quando entrambi i formati di data producono file direttamente nella directory di output richiesta e la scrittura va a buon fine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Python
Stelle
1.6k
Fork
284
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MiniMax-AI/MiniMax-MCP

Tutte le issue di MiniMax-AI/MiniMax-MCP

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.