fix: allow extension to load when offline - #27
Merged
Conversation
The model fetch at startup throws and blocks pi from starting when there's no network. Catch the error and register the provider with an empty model list instead.
k3-2o
force-pushed
the
fix/offline-startup
branch
from
July 23, 2026 10:19
71f853a to
811f908
Compare
Author
StrayDragon
added a commit
to StrayDragon/pi-commandcode-provider
that referenced
this pull request
Jul 31, 2026
Persist the last valid Command Code model catalog and use it when live model discovery fails. Keep first-time offline startup non-fatal, surface clear warnings, and cover cached model selection with unit and pi integration regression tests.
Owner
|
I reproduced the startup failure against both pi 0.75.5 and 0.82.1 by pointing I pushed follow-up changes that make the fallback useful when Command Code is already selected:
Validation:
|
Resolve the Command Code model cache through the host's getAgentDir helper so pi, OMP, and PI_CODING_AGENT_DIR use their own agent state directory instead of the official Command Code client directory.
Resolve GHSA-j3f2-48v5-ccww so npm audit --audit-level=moderate passes in CI.
Assert the empty catalog path recovers live models and writes a cache once discovery is available again, including the real pi extension entrypoint used by /reload.
patlux
approved these changes
Aug 2, 2026
patlux
left a comment
Owner
There was a problem hiding this comment.
Looks good.
Offline discovery no longer blocks pi startup, last-known-good models stay selectable from the host agent-dir cache, recovery after an empty offline start is covered, and CI is green after the protobufjs lockfile bump.
Owner
|
Shipped in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Pi refuses to start when offline because
fetchCommandCodeModels()at extension init throws when it can't reach the API. This blocks the entire editor with:Trade-off
Models won't appear in the model selector until the user runs
/reloadafter reconnecting. This is documented in the changelog.Testing
/reloadrepopulates models when online