Skip to content

fix: sync model catalog with Pi 1.4 and improve /model discovery - #34

Open
Devendurance wants to merge 1 commit into
benedict2310:mainfrom
Devendurance:fix/model-registry-1.4.0
Open

Devendurance wants to merge 1 commit into
benedict2310:mainfrom
Devendurance:fix/model-registry-1.4.0

Conversation

@Devendurance

Copy link
Copy Markdown

Summary

TelePi /model was showing a stale catalog: the bridge resolved models from an older Pi SDK while Pi CLI 1.4.0 already serves refreshed models-store.json data (e.g. opencode-go/muse-spark-1.3-contributor, openai-codex/gpt-6*). This syncs Telegram discovery with the installed Pi CLI catalog.

  • Bump @earendil-works/pi-agent-core, pi-ai, pi-coding-agent from ^0.86.1 to ^1.4.0 (same org, compatible ModelRegistry/ModelRuntime API surface; verified against Pi CLI 1.4.0).
  • Telegram listModels() now uses ModelRuntime.getAvailable() against the same ~/.pi/agent/models-store.json + auth filtering as pi --list-models (verified parity: 127 authenticated models).
  • Add grouped/searchable /model:
    • /model shows Providers: openai-codex (7) • opencode (83) • opencode-go (33) • xai (4) matching CLI counts.
    • /model <provider or text> filters (e.g. /model opencode-go, /model openai-codex, /model muse-spark).
    • Show all models preserved and filter-aware.
  • Persist selection via settingsManager.setDefaultModelAndProvider() so it survives /new sessions and TelePi restarts (best-effort, never breaks in-memory switch).

Relation to open PR #33

PR #33 (chore: upgrade Pi SDK to 1.0.0 by @TiaraBasori) does the SDK bump 0.86.1 → 1.0.0 only (package + lock + pin test). This extends beyond it:

Test evidence (actually executed)

  • npm ci — clean (251 packages).
  • npm run build — tsc clean.
  • npm test — 33 files, 455 passed, 1 skipped, 0 failed.
  • npm run test:coverage — Statements 86.76%, Branches 80.71%, Functions 90.33%.
  • Live parity check (not committed, read-only): deployed build listModels(true) = 127, byProvider {openai-codex:7, opencode:83, opencode-go:33, xai:4} matches pi --list-models; muse-spark-1.3-contributor present; setModel → newSession retains YES; restart (new service) retains YES.
  • Auth distinction preserved: openai 42 models exist in getAll() but openai is not_ready (pi auth check), so correctly absent from available set — no fabricated availability.

Disclosure

This work was developed with AI assistance and reviewed/tested by the contributor (@Devendurance), subject to the repository’s disclosure conventions.

Risk / rollback

Docs + SDK + picker only; no systemd unit, config, auth, sessions, or workspace changes. Service restart verified separately in local deploy; this PR does not touch production.

Upgrade Earendil Pi SDK ^0.86.1 to ^1.4.0 so Telegram uses the same
ModelRuntime and models-store.json as Pi CLI 1.4.0, restoring missing
openai-codex and opencode-go models including muse-spark-1.3-contributor.

Add /model provider filtering (/model <provider or text>), provider
counts matching pi --list-models, and persist selection as Pi default
so it survives /new sessions and restarts. Preserve Show all models.

Add regression coverage for discovery, auth filtering, provider IDs,
switching, and session preservation.
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.

1 participant