Skip to content

fix: support offline model catalog startup - #88

Merged
LeXwDeX merged 4 commits into
devfrom
fix/offline-startup
Jul 9, 2026
Merged

fix: support offline model catalog startup#88
LeXwDeX merged 4 commits into
devfrom
fix/offline-startup

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • make models.dev catalog fetch failures non-fatal and publish a degraded-state event
  • embed models.dev api.json during release packaging so single binaries start in air-gapped environments
  • redirect TUI console output to the log file while the renderer owns the terminal, and show a safe warning toast for catalog fetch failures

Verification

  • ./packages/sdk/js/script/build.ts
  • bun typecheck (packages/core)
  • bun typecheck (packages/opencode)
  • bun typecheck (packages/tui)
  • bun turbo typecheck (commit/push hook)
  • bun test test/models-dev.test.ts test/plugin/models-dev.test.ts (packages/core)
  • bun test test/provider/provider.test.ts (packages/opencode)
  • bun test test/session/prompt.test.ts (packages/opencode)
  • openspec validate fix-offline-startup
  • release-fork.yml YAML parse
  • source offline smoke: OPENCODE_MODELS_URL=http://127.0.0.1:9 + missing OPENCODE_MODELS_PATH debug command
  • single build smoke with MODELS_DEV_API_JSON and generated binary --version
  • generated binary offline smoke command

Notes

  • Windows offline smoke was not run locally because this machine is macOS; the release workflow includes windows build coverage.
  • OpenSpec planning files are under ignored openspec/ and are not included in this PR.

LeXwDeX and others added 4 commits July 5, 2026 21:36
Merge pull request #81 from LeXwDeX/release/sync-main-into-dev
docs: merge README bilingual update into main
chore(deps): bump @opentui/* from 0.4.2 to 0.4.3
@LeXwDeX
LeXwDeX merged commit 9cf3273 into dev Jul 9, 2026
4 checks passed
@LeXwDeX
LeXwDeX deleted the fix/offline-startup branch July 9, 2026 00:31
LeXwDeX added a commit that referenced this pull request Jul 10, 2026
Three improvements for offline / restricted-network startup that are not
covered by the already-merged offline-catalog PRs (#88-#91):

1. Plugin SDK offline bundling: build.ts copies the plugin source into a
   vendored directory next to each binary. At runtime npm.install resolves
   @opencode-ai/plugin via three-tier fallback — project-local > bundled
   copy > registry — so plugin installs succeed without network access.

2. dependencyVersion(): only pin the version on stable latest releases
   (channel=latest + pure semver x.y.z). Fork/prerelease/local builds get
   undefined so the install doesn't request a non-existent registry version.

3. Reference offline degradation: only register a Git reference when its
   cache directory actually exists, and update the entry after a successful
   refresh. Missing references are omitted instead of carrying a stale path.
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