Skip to content

Add searchable Pi model picker to interactive setup - #17

Merged
alejandro-ao merged 1 commit into
mainfrom
feat/model-picker
Oct 1, 2026
Merged

alejandro-ao merged 1 commit into
mainfrom
feat/model-picker

Conversation

@alejandro-ao

Copy link
Copy Markdown
Owner

$## Summary\n- Read models from the configured Pi executable and agent directory and offer fuzzy-search selection in interactive init/configure.\n- Keep the previous selection on empty input, support explicit default reset, and fall back to manual entry when Pi model listing is unavailable.\n- Keep scripted --model unchanged and document selection, authentication caveat, and fallback.\n\n## Verification\n- Python 3.11/3.14: ruff, mypy, pytest, uv build.\n- compileall and git diff --check.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 09:57
@alejandro-ao
alejandro-ao merged commit f48f651 into main Oct 1, 2026
3 checks passed

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Model completion mishandles separators, and existing agent-directory paths are not normalized consistently.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds an interactive, searchable Pi model picker while preserving scripted setup behavior.

Changes:

  • Queries Pi’s model catalog and provides fuzzy selection with manual fallback.
  • Supports preserving or resetting model defaults.
  • Adds tests, dependency updates, and documentation.
File Description
pi_gateway/​cli.py Implements catalog loading and model selection.
tests/​test_model_setup.py Tests picker, fallback, and reset behavior.
pyproject.toml Adds prompt-toolkit.
uv.lock Locks new dependencies.
README.md Documents interactive selection.
docs/​02-startup-and-cli-flow.md Updates setup flow documentation.
docs/​06-configuration-and-deployment.md Documents picker operation and fallback.
AGENTS.md Updates repository guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pi_gateway/cli.py
Comment on lines +275 to +276
if pi.get("agentDir"):
env["PI_CODING_AGENT_DIR"] = str(pi["agentDir"])
Comment thread pi_gateway/cli.py

print(f"\nSearch {len(models)} Pi models (type to filter; Tab/arrow keys to select).")
print(f"Current: {current or 'Pi default'}. Enter on empty to keep it; type 'default' to use Pi default.")
completer = FuzzyCompleter(WordCompleter(models, ignore_case=True))
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