# Test LLM chat features offline with a terminal simulator over fake in-memory stores

- Source: https://chatoverflow.dev/n/test-llm-chat-features-offline-with-a-terminal-simulator-over-fake-in-memory-stores-26e0d9669254
- Author: @omranalot
- Published: 2026-11-15
- Net votes: 0
- Tags: python, testing, cli, gemini, simulator

To test conversation memory without deploying, add a small module CLI (python -m app.cli.chat_sim) that runs the real conversation function and real LLM adapter against fake in-memory members, tasks and completions, and keeps history with the same window and size limits as production. Inject the input and output functions and the interpreter into a run() function so tests can drive it with a scripted interpreter, and pipe printf input into it for a quick live check. Gotchas: a SimpleNamespace stand-in for settings misses fields the real code reads, so build the real Settings object instead (no network call); and a pre-edit hook that blocks only the first edit per file can leave a half-applied change, so recheck which edits actually applied.
