Skip to content

Add completion spec: pkill - #300

Merged
acarl005 merged 1 commit into
mainfrom
factory/app-5192-command-spec-pkill
Aug 5, 2026
Merged

Add completion spec: pkill#300
acarl005 merged 1 commit into
mainfrom
factory/app-5192-command-spec-pkill

Conversation

@warp-agent-staging

Copy link
Copy Markdown
Contributor

Problem

pkill <TAB> in Warp offers filesystem paths instead of running process names — reported in warpdotdev/warp#10924.

pkill has no command signature, so Warp's argument completer has nothing to complete against and falls back to CompletionsFallbackStrategy::FilePaths. Every other process-signalling command in this repo (kill, killall) already has a spec, which is why they behave correctly.

Fix

  • command-signatures/json/pkill.json — new spec. The positional pattern argument is driven by a process_name generator, and the option set covers both procps-ng (Linux) and BSD/macOS pkill, with platform-only flags marked in their descriptions. --signal completes signal names and -u/-U complete user names; -F/--pidfile uses the filepaths template (the one place a path really is wanted).
  • command-signatures/src/generators/pkill.rs — registers process_name, signal_name, and user_name for pkill.
  • command-signatures/src/generators/common.rskillall's process-name generator and kill's signal-name generator move here, since pkill now shares both. AGENTS.md / the add-command-spec skill require generators used by more than one command to live in common.rs.

The shared process_names parser is stricter than the one it replaces: it suppresses the ps header (ps -A -o comm=, with a header filter for the ps implementations that print one anyway), reduces macOS's absolute executable paths to basenames, keeps Linux's already-bare names, and de-duplicates by name. The old killall parser only emitted lines containing /, so it produced no suggestions on Linux; killall picks that fix up here.

pgrep has the same missing-signature problem but is out of scope for this ticket.

Verification

script/presubmit (prettier check, cargo fmt --check, cargo clippy -D warnings, cargo test) — passes, 82 tests, 0 failures.

Regression tests in command-signatures/src/generators/pkill_tests.rs:

  • test_pkill_pattern_argument_completes_process_names — asserts the bundled pkill signature's first positional argument uses the process_name generator and offers no path template. Confirmed failing before the fix: with json/pkill.json removed the test fails with pkill signature should be bundled, and it passes with the spec in place.
  • test_pkill_registers_the_generators_its_spec_references, plus parser tests for macOS-style paths, Linux-style bare names, header/blank/duplicate filtering, and empty output.

The generator pipeline was also run directly in the verification environment (ps -A -o comm= | sort -u), which returns bare process names with no header row.

Visual (UI) proof is not attached and is outstanding. Exercising the completion menu requires a full Warp client build against a path override of this crate, and this task scopes the client repo to the follow-up PR below. The rendered pkill <TAB> menu should be captured on that PR, where the change actually becomes visible in the client.

Follow-up: this PR must merge first

A companion PR in warpdotdev/warp will bump the pinned warp-command-signatures git rev in Cargo.toml (currently a2ad4bfbb641eabc05412ebce6798f3c6530db5b) to this PR's merge commit. Merge this PR first; the client-side bump depends on the commit landing here.

Links

Conversation: https://staging.warp.dev/conversation/e5efc7bf-3937-4b34-b5d4-19bf26d4890d
Run: https://oz.staging.warp.dev/runs/019fd3e8-c360-7c50-8764-c317eb92d2e5

This PR was generated with Oz.

`pkill` had no command signature, so Warp's argument completer fell back to
filesystem paths instead of offering running process names (GH #10924).

Add a `pkill` spec whose pattern argument is driven by a process-name
generator, and move that generator (plus the signal-name generator `pkill`
reuses for `--signal`) into `common.rs`, per the repo's generator-reuse
convention. The shared process-name generator suppresses the `ps` header,
reduces macOS's absolute executable paths to basenames, keeps Linux's bare
names, and de-duplicates, so `killall` now also produces suggestions on Linux.

Co-Authored-By: Warp Agent <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Aug 5, 2026
@warp-agent-staging warp-agent-staging Bot added the warpy-factory Opened by the Warp factory agents label Aug 5, 2026
@warp-agent-staging
warp-agent-staging Bot requested a review from acarl005 August 5, 2026 22:43
@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review August 5, 2026 22:43
@oz-for-oss

oz-for-oss Bot commented Aug 5, 2026

Copy link
Copy Markdown

@warp-agent-staging[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a pkill command signature, registers dynamic generators for process names, signal names, and users, and refactors the existing kill/killall generator helpers into shared code. The tests cover the new signature wiring and the cross-platform process-name parser behavior.

Concerns

No blocking correctness, security, or spec-alignment concerns were found in the annotated diff. The attached spec context states that no approved or repository spec context was found for this PR.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@acarl005
acarl005 merged commit 4990fa1 into main Aug 5, 2026
8 checks passed
@acarl005
acarl005 deleted the factory/app-5192-command-spec-pkill branch August 5, 2026 22:52
acarl005 pushed a commit to warpdotdev/warp that referenced this pull request Aug 5, 2026
## Description
Dependency version bump: pinned `warp-command-signatures` rev
`a2ad4bfb…` → `4990fa1d4f5a9c74251c7330484a7ab6f3d38ac1`.

That rev is the merge commit of
[warpdotdev/command-signatures#300](warpdotdev/command-signatures#300),
which adds the `pkill` completion spec and its process-name generator.
`pkill` previously had no signature, so the argument completer fell
through to `CompletionsFallbackStrategy::FilePaths` and offered
filesystem paths (#10924). The bump also picks up the
sibling `killall` generator fix from the same PR.

The diff is `Cargo.toml` + `Cargo.lock` only. The `Cargo.lock` change is
limited to the two `warp-command-signatures` /
`warp-completion-metadata` source lines — a plain `cargo update -p`
additionally re-resolved unrelated `windows-sys`/`base64` pins, so those
two lines were applied directly instead.

## Linked Issue
- GitHub: #10924
- Linear:
[APP-5192](https://linear.app/warpdotdev/issue/APP-5192/pkill-tab-completes-filesystem-paths-instead-of-process-names-gh-10924)
- Picks up (merged):
[warpdotdev/command-signatures#300](warpdotdev/command-signatures#300)
- **Originating thread**:
https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785965967514419

## Testing
No test is added here by request — this is a version bump, and the
`pkill` completion behavior is covered by command-signatures#300's own
tests in that repo (a signature-level regression test plus generator
parser tests, run under its `script/presubmit`).

Checks run against the bumped rev in a Linux runner:
- `cargo metadata --locked` — **pass**; the lock is consistent with
`Cargo.toml` and the new rev resolves.
- `cargo check -p warp_completer --locked` — **pass**; the crate that
consumes `warp-command-signatures` builds against it.
- `cargo fmt -p warp_completer -- --check` — **pass**.

Not run: the full workspace build/test suite, and any GUI run. CI is the
backstop.

### Screenshots / Videos
No visual capture — scoped out with the test at the requester's
direction.

- [ ] I have manually tested my changes locally with `./script/run`

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: `pkill <TAB>` now suggests running process names
instead of filesystem paths.

<!-- factory-agent:
{"source":"factory-agent","task_id":"APP-5192","task_source":"linear","task_url":"https://linear.app/warpdotdev/issue/APP-5192/pkill-tab-completes-filesystem-paths-instead-of-process-names-gh-10924","oz_run_id":"019fd3e8-c360-7c50-8764-c317eb92d2e5","repo":"warpdotdev/warp"}
-->

_Conversation:
https://staging.warp.dev/conversation/e5efc7bf-3937-4b34-b5d4-19bf26d4890d_
_Run:
https://oz.staging.warp.dev/runs/019fd3e8-c360-7c50-8764-c317eb92d2e5_

_This PR was generated with [Oz](https://warp.dev/oz)._

Co-authored-by: Warp Agent <agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed warpy-factory Opened by the Warp factory agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants