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

filesystem: read_text_file with head: 0 or tail: 0 returns the whole file

Aperta Adatta ai principianti
#5,184 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia da src/filesystem/server.ts per seguire come vengono verificati head e tail, poi esamina i relativi schemi e headFile e tailFile in src/filesystem/lib.ts. Usa come contesto la PR del prototipo chiusa #4178. Il lavoro è completato quando zero restituisce un risultato vuoto, sono accettati solo interi non negativi e head: 0, tail: 0 viene gestito come descritto.

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

Descrizione

bug server-filesystem v2
Problem

read_text_file in src/filesystem/server.ts tests head and tail for truthiness. A request for zero lines (head: 0 or tail: 0) falls through to reading the whole file, and head: 0, tail: 0 together is not rejected. The schemas accept any number, so negative or fractional counts reach headFile and tailFile in src/filesystem/lib.ts.

Expected

head and tail are checked against undefined, accept only non-negative integers, and a count of 0 returns an empty result.

Prior work
  • #4178 by @pragnyanramtha

The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.

Lingua principale
TypeScript
Stelle
91.4k
Fork
11.8k
Merge medio
6h 39m
PR unite (30g)
146

Preparare l'ambiente

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 modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.