--acp never answers initialize when a sandbox is enabled (stdin read as a piped prompt before the sandbox hop)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- cli
Direzione di ricerca
Inizia in packages/cli/src/gemini.tsx intorno alla lettura di stdin dentro il ramo if (sandboxConfig), poi leggi packages/cli/src/utils/readStdin.ts per capire perché il timer di 1 s viene cancellato al primo chunk. Decidi come il flag ACP (--acp / --experimental-acp) è noto a quel punto e salta la lettura del prompt piped quando è impostato, così il salto nella sandbox avviene subito. Fatto significa che GEMINI_SANDBOX=sandbox-exec gemini --acp risponde a initialize subito, con i test CLI esistenti ancora superati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
With a sandbox enabled (GEMINI_SANDBOX, --sandbox, or tools.sandbox in settings), gemini --acp never answers an ACP client's initialize request when the client writes it as soon as the process starts. Without a sandbox it answers at once.
The cause: before hopping into the sandbox, the CLI reads a non-TTY stdin as a piped prompt:
https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/cli/src/gemini.tsx#L705-L728
readStdin() clears its 1 s "nothing piped" timer at the first chunk, then waits for an end of input that an ACP stdio transport never sends. So the CLI waits forever and never starts the sandboxed process:
A client that holds its first write back for about 3 s does get an answer, because the timer fires first and the read ends empty, but that's a race, not a fix.
This looks like the cause of #22782 (--acp hanging, with sandbox-exec (permissive-open) in its client information), which was closed as not planned.
Steps to reproduce
- On macOS, start
GEMINI_SANDBOX=sandbox-exec gemini --acp. - Immediately write an ACP
initializerequest line to its stdin. - No response arrives (waited 15 s). Without
GEMINI_SANDBOX, the response arrives at once.
What did you expect to happen?
With a sandbox enabled, --acp hops into the sandbox and answers initialize from inside it. ACP never takes a piped prompt, so skipping the stdin read when --acp (or --experimental-acp) is set should fix it.
Client information
- CLI version: 0.70.0 (also 0.69.0)
- Platform: macOS (darwin arm64)
- Sandbox: sandbox-exec (permissive-open)
The read sits inside if (sandboxConfig), before the hop, so any sandbox command should behave the same.
Login information
None needed: reproduced with a fresh GEMINI_CLI_HOME and no account configured.
- Lingua principale
- TypeScript
- Stelle
- 109k
- Fork
- 15k
- Merge medio
- 1g 1h
- PR unite (30g)
- 106
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 google-gemini/gemini-cli
-
status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google-gemini/gemini-cli#30412 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
** Docs: `/shells` slash command (and `/bashes`) is documented but was removed in #22740 — tutorial and tip tell users to run a command that doesn't existForse già presa @DZH166 l’ha presa 1 giorno fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google-gemini/gemini-cli#30396 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
** Docs: System Prompt Override guide links "Persisting Environment Variables" to an anchor that does not exist in authentication.mdxForse già presa @DZH166 l’ha presa 1 giorno fa. Apertastatus/need-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
google-gemini/gemini-cli#30394 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
core tests: orphan PTY slave fd test fails on Macs where /dev/ttys001 existsForse già presa @Anoshor l’ha presa 2 giorni fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google-gemini/gemini-cli#30384 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
cli tests: gemini.test.tsx fails locally unless GEMINI_CLI_TRUST_WORKSPACE is setForse già presa @Anoshor l’ha presa 2 giorni fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google-gemini/gemini-cli#30383 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di google-gemini/gemini-cli
Issue simili
-
bug done
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
neavo/LinguaGacha#1124 ·
I maintainer di solito rispondono entro 1 giorno
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errorsForse già presa @fullsend-ai-coder l’ha presa oggi. Apertae2e-failure ready-to-code
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
brylie/mission-island#225 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement from-app needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nightly-labs/openbot#14986 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno