tui: @/ cannot mention project root in non-Git locations
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
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia da packages/core/src/filesystem/search.ts ed esamina come il backend ripgrep crea il proprio indice delle directory a partire dalle voci di rg --files. Confronta il comportamento non Git con il backend fff e il lavoro correlato sulle directory vuote in #60450. L’obiettivo è che GET /api/fs/find?query=/ includa {"path":"/","type":"directory"} per una posizione non Git, mantenendo il comportamento esistente per le posizioni gestite da Git.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
In a non-Git location, typing @/ no longer offers the location root as a mention, so the project directory itself cannot be attached to a prompt. Git-backed locations still list / and attach the directory correctly.
Environment
- opencode version: 2.2.5
- OS: Linux 6.18.60-1-lts (x86_64)
- Terminal: TUI, TERM=xterm-256color, COLORTERM=truecolor, TERM_PROGRAM unset
- Shell: /usr/bin/bash
- Install/channel: latest release (
/usr/bin/opencode) - Active plugins: none found (no plugin entries in global config; no local
.opencode/pluginor.opencode/plugins)
Reproduction
-
Create a non-Git project:
mkdir -p /tmp/opencode-nongit/src printf 'x\n' > /tmp/opencode-nongit/README.md printf 'y\n' > /tmp/opencode-nongit/src/a.ts cd /tmp/opencode-nongit -
Start
opencodeand type@/. -
The picker lists
src/,src/a.ts, etc., but has no/entry for the location root. There is nothing to select that represents the project directory. -
Query the API directly:
opencode api --standalone GET '/api/fs/find?query=/'Output contains no
{"path":"/","type":"directory"}:{"location":{"directory":"/tmp/opencode-nongit"},"data":[{"path":"src/","type":"directory"},{"path":"src/a.ts","type":"file"}]} -
Compare with a Git-backed location. After
git initand restarting, the same query includes the root, and selecting@/inserts@/and attaches the directory listing:{"data":[{"path":"/","type":"directory"},{"path":"src/","type":"directory"}, ...]}
Expected Behavior
@/ should list and select the location root in non-Git locations too, matching Git-backed locations and V1 behavior.
Actual Behavior
In a non-Git location, @/ has no project-root entry, so the project directory cannot be mentioned. GET /api/fs/find?query=/ omits the root.
Additional Context
-
Reproducible consistently on 2.2.5.
-
Root cause:
packages/core/src/filesystem/search.tsselects the fff backend only for VCS, non-home locations:return location.vcs && !Protected.isHome(location.directory) ? fffLayer : ripgrepLayerNon-Git locations use the ripgrep backend, whose directory index is built only from parent components of
rg --filesentries. The location root is never added. V1 selected fff for non-Git locations too, so this is a V2 regression. -
Related: #60293 / #60450 cover empty directories in the ripgrep index, but not the root. #60450 starts its walk at the root with
known=trueand only publishes provably empty child directories, so it will not add/. -
Workaround: temporarily
git initto force the fff backend; this is not a reasonable workaround.
- Lingua principale
- TypeScript
- Stelle
- 224k
- Fork
- 30k
- Merge medio
- 6h 12m
- PR unite (30g)
- 445
Preparare l'ambiente
- Nessun Dockerfile né 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 anomalyco/opencode
-
reproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
anomalyco/opencode#61627 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#61589 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
anomalyco/opencode#61587 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ai: openai-compatible-chat rejects reasoning delivered as an encrypted object (Iceman)Forse già presa @jimmyallinai l’ha presa oggi. Apertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anomalyco/opencode#61512 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anomalyco/opencode#61508 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
ai-driven-fuzzing bug Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
ai-driven-fuzzing bug claude Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
linagora/twake-calendar-frontend#1944 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Add: Yichang TVApertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
elecnix/pi-claude-memory#22 ·