Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .agents/scripts/memory-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,12 @@ cmd_recall() {
return $?
fi

# Escape query for FTS5 - escape both single and double quotes
# Escape query for FTS5 - wrap in double quotes to handle special chars
# FTS5 treats hyphens as NOT operator, asterisks as prefix, etc.
# Quoting the query makes it a literal phrase search.
local escaped_query="${query//"'"/"''"}"
escaped_query="${escaped_query//\"/\"\"}"
# Escape embedded double quotes for FTS5 (double them), then wrap in quotes
escaped_query="\"${escaped_query//\"/\"\"}\""
Comment on lines 543 to +545

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to avoid re-assigning to escaped_query, you could use an intermediate variable with a more descriptive name. This makes the purpose of each escaping step clearer and the code easier to follow.

Suggested change
local escaped_query="${query//"'"/"''"}"
escaped_query="${escaped_query//\"/\"\"}"
# Escape embedded double quotes for FTS5 (double them), then wrap in quotes
escaped_query="\"${escaped_query//\"/\"\"}\""
local query_sql_escaped="${query//'/'/''}"
# Escape embedded double quotes for FTS5 (double them), then wrap in quotes
local escaped_query="\"${query_sql_escaped//\"/\"\"}\""


# Build filters with validation
local extra_filters=""
Expand Down
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Tasks with no open blockers - ready to work on. Use `/ready` to refresh this lis

- [ ] t140 setup.sh: Cisco Skill Scanner install fails on PEP 668 systems (Ubuntu 24.04+) #bugfix #setup #linux ~1h (ai:45m test:15m) logged:2026-02-07
- Notes: GH#415. pip3 install --user blocked by PEP 668 on modern Ubuntu/Debian. Fix fallback chain: uv -> pipx -> venv+symlink -> pip3 --user (legacy). Affects setup.sh lines ~2408-2432. Workaround: manual venv at ~/.aidevops/.agent-workspace/work/cisco-scanner-env/.
- [ ] t139 bug: memory-helper.sh recall fails on hyphenated queries #bugfix #memory ~30m (ai:20m test:10m) logged:2026-02-07
- [ ] t139 bug: memory-helper.sh recall fails on hyphenated queries #bugfix #memory ~30m (ai:20m test:10m) logged:2026-02-07 started:2026-02-07
- Notes: GH#414. Hyphens in FTS5 queries interpreted as NOT operator. "qs-agency" becomes "qs NOT agency" causing column resolution error. Fix: quote hyphenated terms before passing to FTS5 MATCH clause.
- [ ] t138 aidevops update output overwhelms tool buffer on large updates #bugfix #setup ~30m (ai:20m test:10m) logged:2026-02-07
- Notes: GH#398. Raw git pull diff stat exceeds 51KB tool output limit on large updates (e.g. 500 file rename). Fix: quiet pull + filtered commit log (feat/fix/refactor only, head -20) in cmd_update(). Low severity, only affects large updates.
Expand Down Expand Up @@ -94,7 +94,7 @@ Tasks with no open blockers - ready to work on. Use `/ready` to refresh this lis
- Notes: BLOCKED by supervisor: Max retries exceeded: backend_infrastructure_error - [ ] t135.5.1 git rm --cached .scannerwork/ and .playwright-cli/ ~10m
- [ ] t135.5.2 Add .playwright-cli/ to .gitignore ~5m
- [ ] t135.5.3 Verify .scannerwork/ already in .gitignore ~5m
- [ ] t135.6 P1-C: Fix CI workflow code-quality.yml issues ~1h blocked-by:none
- [x] t135.6 P1-C: Fix CI workflow code-quality.yml issues ~1h blocked-by:none completed:2026-02-07
- [ ] t135.6.1 Fix .agent typo to .agents on line 31 ~5m
- [ ] t135.6.2 Fix references to non-existent .agents/spec and docs/ ~10m
- [ ] t135.6.3 Add enforcement steps (shellcheck, json validation) that fail the build ~45m blocked-by:t135.6.1,t135.6.2
Expand Down
Loading