Skip to content

fix(cli): accept auto/mps devices in pixelrag index build#73

Open
codysj wants to merge 1 commit into
StarTrail-org:mainfrom
codysj:fix/cli-device-choices
Open

fix(cli): accept auto/mps devices in pixelrag index build#73
codysj wants to merge 1 commit into
StarTrail-org:mainfrom
codysj:fix/cli-device-choices

Conversation

@codysj

@codysj codysj commented Jun 23, 2026

Copy link
Copy Markdown

Summary

pixelrag index build --device only accepts cpu/cuda, but the rest of the
stack supports auto/mps too: build() routes device in ("cpu","mps","auto")
to the local embedder, and embed_cpu declares choices=["auto","cpu","mps","cuda"].
So --device auto (the smart default) and --device mps fail at argparse with
"invalid choice" even though they'd work.

Config (device: auto in pixelrag.yaml) is unaffected, this only fixes the CLI
override flag, which currently can't express the values the config can.

Changes

  • Widen --device choices to auto, cpu, mps, cuda to match build()/embed_cpu.
  • Add a CLI smoke test asserting the rendered choices token.

Testing

  • uvx ruff check . / uvx ruff format --check .
  • uv run pytest tests/test_cli.py -v

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@codysj is attempting to deploy a commit to the andylizf's projects Team on Vercel.

A member of the Team first needs to authorize it.

@andylizf andylizf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks — the --device choices fix is correct and needed (auto/mps work downstream but argparse rejects them).

However, this PR is based on an older main and its diff reverts 10+ recently-merged PRs (~680 lines of unrelated regressions: removes --cdp-url, --user-data-dir isolation, pre-commit hooks, non-numeric ID fix, agent timeouts, version bump, etc.).

Could you rebase onto the latest origin/main? The fix itself is just pipelines.py (the choices line) + the new test — everything else should drop away after rebase.

git fetch upstream main
git rebase upstream/main
git push --force-with-lease

@codysj codysj force-pushed the fix/cli-device-choices branch from 0861720 to 2779740 Compare June 23, 2026 04:53
@codysj

codysj commented Jun 23, 2026

Copy link
Copy Markdown
Author

Rebased onto latest main, diff is now just the --device choices line + the CLI test. Thanks for the catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants