Skip to content

[FEATURE]: Full air-gapped / offline mode support – disable all non-LLM network access #16117

Closed as duplicate

Description

@xpat07

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem:

Many enterprise, government, defense, and high-security environments require fully air-gapped deployments where the application can only make network calls to an internal/local LLM endpoint (e.g. Ollama, vLLM, TGI, or a private OpenAI-compatible gateway at http://internal-llm:8000/v1).

Currently, OpenCode performs several unconditional network fetches on startup / during usage, even when using purely local models:

  • Fetch to https://models.dev/api.json (for model/provider discovery) → fails or hangs in no-internet setups
  • Potential telemetry / update checks (Oh My OpenCode auto-update attempts)
  • Plugin/package manifest downloads (e.g. pyright LSP manifest errors in offline mode)
  • Possibly other fetches (e.g. AGENTS.md loading issues reported in offline envs)

Related existing issues (which are close but narrower in scope):

These show recurring pain in restricted networks, but no comprehensive "offline/air-gapped mode" exists yet.

Solution:

Add a robust offline / air-gapped mode that:

  1. Disables all non-LLM outbound network requests when enabled (except the configured baseURL for the model provider).

  2. Provides a single, clear toggle, e.g.:

    • Config key: "offline": true or "airgapped": true in opencode.json
    • Environment variable: OPENCODE_OFFLINE=1 or OPENCODE_AIRGAPPED=1
    • CLI flag: opencode --offline / opencode --airgapped
  3. When enabled, OpenCode should:

    • Skip the https://models.dev/api.json fetch entirely
    • Skip any auto-update / version checks (Oh My OpenCode, GitHub releases, etc.)
    • Skip external plugin/LSP manifest downloads
    • Skip loading remote resources (e.g. AGENTS.md if fetched remotely)
    • Fall back gracefully to locally available providers/models only (user-defined in opencode.json)
    • Optionally log a clear startup message:
      Air-gapped / offline mode enabled – all external network access disabled except LLM endpoint
  4. Bonus / nice-to-have (could be follow-ups):

Describe alternatives you've considered

  • Manual workarounds: firewall blocks + proxy tricks → unreliable and breaks startup
  • Patching the binary/source → high maintenance, not scalable for teams
  • Using only custom providers in opencode.json → doesn't prevent the models.dev fetch or other calls

Additional context

This is a common requirement in regulated industries (finance, healthcare, defense, government). A clean, supported offline mode would make OpenCode much more adoptable in these settings without needing heavy forks.

Many users already run successfully with local Ollama/vLLM once the startup fetches are bypassed, so the core engine works great offline — we just need the guardrails.

Thanks for considering this!

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 5, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 5, 2026
  3. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If this is intended as a broader/umbrella tracking issue, please consider commenting on or referencing those existing issues instead of opening a new one.

  4. navieSimple commented on Mar 6, 2026

    @navieSimple

    mark

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions