singularity-forge/packages
Tom Boucher df269b3b00 feat: complete offline mode support (#2429)
* feat: complete offline mode support for local-only model setups

- Add isLocalModel() to detect localhost/127.0.0.1/0.0.0.0/::1/unix sockets
- Add isAllLocalChain() to verify all registry models are local
- Validate --offline flag rejects remote models with clear error
- Auto-enable PI_OFFLINE when all configured models are local
- Return dummy API key for local models to skip auth validation
- Filter web search results in offline mode (chat-controller + tool-execution)
- Add ECONNREFUSED/ENOTFOUND/ENETUNREACH to INFRA_ERROR_CODES for immediate
  failure (no retry) when network is intentionally unavailable
- Add comprehensive test suite (17 tests)

Fixes #2341

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(test): update infra-error test for new offline-mode error codes

The offline mode feature added ECONNREFUSED, ENOTFOUND, and ENETUNREACH
to INFRA_ERROR_CODES but the test still asserted size === 6. Update the
count to 9 and add detection tests for the three new codes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:35:45 -06:00
..
native feat(gsd): unified rule registry, event journal, journal query tool, and tool naming convention (#1928) 2026-03-21 18:47:41 -06:00
pi-agent-core fix(footer): display active inference model during execution (#1982) 2026-03-22 17:06:49 -06:00
pi-ai fix(pi-ai): restore alibaba-coding-plan provider via models.custom.ts (#2350) 2026-03-24 07:19:27 -06:00
pi-coding-agent feat: complete offline mode support (#2429) 2026-03-24 22:35:45 -06:00
pi-tui fix(tui): prevent freeze when using @ file finder (#1832) 2026-03-21 12:55:12 -06:00