fix(backend): add LIKE fallback to item search for compound-token substrings - #235
Conversation
…strings items_fts (porter unicode61) splits agentflare-store into agentflare/store tokens; a query for flare-store or bare flare can't match since flare is a suffix, not a prefix, of agentflare. Fall back to a LIKE scan on zero FTS hits, mirroring the existing pattern in src/memory/search.rs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesSearch fallback
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/agentflare-backend/src/item.rs`:
- Line 554: Update the LIKE pattern construction in the `like_pat` expression to
escape backslashes before escaping `%` and `_`, preserving literal backslashes
in queries such as `a\b` and `\%` under the existing `ESCAPE '\\'` behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b4ae90ba-321e-410f-9ae5-defdc0e7bb6b
📒 Files selected for processing (1)
crates/agentflare-backend/src/item.rs
CodeRabbit finding on PR #235: format! left a literal backslash in the query un-doubled before it reached SQLite's ESCAPE '\' clause, so it was silently swallowed as an (undefined) escape prefix for the next character instead of matching literally.
#305) * feat: flare doctor — claim-worktree health sweep + safe reclaim Agentflare-Agent: 1 Agentflare-Branch: item-235-flare-doctor * fix(git): correct flare doctor's dirty/stale detection, wire up orphaned - is_dirty checked run_in_ok's exit status, but `git status --porcelain` always exits 0 -- it was always false, so --reclaim's dirty guard never actually fired. Now checks for non-empty output instead. - Stale was unconditionally pushed for every lane regardless of actual age, making every worktree "stale" and, combined with the dirty bug, making --reclaim eligible to delete every lane in the repo. Now derived from days since the worktree's last commit, compared against the threshold. - Orphaned (item completed/cancelled but worktree remains) was declared in the enum/summary/formatters but never computed. Wired scan() to accept a sequence_id -> state group_name map (built by the CLI layer from the items/states tables, mirroring claimed_sequence_ids) and flag lanes whose item is completed or cancelled. - Zombie (dead claiming-session pid) stays unimplemented -- no existing pid-liveness primitive in this codebase to build on; documented on the enum variant and left for a follow-up rather than rushed in. - Fixed clippy (useless format!, collapsible if) and fmt findings from CI; added coverage for the two correctness fixes. Agentflare-Agent: claude-code_2-1-217_agent Agentflare-Branch: item-235-flare-doctor * fix(git): address CodeRabbit findings on flare doctor - Detached-HEAD worktrees were encoded as a fake branch name ("detached at <rev>"), which then flowed into has_upstream and duplicate-branch checks meant for real branches. Split into a separate detached_at field so detached lanes are excluded from branch-only checks, same as they should be. - reclaim() silently dropped a lane when remove_dir_all failed (e.g. a Windows file lock) with no diagnostic at all -- now logs which lane and why. - --format accepted any string and silently fell back to text output on a typo; now a clap ValueEnum so an invalid value is a parse error. - reclaim's status lines were printed to stdout, corrupting `--reclaim --format json` output for a script piping it to `jq`. Moved to stderr, alongside the JSON/markdown/text report on stdout. Agentflare-Agent: claude-code_2-1-217_agent Agentflare-Branch: item-235-flare-doctor
…ctor) Adds a doctor action to the item MCP tool wrapping flare_git_core::doctor::scan/reclaim (item #235's CLI-only worktree hygiene scan/reclaim) so an MCP-only agent that hits the git worktree remove/prune shim denial has a discoverable path to worktree cleanup instead of a dead end. Also cross-references the new action from the shim's teardown-deny message and the item tool's own description. Agentflare-Agent: claude-code Agentflare-Branch: task/465-surface-flare-doctor-reclaim-via-mcp-wor Agentflare-Item: 465
…ctor) (#487) Adds a doctor action to the item MCP tool wrapping flare_git_core::doctor::scan/reclaim (item #235's CLI-only worktree hygiene scan/reclaim) so an MCP-only agent that hits the git worktree remove/prune shim denial has a discoverable path to worktree cleanup instead of a dead end. Also cross-references the new action from the shim's teardown-deny message and the item tool's own description. Agentflare-Agent: claude-code Agentflare-Branch: task/465-surface-flare-doctor-reclaim-via-mcp-wor Agentflare-Item: 465
Summary
Test plan
Summary by CodeRabbit