Repository navigation
Conversation
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
3 times, most recently
from
April 29, 2026 06:53
0781ed8 to
0f1bee5
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
May 3, 2026 18:00
0f1bee5 to
e194376
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
May 8, 2026 18:00
e194376 to
764c9c7
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
2 times, most recently
from
May 22, 2026 18:00
4f35abb to
dbbcefe
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
June 5, 2026 18:00
50b1007 to
014f108
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
July 5, 2026 13:07
014f108 to
ef6e5e0
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
July 18, 2026 13:20
ef6e5e0 to
546a9d9
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
2 times, most recently
from
July 26, 2026 22:35
e000ed4 to
04f1bd1
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
August 7, 2026 21:17
04f1bd1 to
2f1431c
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
5 times, most recently
from
August 28, 2026 00:22
b490a58 to
f146b93
Compare
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
September 14, 2026 06:12
f146b93 to
3b38a4f
Compare
When a user types a project path in the new session screen, the path picker now shows filesystem directory suggestions fetched from the selected machine via `machineBash`. Suggestions are debounced (250ms), cached per (machineId, parentDir) pair for 10s, and filtered by the current typed prefix. Tapping a suggestion appends `/` so the user can keep drilling down. New hook: `useDirSuggestions(machineId, pathText)` Closes: slopus#44 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
The machine-level RPC no longer validates paths at all on main (`d1cdc796`), so these cases pinned a boundary that does not exist, and the PR changes no behaviour there. `pathSecurity.test.ts` is back to main's version. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
chphch
force-pushed
the
feat/44-filepath-autocomplete
branch
from
October 19, 2026 01:27
a8a0d57 to
b0ead3a
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asked for twice, and the live request is still open.
A note on #44, since it reads as resolved: it was closed on 2026-01-22 by merge commit 6e7c2a7, whose message is
Merge pull request #45 from CodingCanuck/vuln-restrict-file-access — Fix #44: Restrict file access in RPC handlers. That commit hardens RPC file access (pathSecurity.tsplus handlers, 5 files undercli/src) and has nothing to do with path autocomplete. ItsFix #44refers to an issue in that contributor's fork (the merge came from their PR #45), so it closed our #44 by number collision. The request itself was never addressed; #970 is the live one.Closes #970. (It was first requested in #44; see the note above.)
Live subdirectory autocomplete in the new-session Project path picker. As the user types a path, the picker lists matching subdirectories from the selected machine and shows them above the existing Recent list; tapping a suggestion appends
/so you can keep drilling down.How it works
Debounced 250 ms, with a per-
(machineId, resolvedParentDir)cache (10 s TTL). No network or disk hit when no machine is selected or the field is empty.Two details the feature depends on:
~is resolved before the shell sees it. Bash does not expand~inside double quotes, so passing the user's typed parent straight intols -1ap "${dir}"silently returns nothing for every~/…path, and~/…is what this field shows by default because it renders home-relative. The parent is resolved throughresolveAbsolutePath(parentDir, homeDir)(homeDircomes frommachine.metadata) before it reachesmachineBash, while the user-typed parent is preserved in the returnedfullPathso drill-down stays home-relative. The cache is keyed on the resolved parent so~/and/home/user/can't compete for one slot.The unrestricted machine-level RPC this depends on is already upstream.
apiMachine.tsused to validate incomingbashcalls againstprocess.cwd(), the directory the daemon happened to be started from (typically a project subdir).validatePaththen rejected any cwd outside that subtree, and autocomplete died the moment you typed~/or/Users/…. Upstream removed that boundary outright ind1cdc796(registerCommonHandlers(this.rpcHandlerManager, null)) for an unrelated symptom (worktree creation reporting Not a Git repository). This PR changes no behaviour there. It only adds a two-line comment recording that new-session autocomplete depends on the RPC staying unrestricted, so that a future re-sandboxing does not silently break it.The pure split/resolve logic lives in
useDirSuggestions.utils.tsso it is unit-testable; the hook itself transitively imports react-native through@/sync/ops, which the test environment can't parse.Proof
Real
happy-clidaemon, no mocks: standalonehappy-server(PGlite) + Expo web + a paired daemon started from a deep subdirectory of$HOME— the cwd that broke autocomplete before upstream lifted the machine-level path boundary.Frames: empty
~→~/ha(narrowed tohappy*worktrees) →~/happy-(full worktree list). Every suggestion comes from a realls -1apover the WebSocket RPC. The daemon log confirmsls -1ap "/home/hyunwoojung/"ran withcwd: '/home/hyunwoojung'and returnedsuccess: true, stdoutLen: 1565— i.e. path validation now allows targets outside the daemon's launch directory.Scope
App + CLI. No new dependencies, no server or schema change.
useDirSuggestions.ts/.utils.ts— the hook and its pure helpersnew/index.tsx—machineIdthreaded to all threePathPickerContentcall sites (including the native mobile picker;machineIdis optional, so omitting it type-checks and would have quietly disabled autocomplete on native)apiMachine.ts— a two-line comment only; the boundary itself is upstream's (d1cdc796), and no behaviour changes hereNot covered: on phones a new-session tap now opens the home dock first, and its Enter custom path… prompt (
HomeDock.tsx) stays a plain text field. Autocomplete there would be a follow-up.Verification
On this head, rebased onto
mainat24d340d, typecheck is clean for app, cli and server, and the CLI suite passes (997 tests). The app suite passes with its 11 new cases apart from two files that fail onmainitself:sessionPresentation.test.ts(does not load,__DEV__ is not defined; #1864 fixes it) andmessageMeta.test.ts(still expects the old Codex default; #1891 fixes it). The CLI Smoke Test'ssmoke-test-linux (20)job fails on every PR that touches the CLI since 2026-10-15, because npm 10 (the npm Node 20 ships) crashes on a vitest peer-version mix that has nothing to do with this change; #1905 fixes it.useDirSuggestions.spec.tshas 11 cases: tilde paths (~/proj,~/projects/hap,~/, bare~), absolute paths, relative/no-slash input, missinghomeDir(machine offline), and a Windows-stylehomeDirseparator.