singularity-forge/packages/pi-coding-agent/src/modes
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
..
interactive feat: complete offline mode support (#2429) 2026-03-24 22:35:45 -06:00
rpc fix(memory): fix memory and resource leaks across TUI, LSP, DB, and automation (#2314) 2026-03-24 07:23:36 -06:00
shared refactor: deduplicate RPC mode shared patterns 2026-03-19 16:38:51 -03:00
index.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
print-mode.ts fix(memory): fix memory and resource leaks across TUI, LSP, DB, and automation (#2314) 2026-03-24 07:23:36 -06:00