fix(cli): make dynamic session completion local-only #58
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!58
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/completion-local-only-42"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #42.
The fish and zsh dynamic-completion overlays forwarded the in-flight
--host/--ssh-argtokens to the hidden__complete-sessionshelper, sopressing
<TAB>on a session-id slot with an SSH destination on the commandline started a real
sshchild. That child has no felis-side deadline(transport timeouts belong to OpenSSH) and inherits the tty for password and
host-key prompts, so an unreachable host or a prompt blocked the user's
interactive shell inside a completion function. It also contradicted
control-surfaces.md, which already documented the helper as local-only.The overlays now forward only
--socket(a retarget's--to-socket) andemit nothing when the source or retarget target is an SSH destination;
destination slots keep the shell's own host completer. The binary enforces
the same rule twice — in dispatch and in
run_complete_sessions— because acompletion script generated by an older build keeps forwarding
--hostuntil the user regenerates it. A short hard timeout plus
BatchMode=yesanda roster cache was considered and rejected: felis would be choosing ssh
policy that belongs to the user's own ssh config.
A follow-up commit fixes an adjacent completion gap: the fish/zsh retarget
table only skipped
--format's value inconsistently, soretarget --to-socket X --format json --session <TAB>offered nothing.Another keeps the new completion test helpers off non-unix builds so the
crate still compiles there.
Doc cascade:
docs/explanation/...records the local-only shell-completion contractand the "no felis-side ssh deadline" design decision (rejected
alternatives included), matching
control-surfaces.md.CHANGELOG.md's Unreleased entry is trimmed to the slot-coverage and--socketbehavior instead of describing the supersededremote-forwarding contract.
Tests drive the generated fish/zsh overlays through the real interpreters
(fish via
complete -C, zsh by sourcing underzsh -f) against arecording
felisstub, skipping when the shell binary is unavailable; thedev shell now carries fish and zsh so CI runs them. The e2e suite pins that
an SSH destination on the line exits 0 with no candidates and never spawns
an
sshstub.Verified:
just checkgreen (fmt, clippy, nextest — 3018 passed / 15skipped, deny); pi review unavailable (the openai-codex provider is
currently returning
Not Foundfor every model on this account).control-surfaces.md rejects a felis-side completion timeout by pointing at "transport timeouts belong to OpenSSH", but no page recorded that decision, so the citation dangled. architecture/ipc.md now carries it inline (OpenSSH's config owns connection timeouts, and a felis-side timer would fire under a password or host-key prompt the inherited tty is still delivering) with its revisit trigger, and reference/ipc.md states the resulting fact. The same pages narrated the installed-script migration ("a script from an older build") that CHANGELOG.md already carries; docs describe the present contract only, so the sentences now state why the binary applies the rule to its own arguments (a completion script is regenerated only by rerunning `felis completions`), and the dashes the prose norms thin out are gone. reference/testing.md argued why the overlay tests run the real fish and zsh; the reference lane states facts, so the argument (a string assertion pins the script's text, not what the shell does with it) moves to explanation/testing.md and the reference page links to it. Refs #42 Assisted-by: Claude Code