[Feature]: Enhance flow
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
Inizia individuando la logica dello strumento PTY e i relativi punti di ingresso spawn, write e read nel plugin TypeScript. Traccia il modo in cui ogni operazione restituisce attualmente l’output, quindi verifica che spawn e write includano una read immediata, mentre read rimanga disponibile come operazione autonoma per i comandi di lunga durata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem Statement
Currently, the AI agent interacts with the pseudo-terminal (PTY) using strictly atomic operations: pty spawn, pty input, pty read, and pty kill. While scientifically accurate to how PTYs function under the hood, this creates severe tool-calling bloat and latency for the LLM.
For example, a simple interactive SSH login and check uname sequence requires the LLM to invoke tools 7 times:
spawn -> write ssh user@host -> read -> write password -> read -> write uname -> read.
This atomic structure forces the AI to explicitly request buffer reads after every single action, wasting time, consuming unnecessary tokens, and degrading the overall experience.
Proposed Solution
Refactor the PTY tool logic to use "compound" operations that bundle execution with immediate reads, effectively reducing the number of round trips required by the LLM.
The updated tool behaviors should be:
spawn: Spawns the PTY, optionally accepts an initial input command, and automatically returns the firstreadbuffer.write: Sends the keystrokes/command and *automatically performs aread*to return the resulting output.read: Kept as a standalone function strictly for polling the output of long-running, blocking commands (e.g.,ping -c 100 localhost) where the AI needs to check on progress.
Under this new architecture, the same SSH login sequence drops from 7 tool calls to just 3:
spawn (ssh user@host) -> write password -> write uname.
Use Case
- AI-Powered Cybersecurity Agents: Drastically speeding up multi-step interactive workflows, such as establishing reverse shells, navigating nested SSH jumps, or interacting with interactive privilege escalation scripts (e.g.,
sudo). - Reduced Token Consumption: Cutting the context overhead by eliminating redundant
<tool_call>read</tool_call>outputs from the LLM's thought process.
I already have a version with new approach and it work faster than current version. IT WORK !!!!
Additional Context
This "compound action" approach has recently been validated by major industry players. For instance, Anthropic recently updated their computer-use/bash tools to follow this exact paradigm, combining command execution and output reading to minimize unnecessary round-trips.
- Lingua principale
- TypeScript
- Stelle
- 597
- Fork
- 65
- Merge medio
- 1g 20h
- PR unite (30g)
- 3
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di shekohex/opencode-pty
-
[Bug]: exit notification delivery failures are silently swallowed — agent never wakes, no diagnosticAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
shekohex/opencode-pty#54 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
shekohex/opencode-pty#48 ·
I maintainer di solito rispondono entro 1 giorno
-
PTY output pollutes OpenCode session with ANSI escape sequences, breaking keyboard input on resumeForse già presa @NAnD71 l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
shekohex/opencode-pty#75 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
shekohex/opencode-pty#67 · 3 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
shekohex/opencode-pty#66 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di shekohex/opencode-pty
Issue simili
-
chore v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/servers#5115 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner bug good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
philaconvalley/website#168 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
oss-slu/lrda_mobile#294 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hatchet-dev/hatchet#5179 ·
I maintainer di solito rispondono entro 1 giorno