[Bug]: request_secret file delivery has no trailing newline, and the tool text does not say so

Offen Anfängerfreundlich
#34,318 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@juliusmarminge arbeitet bereits daran.

Seit 11.11.2026.

  • #34494 von @juliusmarminge — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
69/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
backend

Rechercherichtung

Lies apps/server/src/secrets/SecretRequests.ts und suche die Beschreibung des Tools request_secret sowie die im Issue erwähnten sudo-Hinweise. Prüfe, wie bei der Dateibereitstellung das Secret geschrieben wird, und vergleiche dieses Verhalten mit den Anweisungen für den Agenten. Fertig ist die Arbeit, wenn die Anweisungen den fehlenden abschließenden Zeilenumbruch erklären und eine praktikable Möglichkeit für den Umgang mit zeilenbasierten Lesern nennen, einschließlich remote ausgeführtem sudo über SSH, falls zutreffend.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/server

Steps to reproduce
  1. Have an agent call request_secret with delivery: "file" and enter a password.
  2. Have the agent feed the file to a line-based reader, for example running sudo on another machine over ssh -tt (sudo's timestamp has to be on the same tty as the later command, so sudo -S < "$file" locally does not help):
ssh -tt host 'IFS= read -rs pw; printf "%s\n" "$pw" | sudo -S -p "" true; ...' \
  < <(cat "$file"; exec sleep 7200)
Expected behavior

The agent knows from the tool text that the file holds the value exactly, with no trailing newline, so it appends one for readers that wait for a line. Or there is a documented pattern for sudo on a remote host.

Actual behavior

request_secret writes the value with no trailing newline (apps/server/src/secrets/SecretRequests.ts, fileSystem.writeFile(partial, new TextEncoder().encode(value), ...)). The two patterns in the agent-facing text, "$(cat <file>)" and sudo -S -p '' <cmd> < "$file", work because both accept EOF. Neither the tool description nor the sudo guidance says the newline is missing, though.

In the case above, read never sees a newline, so the remote shell blocks with no output and no error. The agent cannot tell it is stuck on the password, not on the work it started, until it checks the remote process list. Appending printf '\n' after cat "$file" fixes it.

Suggestion: say in the request_secret description, and in the sudo guidance, that the file has no trailing newline. Optionally add a short pattern for sudo on a remote host over ssh.

Impact

Minor bug or occasional failure

Version or commit

T3 Code desktop 0.1.9-nightly.20261111.4515

Environment

macOS desktop app, Claude provider; the target was a linked Linux machine reached over ssh.

Workaround

Append a newline: < <(cat "$file"; printf '\n'; exec sleep 7200).

Vorherrschende Sprache
TypeScript
Sterne
24.8k
Forks
6.4k
Ø Merge
10 Std. 56 Min.
Gemergte PRs (30 T.)
226

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus pingdotgg/t3code

Alle Issues in pingdotgg/t3code

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.