|
navi: a token count that matches the model, a type for every file, and a socket that admits it is dead
Compression decided everything in chars // 3, and on this workload that sits ~1.8x below reality — 101k real prompt tokens against a ~56k estimate — so the trigger, the target, the truncate budgets and the pre-call size check all ran in a unit half the size of the real one. TokenCalibration now fits overhead + chars / chars_per_token per model from the prompt_eval_count that every call already reports, and a profile declares its own context_window (sent to Ollama as num_ctx) instead of every model being held to OLLAMA_NUM_CTX. Superseded summaries were never demoted in the database: save() only updates flags for rows in session.messages, a summary is is_display=False, so it lived in session.context alone and every reload resurrected it — prod sessions carried up to 15 live summaries. PgSessionStore.set_context_flag() writes the flip for those rows directly. Five extension tables disagreed about what a file is. navi/content_types.py is the one detector — signature, then extension, then a text probe — it decides the MIME the download route serves, and the session file list now carries the type the viewers branch on. The idle receive loop answers client pings and sends its own heartbeat. A half-open socket keeps readyState at OPEN and never fires close, so traffic coming back is the only proof the connection still works. |
|---|
|
|
| docs/agent.md |
|---|
| docs/api.md |
|---|
| docs/mechanics.md |
|---|
| docs/profiles.md |
|---|
| docs/sessions.md |
|---|
| docs/websocket.md |
|---|
| manuals/content_publish.md |
|---|
| manuals/share_file.md |
|---|
| navi/api/routes/sessions.py |
|---|
| navi/api/websocket.py |
|---|
| navi/content_store.py |
|---|
| navi/content_types.py 0 → 100644 |
|---|
| navi/core/agent.py |
|---|
| navi/core/compressor.py |
|---|
| navi/core/pg_session_store.py |
|---|
| navi/core/session.py |
|---|
| navi/core/token_calibration.py 0 → 100644 |
|---|
| navi/llm/fallback.py |
|---|
| navi/llm/ollama.py |
|---|
| navi/profiles/base.py |
|---|
| navi/session_files.py |
|---|
| navi/tools/content_publish.py |
|---|
| navi/workers/compressor.py |
|---|
| tests/conftest.py |
|---|
| tests/integration/test_websocket.py |
|---|
| tests/unit/api/test_session_files.py |
|---|
| tests/unit/core/test_compressor.py |
|---|
| tests/unit/core/test_pg_session_store.py |
|---|
| tests/unit/test_content_store.py |
|---|
| tests/unit/test_content_types.py 0 → 100644 |
|---|
| tests/unit/test_token_calibration.py 0 → 100644 |
|---|
| tests/unit/tools/test_content_publish.py |
|---|
| tests/unit/workers/test_compression_worker.py |
|---|