web: adding a new project for a dashed folder name falls back to "/" project
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- frontend
Rechercherichtung
Start by reading packages/app/src/pages/session.tsx, which the issue identifies as decoding the dir URL parameter and falling back to the server directory. Trace how the web UI encodes and sends the selected project path, then check the related tests or add-project flow for coverage. Done when a dashed directory opens as its own project and no / project is created.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Adding a brand-new project folder to the web UI via "new project" silently lands on the root / project instead of the requested directory. Reproduced with a folder whose name contains a dash (~/doom-scroller); an otherwise-identical no-dash control folder works on the first try. Impact: new projects with dashed names cannot be created from the web UI at all, and a stray / project is left behind that the API cannot delete.
Environment
- opencode version: v2.2.5 (pacman package
opencode 2.2.5-1.1, Arch/CachyOS official build) - OS: Linux 7.3.1-1-cachyos x86_64
- Terminal: Browser web UI (served by
opencode serve --port 4096 --hostname 0.0.0.0running as a systemd user service with noWorkingDirectory=, so the server process CWD is/) - Shell: /bin/fish
- Install/channel: release (official repo package)
- Active plugins: none configured
Reproduction
- Start the server:
opencode serve --port 4096 --hostname 0.0.0.0(e.g. systemd user unit; no WorkingDirectory set). - Create a new directory with a dash in the name:
mkdir ~/doom-scroller(tried both plain and aftergit init— same result). - Open the web UI and try to add
~/doom-scrolleras a new project. - Observe: the root project
/is added/activated instead; nodoom-scrollerproject entry is ever created inGET /api/project. - Control:
mkdir ~/Music(no dash, also not a git repo) and add via the same flow → works immediately, project entry created.
Expected Behavior
The web UI creates/opens a session on a project for the directory the user chose (/home/<user>/doom-scroller).
Actual Behavior
The root project / (the server process's CWD) is added/activated instead — one second after the server momentarily initialized the correct directory. The requested project never appears in the project picker.
Additional Context
Server journal (journalctl --user -u opencode-web) shows the correct path arriving, then a fallback one second later:
12:04:50 INFO spawning process { ... cwd: "/home/<user>/doom-scroller" } # correct — UI sent the right path
12:04:51 INFO spawning process { ... cwd: "/" } # 1s later — fell back to server CWD
12:05:32 INFO spawning process { ... cwd: "/home/<user>/Music" } # no-dash control — success
Suspected mechanism, matching previously reported issues:
- #12918 identified
packages/app/src/pages/session.tsxdoingconst projectDirectory = decode64(params.dir) ?? sdk.directory— when the base64 URL parameter fails to decode, it silently falls back to the server's base directory. - #14445 / #6336:
opencode serveuses/as its base directory — which is exactly where this bug lands. - #18593 / #15719: other users report the same stray
/"ghost" project in the picker;GET /api/projectexposes only GET + PATCH (no delete), so it cannot be cleaned up via API either.
Frequency: consistent — failed on 3+ attempts with the dashed folder (git and non-git); the no-dash control succeeded on the first attempt every time. The dash is inferred from this A/B comparison (one dashed vs one no-dash folder); other special characters not tested.
Workaround that works reliably: start any session in the directory once from the CLI (cd ~/doom-scroller && opencode run "hi") — the project is registered server-side and immediately appears and works in the web UI picker.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 225k
- Forks
- 30.4k
- Ø Merge
- 4 Std. 16 Min.
- Gemergte PRs (30 T.)
- 528
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus anomalyco/opencode
-
reproduced
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 61/100
anomalyco/opencode#62873 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anomalyco/opencode#62822 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
anomalyco/opencode#62601 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
reproduced
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anomalyco/opencode#62516 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
anomalyco/opencode#62374 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in anomalyco/opencode
Ähnliche Issues
-
code-quality good-first-issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
OpenRailAssociation/netzgrafik-editor-frontend#1481 ·
Maintainer antworten meist innerhalb von 1 Tag
-
🙌 icon request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
lucide-icons/lucide#5183 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 81/100
cloudflare/capnweb#293 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug implicit-state
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
-
area:models enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag