fix(memory): harden TQMemory for client installs (stable project_id, index guard, timeout, preload, upgrade)#485
Merged
Conversation
… index_paths guard, timeout, model preload, upgrade reliability
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:3223: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
Unchanged: 5896 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
This was referenced Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Diagnosis on the owner server (osoba) found TQMemory silently stopped persisting on 2026-06-07. Root causes were not in the memory engine itself but in how the fork configures/uses it — and all of them reproduce on fresh client installs.
Fixes (5)
Stable project_id (
tqmemory_setup.py): setTQMEMORY_PROJECT_ROOT=HERMES_HOME(fallback~/.hermes) so the project bucket no longer tracks the process cwd. On prod, memory had fragmented across two buckets (/rootvs/root/.hermes). Back-filled on the repair path too, sohermes updateheals existing installs, not just fresh ones.index_paths bloat guard (
prompt_builder.py/ TQMEMORY_GUIDANCE): instruct the agent never toindex_pathshuge/system trees (/root,/home,/Users/admin,/tmp, whole repos). On prod an unbounded index of/rootproduced ~10k chunks that crashed the LanceDB re-sync and timed out the MCP.Per-server timeout 600s (
tqmemory_setup.pyentry): firstsemantic_searchloads a ~600MB embedding model and re-syncs can be slow; the global MCP default (300s) is left untouched.Embedding model preload (
setup-hermes.sh): best-effort pre-cache of the sentence-transformers model at install, so the firstsemantic_searchdoesn't time out pulling ~600MB from HuggingFace at runtime.Reliable upgrade past rev-pin (
tqmemory_setup.py):uv tool upgradere-resolves a rev-pinned receipt to the same rev and never advances (observed stuck at v0.17.0 on prod). Fall back touv tool install --reinstallagainst the unpinned spec when upgrade reports no change.Tests
tests/hermes_cli/test_tqmemory_setup.pyupdated for the new env/timeout contract — 22 passed; prompt-builder tests green.Generated from a live osoba diagnosis + fix session.