Port fuzzy search, display settings, and copilot abort fix#10
Port fuzzy search, display settings, and copilot abort fix#10aaditagrawal merged 3 commits intomainfrom
Conversation
- Add fuzzy subsequence matching to workspace file search with ranked insertion for efficient top-N retrieval - Add showCommandOutput and showFileChangeDiffs display settings with toggles in the settings page - Handle turn.aborted in ProviderRuntimeIngestion so Copilot sessions don't get stuck in running state after user clicks stop
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds handling for a new turn.aborted event across provider runtime ingestion, implements fuzzy subsequence ranking for workspace entry search, and exposes two UI settings (showCommandOutput, showFileChangeDiffs) with corresponding chat UI conditional rendering. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/web/src/routes/_chat.settings.tsx (1)
1-1:⚠️ Potential issue | 🟡 MinorFix formatting to pass CI.
The pipeline indicates a formatting issue detected by oxfmt. Run
bun run fmtto resolve this before merging.As per coding guidelines: "All of
bun fmt,bun lint, andbun typecheckmust pass before considering tasks completed."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/src/routes/_chat.settings.tsx` at line 1, The file apps/web/src/routes/_chat.settings.tsx has formatting violations (seen at the import of createFileRoute) that fail oxfmt CI; run the project formatter (e.g., bun run fmt or bun fmt), review and stage the resulting changes for apps/web/src/routes/_chat.settings.tsx (and any other modified files), then commit and push so the CI formatting check passes.apps/web/src/appSettings.ts (1)
1-1:⚠️ Potential issue | 🟡 MinorFix formatting to pass CI.
The pipeline indicates a formatting issue detected by oxfmt. Run
bun run fmtto resolve this before merging.As per coding guidelines: "All of
bun fmt,bun lint, andbun typecheckmust pass before considering tasks completed."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/src/appSettings.ts` at line 1, The file import line in apps/web/src/appSettings.ts is failing oxfmt; run the repo formatter (e.g., `bun run fmt` or `bun fmt`) and reformat this file so the import statement (`import { useCallback, useSyncExternalStore } from "react";`) and the rest of appSettings.ts conform to the project's formatting rules, then re-run `bun lint` and `bun typecheck` to ensure CI will pass.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/server/src/workspaceEntries.ts`:
- Around line 469-529: CI reports oxfmt failures in this block; run the
formatter and related checks and commit the changes so the findInsertionIndex,
insertRankedEntry, and searchWorkspaceEntries implementations are properly
formatted. Specifically, run the project's formatting/lint/typecheck pipeline
(e.g., bun run fmt or bun fmt, then bun lint and bun typecheck as required),
review the updated whitespace/linebreaks around the normalizedQuery logic and
the ranked insertion loop, and commit the resulting changes so the oxford-style
formatting error is resolved.
- Around line 483-490: The function insertRankedEntry improperly reads the tail
element when limit can be 0; update the guard in insertRankedEntry to
early-return when limit <= 0 (or otherwise check limit first) before evaluating
ranked[ranked.length - 1].score so you never dereference ranked[-1]; ensure the
condition checks limit <= 0 (or ranked.length === 0) before comparing score to
the last element to avoid the runtime exception.
- Around line 469-497: The current binary-insert logic in findInsertionIndex and
the early-return in insertRankedEntry only compare score, causing equal-score
ties to preserve scan order instead of using the lexical path tiebreaker; update
both functions to compare a secondary key (entry.path) when scores are equal:
change findInsertionIndex to treat (score, path) as the sort key (compare score
first, and when equal compare path lexically), and in insertRankedEntry update
the early-return check to allow insertion when score equals the last element but
entry.path is lexically smaller than ranked[ranked.length-1].entry.path so the
proper tie winner is kept. Ensure references to ProjectEntry.path are used for
the lexical comparison.
---
Outside diff comments:
In `@apps/web/src/appSettings.ts`:
- Line 1: The file import line in apps/web/src/appSettings.ts is failing oxfmt;
run the repo formatter (e.g., `bun run fmt` or `bun fmt`) and reformat this file
so the import statement (`import { useCallback, useSyncExternalStore } from
"react";`) and the rest of appSettings.ts conform to the project's formatting
rules, then re-run `bun lint` and `bun typecheck` to ensure CI will pass.
In `@apps/web/src/routes/_chat.settings.tsx`:
- Line 1: The file apps/web/src/routes/_chat.settings.tsx has formatting
violations (seen at the import of createFileRoute) that fail oxfmt CI; run the
project formatter (e.g., bun run fmt or bun fmt), review and stage the resulting
changes for apps/web/src/routes/_chat.settings.tsx (and any other modified
files), then commit and push so the CI formatting check passes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2dccb24a-2cb8-4eee-bb32-455ad618e323
📒 Files selected for processing (6)
apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.tsapps/server/src/workspaceEntries.tsapps/web/src/appSettings.tsapps/web/src/components/DiffPanel.tsxapps/web/src/components/chat/MessagesTimeline.tsxapps/web/src/routes/_chat.settings.tsx
- Add limit <= 0 guard in insertRankedEntry to prevent ranked[-1] dereference when limit is zero - Add path tiebreaker via compareRankedEntries so equal-score entries are ordered lexically by path instead of scan order - Pass full candidate object to findInsertionIndex for composite comparison
Summary
showCommandOutput,showFileChangeDiffs) in Settings > Display to reduce visual clutter. Gates command output in the chat timeline and diff rendering in the side panel.turn.abortedevents inProviderRuntimeIngestionso sessions transition tointerruptedstatus instead of getting stuck inrunningwith a staleactiveTurnId. Finalizes buffered assistant messages and cleans up accumulated usage on abort.Ported from zortos293/t3code-copilot PRs #15, #18, #16 — adapted to our multi-provider architecture.
Test plan
cmpin the @-mention file picker and verifyComposer.tsx/composePrompt.tsappear via fuzzy matchSummary by CodeRabbit
New Features
Improvements
Bug