fix(cli): prevent TypeError when retrieval_time_ms is null in daemon recall - #101
fix(cli): prevent TypeError when retrieval_time_ms is null in daemon recall#101barrygfox wants to merge 1 commit into
Conversation
9903a73 to
880649a
Compare
880649a to
b16164e
Compare
…rd fallback
Root cause fix: Add retrieval_time_ms=0 to _recall_keyword_fallback() response.
The keyword fallback path was missing this field entirely, which caused CLI
formatting to crash when attempting f"{None:.0f}ms".
Also fix score formatting for keyword fallback results (which have score=None)
by applying the same defensive or-0 pattern.
Fixes TypeError: unsupported format string passed to NoneType in cmd_recall
when the daemon returns a response with null/missing retrieval_time_ms.
b16164e to
22681d2
Compare
… SLM 3.8.11 release Brings in the accumulated post-3.8.10 Windows hardening series (admission deadline, contention, adapter sync, capture ACL enforcement) plus the 3.8.11 release commit fixing issues #102, #103 and merging PR #101. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> # Conflicts: # CHANGELOG.md # CITATION.cff # README.md # codex-plugin/AGENTS.md # codex-plugin/README.md # codex-plugin/_GENERATED.md # codex-plugin/skills/slm-cache/SKILL.md # codex-plugin/skills/slm-compress/SKILL.md # codex-plugin/skills/slm-governance/SKILL.md # codex-plugin/skills/slm-graph/SKILL.md # codex-plugin/skills/slm-loop/SKILL.md # codex-plugin/skills/slm-mesh/SKILL.md # codex-plugin/skills/slm-profile/SKILL.md # codex-plugin/skills/slm-recall/SKILL.md # codex-plugin/skills/slm-remember/SKILL.md # codex-plugin/skills/slm-scope/SKILL.md # codex-plugin/skills/slm-session/SKILL.md # codex-plugin/skills/slm-status/SKILL.md # copilot-plugin/.github/agents/slm-governance-advisor.agent.md # copilot-plugin/.github/agents/slm-loop-runner.agent.md # copilot-plugin/.github/agents/slm-memory-advisor.agent.md # copilot-plugin/.github/agents/slm-optimize-advisor.agent.md # copilot-plugin/.github/copilot-instructions.md # copilot-plugin/.github/prompts/slm-cache.prompt.md # copilot-plugin/.github/prompts/slm-compress.prompt.md # copilot-plugin/.github/prompts/slm-governance.prompt.md # copilot-plugin/.github/prompts/slm-graph.prompt.md # copilot-plugin/.github/prompts/slm-loop.prompt.md # copilot-plugin/.github/prompts/slm-mesh.prompt.md # copilot-plugin/.github/prompts/slm-profile.prompt.md # copilot-plugin/.github/prompts/slm-recall.prompt.md # copilot-plugin/.github/prompts/slm-remember.prompt.md # copilot-plugin/.github/prompts/slm-scope.prompt.md # copilot-plugin/.github/prompts/slm-session.prompt.md # copilot-plugin/.github/prompts/slm-status.prompt.md # copilot-plugin/README.md # copilot-plugin/_GENERATED.md # package-lock.json # package.json # plugin-src/agents/slm-governance-advisor.md # plugin-src/agents/slm-loop-runner.md # plugin-src/agents/slm-memory-advisor.md # plugin-src/agents/slm-optimize-advisor.md # plugin-src/manifest.json # plugin-src/requirements.txt # plugin-src/rules/AGENTS.md # plugin-src/rules/CLAUDE.md.fragment # plugin-src/skills/slm-cache/SKILL.md # plugin-src/skills/slm-compress/SKILL.md # plugin-src/skills/slm-governance/SKILL.md # plugin-src/skills/slm-graph/SKILL.md # plugin-src/skills/slm-loop/SKILL.md # plugin-src/skills/slm-mesh/SKILL.md # plugin-src/skills/slm-profile/SKILL.md # plugin-src/skills/slm-recall/SKILL.md # plugin-src/skills/slm-remember/SKILL.md # plugin-src/skills/slm-scope/SKILL.md # plugin-src/skills/slm-session/SKILL.md # plugin-src/skills/slm-status/SKILL.md # plugin/.claude-plugin/plugin.json # plugin/CLAUDE.md # plugin/agents/slm-governance-advisor.md # plugin/agents/slm-loop-runner.md # plugin/agents/slm-memory-advisor.md # plugin/agents/slm-optimize-advisor.md # plugin/requirements.txt # plugin/skills/slm-cache/SKILL.md # plugin/skills/slm-compress/SKILL.md # plugin/skills/slm-governance/SKILL.md # plugin/skills/slm-graph/SKILL.md # plugin/skills/slm-loop/SKILL.md # plugin/skills/slm-mesh/SKILL.md # plugin/skills/slm-profile/SKILL.md # plugin/skills/slm-recall/SKILL.md # plugin/skills/slm-remember/SKILL.md # plugin/skills/slm-scope/SKILL.md # plugin/skills/slm-session/SKILL.md # plugin/skills/slm-status/SKILL.md # pyproject.toml # src/superlocalmemory/__init__.py # tests/release/test_v37_rc_candidate_contract.py # tests/test_ci_guards/test_release_evidence.py # tests/test_ci_guards/test_release_package_surface.py # tests/test_cli/test_daemon_owned_discovery.py # uv.lock
|
Thanks for this — merged the fix in spirit as part of v3.8.11 (just published), with one addition: the daemon-side fix ( Added a test that calls Closing this PR in favor of the squashed version in main — same fix, same authorship credit, just with the coverage gap closed. Appreciate the clear root-cause writeup, it made verifying this fast. |
…st reranker diagnostics Fixes qualixar#102: explicit feedback now writes to the canonical learning.db store (not a dead table nothing reads), and the missing learning_feedback.channel column is added by migration M033 with existing rows preserved. Fixes qualixar#103: the reranker now reports the real load failure instead of a generic timeout, rejects unrecognized backends by name, and aborts on permanent config errors instead of burning ~7.5 minutes of retries per daemon start. Merges PR qualixar#101 with the daemon-side test coverage it was missing (verified by reverting the fix and confirming the original test suite stayed green). Also: widens the MagicMock artifact guard to catch the directory-shaped leak alongside the file-shaped one, and fixes the root cause of one such leak in test_core_block_hygiene.py (a bare MagicMock double bypassing an isinstance check). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Problem: cmd_recall crashes with TypeError when the daemon returns a response with null for retrieval_time_ms, or when the keyword fallback path is used (which returns score=None).
Root Cause: The _recall_keyword_fallback() function in unified_daemon.py was missing retrieval_time_ms entirely from its response dict.
Fix:
Root cause fix (unified_daemon.py): Added retrieval_time_ms=0 to the keyword fallback response to make the daemon contract consistent across all code paths.
CLI defensive handling (commands.py): Applied defensive or-0 pattern for both retrieval_time_ms (belt-and-suspenders against null injection) and score (keyword fallback returns score=None).
Test coverage (test_recall_daemon_fallback.py): Added test_cmd_recall_via_keyword_fallback_has_retrieval_time to cover the keyword fallback path.
Changes
Pre-existing CI Failures
The Windows test failures (test (windows-latest, *)) are pre-existing and unrelated to this PR. Evidence:
The Windows failures are environmental (likely path/permission-related on Windows) and should be tracked separately.