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

TypeScript SDK: DEL characters produce invalid TOML overrides and corrupt escaped strings

Aperta Adatta ai principianti
#51,545 0 commenti 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

Il SDK TypeScript utilizza JSON.stringify per serializzare gli override TOML, il che fallisce per le stringhe che contengono DEL (U+007F). Individua il codice di serializzazione nel SDK e sostituiscilo con un serializzatore di stringhe condiviso che esegua l'escape di DEL come \u007f. Aggiungi test dell'esecutore per stringhe scalari, array di stringhe e chiavi di tabelle in linea nidificate contenenti DEL. Esegui la suite di test dell'esecutore per verificare che tutti e 16 i test passino e che l'analisi TOML abbia esito positivo.

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

Descrizione

bug CLI config
What issue are you seeing?

The TypeScript SDK uses JSON.stringify() to serialize TOML string values and inline-table keys. JSON permits a literal DEL character (U+007F), but TOML basic strings require it to be escaped. Consequently a supported string array such as notify can fail configuration loading, and scalar instruction strings containing DEL plus a newline, tab, or backslash can silently lose escape decoding.

SDK main ac9b5b8380517ded445b09dd3196d8d9e2ba3c59 was tested on Linux with Node.js v24.19.0. Native parser/config behavior was checked with Codex CLI 0.159.0-alpha.3.

What steps can reproduce the bug?

Configure the SDK with:

const codex = new Codex({
  config: { notify: ["node", "/tmp/a\u007fb.mjs"] },
});

The SDK emits an override equivalent to the JSON serialization below. To exercise configuration loading without a model call:

import { spawnSync } from "node:child_process";
const override = `notify=${JSON.stringify(["node", "/tmp/a\u007fb.mjs"])}`;
const result = spawnSync("codex", ["features", "list", "--config", override], { encoding: "utf8" });
console.log(result.status, result.stderr);

On the tested native CLI this exits 1: invalid type: string ..., expected a sequence in notify. The literal DEL makes TOML parsing fail; the CLI's raw-string fallback then treats the entire array as a string.

For a scalar developer_instructions string containing DEL and an actual newline, the same fallback preserves the literal backslash-n escape rather than the original newline. I verified the prompt content via the native debug prompt-input command using marker-delimited test strings. DEL alone in a scalar is preserved by the fallback, so this report does not claim every scalar containing DEL fails.

What is the expected behavior?

Serialize supported string values and inline-table keys as valid TOML while preserving their content, including nested arrays/tables.

Additional information

A candidate adds a shared string serializer that replaces the literal DEL in the JSON-quoted string with the TOML Unicode escape \u007f, using it for both string values and quoted inline-table keys. It does not change configuration path-key semantics or numeric handling.

Two added executor cases cover scalar strings/string arrays and nested inline-table keys/values. All 16 executor tests, SDK build/type declarations, ESLint, and Prettier pass. Real SDK argument capture plus TOML parsing verifies exact nested content round trips. With the candidate, the native notify configuration exits 0 and native prompt-input retains all tested instruction content.

Searched TypeScript/DEL and SDK TOML serialization reports and found no equivalent issue. No external PR is requested, consistent with the contribution policy.

Lingua principale
Rust
Stelle
130k
Fork
20.5k
Merge medio
1m
PR unite (30g)
995

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 openai/codex

Tutte le issue di openai/codex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.