feat: implement conversation state management and persistence, enhance sidebar UI
This commit is contained in:
10
AGENTS.md
10
AGENTS.md
@@ -1,17 +1,18 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
- `main.py` wires the GTK `Application`; UI widgets live in `sidebar_window.py` and `message_widget.py`.
|
||||
- `main.py` wires the GTK `Application` and guards headless runs; UI widgets live in `sidebar_window.py` and `message_widget.py`.
|
||||
- `ollama_client.py` wraps streaming calls and threading helpers so GTK stays responsive.
|
||||
- Conversation state persists through `conversation_manager.py` and JSON files under `data/conversations/`; keep writes atomic.
|
||||
- Shared settings belong in `config.py` and styles in `styles.css`; prefer adding focused modules over bloating these.
|
||||
- Shared settings belong in `config.py`, styles in `styles.css`, and tooling defaults in `pyproject.toml`; prefer adding focused modules over bloating these.
|
||||
- Tests mirror the source tree under `tests/`, with fixtures in `tests/fixtures/` for reusable transcripts and metadata.
|
||||
|
||||
## Build, Test, and Development Commands
|
||||
- `python -m venv .venv && source .venv/bin/activate` — creates and activates the project’s virtual environment.
|
||||
- `pip install -r requirements.txt` — installs GTK, Ollama, and tooling dependencies.
|
||||
- `python main.py` — launches the sidebar in development mode; pass `--mock-ollama` when iterating without a local model.
|
||||
- `pytest` — runs the full test suite; combine with `pytest -k "conversation"` for targeted checks.
|
||||
- `python main.py` — launches the sidebar; requires a Wayland/X11 session.
|
||||
- `AI_SIDEBAR_HEADLESS=1 python main.py` — skips GTK startup for CI smoke checks.
|
||||
- `AI_SIDEBAR_HEADLESS=1 pytest` — runs the full test suite; combine with `-k "conversation"` for targeted checks.
|
||||
|
||||
## Coding Style & Naming Conventions
|
||||
- Use 4-space indentation and format with `black .`; avoid tab characters.
|
||||
@@ -23,6 +24,7 @@
|
||||
- Prefer `pytest` parameterized cases for conversation flows; store golden transcripts in `tests/fixtures/responses/`.
|
||||
- Name tests `test_<module>_<behavior>` (e.g., `test_conversation_manager_persists_history`).
|
||||
- Cover threading boundaries by mocking Ollama responses and asserting GTK updates via `GLib.idle_add`.
|
||||
- Use `AI_SIDEBAR_HEADLESS=1` when exercising tests or scripts in non-GUI environments.
|
||||
- Run `pytest --maxfail=1` before commits to catch regressions early.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
|
||||
Reference in New Issue
Block a user