Repository navigation
Memory json import - #2
Merged
Merged
Conversation
added 8 commits
February 4, 2025 10:59
This was referenced Nov 12, 2025
8 of 11 tasks
5 tasks done
This was referenced Feb 4, 2026
This was referenced Feb 10, 2026
This was referenced Feb 19, 2026
5 of 6 tasks
This was referenced Apr 13, 2026
2 of 3 tasks
phernandez
added a commit
that referenced
this pull request
May 29, 2026
Resolves the 8 self-review findings on PR #865: session-start.sh: - Wire recallTimeframe into a new "Recent sessions" query (--after_date) — it was parsed but unused after the Phase 4 rewrite. The brief now surfaces recent session checkpoints (the resume cursor), which is the one query the recency window legitimately applies to. (#1) - Guard secondaryProjects/teamProjects JSON types — a string value was iterated character-by-character into bogus per-char queries. (#3) - A configured-but-unreachable/misnamed primaryProject now emits a one-line "couldn't read" signal instead of a silent blank brief. (#7) pre-compact.sh: - Filter transcript turns by the `isMeta` and `toolUseResult` flags instead of a `text.startswith("<")` heuristic. This stops dropping legitimate user messages that start with "<" (#4) and stops capturing tool-result/meta frames as human turns (#8) — verified against a real transcript (25 human turns cleanly separated from 8 meta + 288 tool-result frames). - Title now uses second precision so rapid same-minute compactions don't collide and silently drop/overwrite a checkpoint; removed the unused stamp/slug. (#2) - Empty-checkpoint guard now requires at least one real user turn, not just any turn, so an assistant-only transcript can't produce a dangling-title note. (#5) validate_skills.py: - parse_frontmatter now skips indented lines, capturing only top-level keys, so a schema note's nested schema:/settings: children can't overwrite a top-level type/entity via last-write-wins. Documented its single-line-only limitation. (#6) All verified end-to-end; `just package-check-claude-code` and `package-check-skills` pass; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
added a commit
that referenced
this pull request
May 30, 2026
Resolves the 8 self-review findings on PR #865: session-start.sh: - Wire recallTimeframe into a new "Recent sessions" query (--after_date) — it was parsed but unused after the Phase 4 rewrite. The brief now surfaces recent session checkpoints (the resume cursor), which is the one query the recency window legitimately applies to. (#1) - Guard secondaryProjects/teamProjects JSON types — a string value was iterated character-by-character into bogus per-char queries. (#3) - A configured-but-unreachable/misnamed primaryProject now emits a one-line "couldn't read" signal instead of a silent blank brief. (#7) pre-compact.sh: - Filter transcript turns by the `isMeta` and `toolUseResult` flags instead of a `text.startswith("<")` heuristic. This stops dropping legitimate user messages that start with "<" (#4) and stops capturing tool-result/meta frames as human turns (#8) — verified against a real transcript (25 human turns cleanly separated from 8 meta + 288 tool-result frames). - Title now uses second precision so rapid same-minute compactions don't collide and silently drop/overwrite a checkpoint; removed the unused stamp/slug. (#2) - Empty-checkpoint guard now requires at least one real user turn, not just any turn, so an assistant-only transcript can't produce a dangling-title note. (#5) validate_skills.py: - parse_frontmatter now skips indented lines, capturing only top-level keys, so a schema note's nested schema:/settings: children can't overwrite a top-level type/entity via last-write-wins. Documented its single-line-only limitation. (#6) All verified end-to-end; `just package-check-claude-code` and `package-check-skills` pass; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
added a commit
that referenced
this pull request
May 31, 2026
Resolves the 8 self-review findings on PR #865: session-start.sh: - Wire recallTimeframe into a new "Recent sessions" query (--after_date) — it was parsed but unused after the Phase 4 rewrite. The brief now surfaces recent session checkpoints (the resume cursor), which is the one query the recency window legitimately applies to. (#1) - Guard secondaryProjects/teamProjects JSON types — a string value was iterated character-by-character into bogus per-char queries. (#3) - A configured-but-unreachable/misnamed primaryProject now emits a one-line "couldn't read" signal instead of a silent blank brief. (#7) pre-compact.sh: - Filter transcript turns by the `isMeta` and `toolUseResult` flags instead of a `text.startswith("<")` heuristic. This stops dropping legitimate user messages that start with "<" (#4) and stops capturing tool-result/meta frames as human turns (#8) — verified against a real transcript (25 human turns cleanly separated from 8 meta + 288 tool-result frames). - Title now uses second precision so rapid same-minute compactions don't collide and silently drop/overwrite a checkpoint; removed the unused stamp/slug. (#2) - Empty-checkpoint guard now requires at least one real user turn, not just any turn, so an assistant-only transcript can't produce a dangling-title note. (#5) validate_skills.py: - parse_frontmatter now skips indented lines, capturing only top-level keys, so a schema note's nested schema:/settings: children can't overwrite a top-level type/entity via last-write-wins. Documented its single-line-only limitation. (#6) All verified end-to-end; `just package-check-claude-code` and `package-check-skills` pass; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
This was referenced Jun 5, 2026
phernandez
added a commit
that referenced
this pull request
Jun 7, 2026
…use tests Address claude-review nits and the Windows SQLite Integration CI failure on PR #903 (fix/embedding-provider-reuse): - sync_service.get_sync_service: forward the in-scope app_config to create_search_repository so embedding-provider resolution uses that config instead of the ConfigManager() fallback. Still routes through the cached process-wide singleton (same config -> same cache key). - embedding_provider_factory.create_embedding_provider: document the intentional by-design TOCTOU double-construction window (build outside the lock; second check-and-set discards the loser) so the singleton contract is clear. - test-int/semantic/test_embedding_provider_reuse.py: switch the three tests from the parent engine_factory (which pulls the semantic conftest's Docker-gated postgres_engine -> pgvector_container, started whenever a docker binary is on PATH) to the SQLite-only sqlite_engine_factory + tmp_path. On Windows CI the docker binary exists without a usable daemon, so the parent factory aborted these SQLite-only tests with a testcontainers Ryuk error. Tests are now async and backend-correct. Note on review nit #2: semantic_embedding_model is a non-nullable str in BasicMemoryConfig (default 'bge-small-en-v1.5'), so the cache-key field-2 annotation 'str' is already accurate; no change needed (ty stays green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
added a commit
that referenced
this pull request
Jun 7, 2026
… path The self-heal introduced in this PR misclassified cold/transient model load failures as cache corruption, purged the in-progress download, and left the model unloadable for the whole session — breaking ~20 unrelated search integration tests in CI (cold model cache). Root cause: purge was driven purely by exception-text matching plus a bare subdir.exists() check, so a normal not-yet-downloaded model (or a transient 'from any source' download error) could trigger a destructive purge. Fixes: - Gate the purge on positive filesystem confirmation: the HF snapshot dir exists but the model artifact file (model_optimized.onnx) is missing from every snapshot. A cold load (no snapshot dir) is never treated as corrupt and never purges; the original error re-raises unchanged. - After a purge+retry that still fails, re-raise the ORIGINAL exception. - (Codex P2) Resolve the HF cache subdir case-insensitively, mirroring FastEmbed, so model='baai/bge-small-en-v1.5' still resolves correctly. - (claude-review #1) _purge_model_subdirs sets removed=True only when the subdir actually disappears after rmtree (Windows locked-file no-op safety). - (claude-review #2) Tighten the search error formatter ONNX marker from the broad 'load model' to the exact 'load model from' phrasing. - (minor) Document that TextEmbedding._list_supported_models() is an intentional undocumented-API use with a defensive fallback. Verified locally with the real model: a cold load downloads cleanly with no purge; a genuinely corrupt cache (snapshot present, artifact deleted) is detected, purged, and re-downloaded. Added regression tests for cold load, artifact-present non-purge, case-insensitive resolution, and locked-file rmtree no-op. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
added a commit
that referenced
this pull request
Jun 7, 2026
…use tests Address claude-review nits and the Windows SQLite Integration CI failure on PR #903 (fix/embedding-provider-reuse): - sync_service.get_sync_service: forward the in-scope app_config to create_search_repository so embedding-provider resolution uses that config instead of the ConfigManager() fallback. Still routes through the cached process-wide singleton (same config -> same cache key). - embedding_provider_factory.create_embedding_provider: document the intentional by-design TOCTOU double-construction window (build outside the lock; second check-and-set discards the loser) so the singleton contract is clear. - test-int/semantic/test_embedding_provider_reuse.py: switch the three tests from the parent engine_factory (which pulls the semantic conftest's Docker-gated postgres_engine -> pgvector_container, started whenever a docker binary is on PATH) to the SQLite-only sqlite_engine_factory + tmp_path. On Windows CI the docker binary exists without a usable daemon, so the parent factory aborted these SQLite-only tests with a testcontainers Ryuk error. Tests are now async and backend-correct. Note on review nit #2: semantic_embedding_model is a non-nullable str in BasicMemoryConfig (default 'bge-small-en-v1.5'), so the cache-key field-2 annotation 'str' is already accurate; no change needed (ty stays green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
added a commit
that referenced
this pull request
Jun 8, 2026
…ests) From the Codex and claude-review automated reviews on PR #917: - project_diff: fail fast on fatal `rclone check` errors. A non-zero exit with no combined listing (auth/network/missing-remote) previously produced an empty plan, so the transfer ran as a no-op and reported success. Now raises RcloneError with rclone's stderr. (Codex P2 / claude-review #2) - sync-setup "Next steps": stop pointing every user at the now-Personal-only `bm cloud sync`; lead with the Team-safe `pull`/`push` and note bisync is Personal-only. (claude-review #1) - Cosmetic: capitalize the push/pull abort headlines for consistency; document the two ConflictStrategy definitions (Typer enum vs engine Literal). (nits) - Tests: cover keep-local+pull and keep-cloud+push (preserve-destination cases), project_transfer aborting on a mid-loop conflict-copy failure, and project_diff raising on a fatal check error vs not raising on a normal differences exit. Signed-off-by: phernandez <paul@basicmachines.co>
4 tasks done
groksrc
added a commit
that referenced
this pull request
Nov 29, 2026
…be (#2169) ## Summary Fixes the intermittent Windows failure of `tests/mcp/test_hook_brief_search.py::test_session_start_never_imports_the_mcp_tool_stack`, which keeps `main` CI red on the Windows SQLite unit shards. The test was added for GitHub #2101. **Cause:** a cold first brief search on a loaded Windows runner takes 13–14 s. That is longer than the hook's 10 s budget (`QUERY_TIMEOUT_SECONDS`). The probe ran the search through `_query`, which applies that budget and reads any failure as `None`. So the timeout surfaced only as "the search did not run". The search itself does not raise. ## Evidence (Windows CI run) A temporary diagnostic commit (`48238a1e`, reverted in this PR) timed the search in fresh processes with fresh homes on the `windows-latest` Python 3.12 job. It ran each case idle, then while `pytest tests/mcp tests/services -n auto` ran alongside, to match the xdist load of the unit shards. Job log: https://github.com/basicmachines-co/basic-memory/actions/runs/46220757232/job/141214705707 ``` [idle #1] wall=6.43s rc=0 mode=query import_hook=0.49s search=5.22s outcome=ok [idle #1] wall=6.55s rc=0 mode=direct import_hook=0.47s search=5.35s outcome=ok [under xdist load #1] wall=14.51s rc=0 mode=query import_hook=0.47s search=13.31s outcome=returned None [under xdist load #2] wall=13.97s rc=0 mode=query import_hook=0.55s search=12.84s outcome=returned None [under xdist load #3] wall=14.38s rc=0 mode=query import_hook=0.48s search=13.18s outcome=returned None [under xdist load #4] wall=14.74s rc=0 mode=query import_hook=0.57s search=13.59s outcome=returned None [under xdist load #1] wall=14.74s rc=0 mode=direct import_hook=0.48s search=13.29s outcome=ok [under xdist load #2] wall=15.23s rc=0 mode=direct import_hook=0.54s search=13.79s outcome=ok [under xdist load #3] wall=14.67s rc=0 mode=direct import_hook=0.48s search=13.09s outcome=ok ``` - `mode=query` goes through `_query`; `mode=direct` calls `_search_notes`. - Idle, all six runs succeeded in about 5.2 s. - Under load, every `_query` run returned `None`. Every direct run succeeded, in 6.6–13.8 s. - No run raised an exception. ## Change - The probe now calls `hook._search_notes` directly, with no product timeout. It reports the search's time in stderr and lets any exception show its traceback. A 300 s subprocess timeout guards against a hang. - It still asserts that the search returned a result, and that `basic_memory.mcp.tools`, `basic_memory.mcp.server` and `fastmcp.server` are not loaded afterwards. - `.github/workflows/test.yml`: the PR-time `test-windows-platform` job now runs this test file. - No product code changes. `QUERY_TIMEOUT_SECONDS` and `_query`'s best-effort behaviour stay as they are. ## Checks run - `uv run pytest tests/mcp/test_hook_brief_search.py` on macOS: 3 passed. - The test still fails when the import boundary breaks. I temporarily added `import basic_memory.mcp.tools` to `_search_notes`, and the test failed with `AssertionError: ['basic_memory.mcp.tools', 'basic_memory.mcp.server', 'fastmcp.server']`. Reverted. - The test still fails when the search doesn't run. I temporarily made `_search_notes` raise before searching, and the test failed and showed the `RuntimeError` traceback. Reverted. A `None` or non-dict result also fails its `isinstance` assertion. - "Windows path and checksum regressions (Python 3.12)" passed on the diagnostic push, with this file included (122 passed). ## Not verified yet The full Windows unit shards run only on `main`. Whether this test passes in 3 consecutive `main` runs can be checked only after the merge. Product note: an idle Windows runner needs about 5 s for a cold first search, which fits the 10 s budget. A heavily loaded Windows machine could get an empty brief on its first SessionStart. That is the intended best-effort behaviour, so it is not changed here. Ticket: BMEM-173. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Drew Cain <groksrc@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Add tool to import json from server-memory mcp tool in json format