Skip to content

Package Raycast command suggestions - #139

Merged
tonythethompson merged 11 commits into
masterfrom
codex/raycast-suggestion-integration
Jul 30, 2026
Merged

Package Raycast command suggestions#139
tonythethompson merged 11 commits into
masterfrom
codex/raycast-suggestion-integration

Conversation

@tonythethompson

@tonythethompson tonythethompson commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • publish QuickShell.Suggest as a Raycast asset during Windows deploy and local packaging
  • resolve the CLI through Raycast's stable assets path while retaining the environment override and macOS fallback
  • keep the Command suggestions dropdown visible when all suggestions were auto-applied
  • document the packaging/runtime contract

Validation

  • published and directly executed the 2.6 MB QuickShell.Suggest.exe asset
  • 256 Raycast tests passed
  • Raycast lint passed
  • Raycast production build passed
  • PowerShell parsing passed for all changed scripts
  • Deploy-RaycastExtension -BuildOnly passed
  • deploy-all.ps1 -SkipCmdPal -SkipRun completed successfully; Raycast restarted with ray develop active

Summary by cubic

Packages the Suggest CLI into the Raycast Windows extension and resolves it from Raycast assets for reliable command suggestions. Adds a manual-create suggestions dropdown and hardens packaging, validation, and fallbacks.

  • New Features

    • Build and ship QuickShell.Suggest.exe into QuickShell.Raycast/assets on Windows via predev/prebuild/publish and deploy/build scripts; ensure-suggest-asset.js invokes scripts/build-raycast-suggest.ps1; scripts/ensure-raycast-suggest.ps1 smoke-tests JSON, supports BuildOnly/SkipDeploy/NoRestart with absolute paths, and deploy now passes Configuration.
    • Resolve the CLI using environment.assetsPath; still supports QUICKSHELL_SUGGEST_EXE; macOS uses local heuristics by default.
    • Manual Add Workspace shows suggestions in the dropdown (combined seeded tasks + pills) without auto-adding; propagate generation and assets path; README notes .NET 10 SDK and the .NET 10 Desktop Runtime.
  • Bug Fixes

    • Hide the empty Command suggestions dropdown and cap local-heuristic seed to 2 so leftovers stay selectable.
    • Validate Suggest JSON strictly (numeric generation, valid pill shape, exact key casing in smoke tests); drop malformed pills, reject corrupt payloads; handle and log CLI failures safely (no local paths); non-Windows skips the CLI unless overridden.
    • Parse --generation as long and pass the form request counter through Suggest to prevent mismatched responses.

Written for commit bcf862b. Summary will update on new commits.

Review in cubic

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Raycast now builds and publishes QuickShell.Suggest.exe into its assets, resolves it through Raycast’s asset path, combines CLI and local suggestions, supports millisecond-scale generation values, and exposes selectable suggestions in workspace flows with updated tests, operational scripts, and documentation.

Changes

Raycast Suggest integration

Layer / File(s) Summary
Build and asset publishing
scripts/build-raycast-suggest.ps1, scripts/RaycastLifecycle.ps1, scripts/build-raycast-extension.ps1, QuickShell.Raycast/scripts/ensure-suggest-asset.js, QuickShell.Raycast/package.json, .gitignore, QuickShell.Raycast/README.md
Windows workflows publish QuickShell.Suggest.exe into Raycast assets, ensure it exists before development, builds, and publishing, and document the .NET SDK/runtime requirements.
Executable resolution and pill fallback
QuickShell.Raycast/src/lib/suggest-commands.ts
Suggestion resolution accepts assetsPath, invokes the packaged CLI on Windows, validates payloads and execution results, combines task and pill suggestions, and limits local fallback seeds to two tasks.
Workspace flows and validation
QuickShell.Raycast/src/components/discover-git-repos-view.tsx, QuickShell.Raycast/src/components/workspace-form.tsx, QuickShell.Raycast/src/__tests__/suggest-commands.test.ts
Workspace flows pass Raycast asset paths and generation tokens, manual-add flows retain selectable suggestions, and tests cover executable resolution, payload validation, and suggestion partitioning.
Generation compatibility and operational workflow
QuickShell.Core/Services/SuggestCommandLineArgs.cs, QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs, scripts/ensure-raycast-suggest.ps1, docs/architecture/*
Generation parsing accepts long millisecond values; the Windows helper supports smoke testing and deployment, and architecture docs describe the packaged executable and fallback behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (7 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Pipeline Stage Enum Ordering ✅ Passed No SessionWorkflowStage enum or member comparisons appear in the diff or repository, so the ordering/comparison check is not applicable.
Gpu/Cpu Runtime Boundary ✅ Passed PR only changes QuickShell.Raycast JS and PowerShell files; no inference/, runtime requirements, or diarization C# files were modified.
Managed Host Restart Safety ✅ Passed PR only changes scripts/ensure-raycast-suggest.ps1; no ManagedVenvHostManager/Containerized* symbols or guarded host restart paths are touched.
Title check ✅ Passed The title clearly matches the main change: packaging Raycast command suggestions and related assets/scripts.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the packaging, fallback, and dropdown updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/raycast-suggestion-integration
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/raycast-suggestion-integration

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b05d749364

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .gitignore
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@qodo-code-review

qodo-code-review Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 44 rules


🔴 Action Required

1. Publish doesn’t ensure asset ✓ Resolved 🐞 Bug ☼ Reliability
Description
npm run publish is documented to publish QuickShell.Suggest.exe, but the scripts only ensure the
asset via prebuild/predev and prepublishOnly (which does not run for npm run publish). This
can produce a Windows Raycast publish missing assets/QuickShell.Suggest.exe, silently degrading to
local heuristics at runtime.
Code

QuickShell.Raycast/package.json[161]

+    "prepublishOnly": "node scripts/ensure-suggest-asset.js",
Relevance

●● Moderate

No historical reviews about npm publish/prepublishOnly asset guarantees in QuickShell.Raycast
scripts.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The README claims npm run publish publishes the exe, but package.json only adds the ensure step
to predev/prebuild plus prepublishOnly, while the publish script itself is just the Raycast
publish command.

QuickShell.Raycast/README.md[63-66]
QuickShell.Raycast/package.json[156-167]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`npm run publish` (Raycast publishing) is not guaranteed to run `ensure-suggest-asset.js`, even though the README now states it does. As a result, Windows publishes can omit `assets/QuickShell.Suggest.exe`.

## Issue Context
- `prepublishOnly` is not the prereq hook for `npm run publish` (it’s for `npm publish`).
- The `publish` script itself currently does not invoke `ensure-suggest-asset.js`.

## Fix Focus Areas
- QuickShell.Raycast/package.json[156-167]
- QuickShell.Raycast/README.md[63-66]

## Suggested fix
- Make the `publish` script explicitly build/ensure the asset first, e.g.:
 - `"publish": "node scripts/ensure-suggest-asset.js && npx @raycast/api@latest publish"`
- Optionally remove `prepublishOnly` to avoid confusion, or keep it only if you also run `npm publish` anywhere.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



🟡 Remediation Recommended

2. Fragile JSON smoke-test parse ✓ Resolved 🐞 Bug ☼ Reliability ⭐ New
Description
The smoke test captures Suggest.exe stdout into $stdout and pipes it to ConvertFrom-Json; if
stdout is multi-line (e.g., pretty-printed JSON), PowerShell will treat it as an array of lines and
ConvertFrom-Json can fail by parsing line-by-line.
This can cause false-negative smoke test failures even when Suggest.exe returns valid JSON.
Code

scripts/ensure-raycast-suggest.ps1[R77-85]

+    Write-Host "Smoke-testing suggest against $Directory ..." -ForegroundColor Cyan
+    $stdout = & $assetPath suggest --dir $Directory --generation 1
+    if ($LASTEXITCODE -ne 0) {
+        throw "Suggest.exe exited with code $LASTEXITCODE"
+    }
+
+    $parsed = $stdout | ConvertFrom-Json
+    $pillCount = @($parsed.pills).Count
+    Write-Host "Smoke test OK: generation=$($parsed.generation), pills=$pillCount" -ForegroundColor Green
Relevance

●●● Strong

Team previously hardened ConvertFrom-Json by normalizing stdout via Out-String before parsing
(PR #130).

PR-#130

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The script assigns native output to $stdout and then pipes that value directly to
ConvertFrom-Json, which is sensitive to whether $stdout is a single string or an array of lines.

scripts/ensure-raycast-suggest.ps1[77-85]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The smoke test does:
- `$stdout = & $assetPath ...`
- `$parsed = $stdout | ConvertFrom-Json`

If the native command emits multi-line JSON, `$stdout` becomes an array of strings (one per line). Piping that array into `ConvertFrom-Json` may try to parse each line as independent JSON.

### Issue Context
This script is a diagnostic tool and should be resilient to harmless output formatting changes (single-line vs pretty JSON).

### Fix Focus Areas
- scripts/ensure-raycast-suggest.ps1[77-85]

### Expected change
Coerce stdout to a single string before parsing, e.g.:
- `$json = $stdout -join "`n"; $parsed = $json | ConvertFrom-Json`
(or `($stdout | Out-String) | ConvertFrom-Json`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Blanket catch in Raycast stop ✓ Resolved 📘 Rule violation ☼ Reliability ⭐ New
Description
scripts/ensure-raycast-suggest.ps1 uses a bare catch {} around Stop-RaycastProcesses, which
can hide unexpected failures and violates the rule to catch only expected exception types.
Code

scripts/ensure-raycast-suggest.ps1[R99-105]

+try {
+    Stop-RaycastProcesses
+    $stoppedRaycast = $true
+}
+catch {
+    Write-Warning "Could not stop Raycast: $($_.Exception.Message)"
+}
Relevance

●●● Strong

Team previously replaced broad catch with specific exception types in PowerShell (PR #9), indicating
blanket catch is discouraged.

PR-#9

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2392968 disallows blanket catch blocks. The new script includes catch { ... }
without specifying exception types.

Rule 2392968: Do not use blanket catch blocks; catch only expected exception types
scripts/ensure-raycast-suggest.ps1[99-105]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`scripts/ensure-raycast-suggest.ps1` uses a blanket `catch {}` around `Stop-RaycastProcesses`, which can swallow unexpected errors and make failures harder to diagnose.

## Issue Context
Compliance requires catching only expected exception types (or letting unexpected exceptions surface). In this case, `Stop-RaycastProcesses` already uses `-ErrorAction SilentlyContinue`, so the `try/catch` can likely be removed entirely, or replaced with narrowly-typed catch blocks for truly expected exceptions.

## Fix Focus Areas
- scripts/ensure-raycast-suggest.ps1[99-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. SkipDeploy uses exit ✓ Resolved 🐞 Bug ☼ Reliability ⭐ New
Description
ensure-raycast-suggest.ps1 uses exit 0 in the -SkipDeploy path, which can terminate the
hosting runspace (not just return from the script) in dot-sourced or embedded invocation scenarios.
This makes the helper script risky to call from other scripts or dot-source during interactive
debugging.
Code

scripts/ensure-raycast-suggest.ps1[R88-95]

+if ($SkipDeploy) {
+    Write-Host ''
+    Write-Host 'Suggest ready (-SkipDeploy). Start Raycast yourself:' -ForegroundColor Yellow
+    Write-Host '  cd QuickShell.Raycast'
+    Write-Host '  npm run dev'
+    Write-Host ("  `$env:QUICKSHELL_SUGGEST_EXE = '{0}'" -f $assetPath) -ForegroundColor DarkGray
+    exit 0
+}
Relevance

●● Moderate

No historical suggestions found about avoiding exit in PowerShell helper scripts; acceptance
unclear.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The -SkipDeploy branch explicitly calls exit 0, which is the problematic control-flow primitive
in PowerShell for a script intended to be used interactively or composed by other scripts.

scripts/ensure-raycast-suggest.ps1[88-95]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`scripts/ensure-raycast-suggest.ps1` uses `exit 0` when `-SkipDeploy` is set. `exit` can terminate the current PowerShell host/runspace (especially if dot-sourced or invoked from a larger script), instead of just ending this script.

### Issue Context
This script is positioned as a dev loop helper, so it’s likely to be run from interactive shells and/or invoked from other scripts.

### Fix Focus Areas
- scripts/ensure-raycast-suggest.ps1[88-95]

### Expected change
Replace `exit 0` with `return` (or restructure so the script naturally falls through), so `-SkipDeploy` stops this script without killing the caller/session.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (4)
5. Pill fields not validated ✓ Resolved 🐞 Bug ☼ Reliability
Description
isSuggestionResponse only checks that pills is an array, but downstream code assumes each pill
has a string command and calls .trim(). If Suggest.exe returns a malformed pill (e.g., command
is non-string), suggestion resolution can throw and break the form flow instead of falling back to
local heuristics.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R167-174]

+function isSuggestionResponse(value: unknown): value is SuggestionResponse {
+  if (!value || typeof value !== "object") {
+    return false;
+  }
+
+  const record = value as Record<string, unknown>;
+  return typeof record.generation === "number" && Array.isArray(record.pills);
+}
Relevance

●●● Strong

Team often accepts stricter validation to avoid runtime crashes/fallback breaks (see robustness work
in PRs #133/#137).

PR-#133
PR-#137
PR-#112

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new validator only checks generation and that pills is an array; it does not validate pill
element field types. Downstream functions unconditionally call .trim() on pill.command, and
resolveWorkspaceSetupSuggestions processes response.pills outside fetchSuggestionPills’
try/catch, so a malformed pill can throw and bypass the intended fallback behavior.

QuickShell.Raycast/src/lib/suggest-commands.ts[167-174]
QuickShell.Raycast/src/lib/suggest-commands.ts[126-165]
QuickShell.Raycast/src/lib/suggest-commands.ts[82-97]
QuickShell.Raycast/src/lib/suggest-commands.ts[271-289]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`isSuggestionResponse()` validates only top-level fields (`generation`, `pills` array) but does not validate pill element shapes. Later code calls string methods on `pill.command` (and similar fields), so malformed payloads can throw runtime errors instead of returning `null` and falling back.

## Issue Context
The PR added response-shape validation and more precise exec error handling, but the current validator still allows pills with non-string fields to pass.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[167-174]
- QuickShell.Raycast/src/lib/suggest-commands.ts[82-97]
- QuickShell.Raycast/src/lib/suggest-commands.ts[126-165]
- QuickShell.Raycast/src/lib/suggest-commands.ts[271-289]

## Suggested fix
- Strengthen validation by verifying each `pills[i]` is an object and at minimum `command` is a string (ideally validate all required `SuggestionPill` fields are strings).
- Alternatively, sanitize: `const pills = record.pills.filter(isValidPill)` and return `{ generation, pills }`, returning `false` (or empty pills) when none are valid.
- Ensure any invalid payload results in `fetchSuggestionPills()` returning `null` so callers reliably fall back to local heuristics.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Blanket catch in fetchSuggestionPills ✓ Resolved 📘 Rule violation ☼ Reliability
Description
fetchSuggestionPills catches all errors from exec/JSON parsing and silently degrades to null,
which can hide unexpected failures and make debugging/auditing harder. The catch should only swallow
expected failure types and rethrow (or explicitly signal) unexpected ones.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R201-205]

+  } catch (error) {
+    const detail = error instanceof Error ? error.message : String(error);
+    console.warn(`[quickshell] Suggest CLI failed (${executable}): ${detail}`);
    return null;
  }
Relevance

●●● Strong

Team previously required removing blanket catch blocks and narrowing expected errors (accepted in PR
#137).

PR-#137

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2392968 prohibits blanket catch blocks. The updated code catches any error in
fetchSuggestionPills and always logs + returns null, rather than narrowing to expected errors
(e.g., spawn/ENOENT) and rethrowing unexpected ones.

Rule 2392968: Do not use blanket catch blocks; catch only expected exception types
QuickShell.Raycast/src/lib/suggest-commands.ts[192-205]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`fetchSuggestionPills` uses a blanket `catch (error)` and always returns `null`, which hides unexpected exceptions (e.g., programmer errors, unexpected JSON shape/parse errors) instead of only handling expected failure modes.

## Issue Context
Compliance requires avoiding blanket catch blocks; only expected exception types/failure modes should be handled.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[192-205]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Windows exe executed on macOS ✓ Resolved 🐞 Bug ☼ Reliability
Description
fetchSuggestionPills executes QuickShell.Suggest.exe whenever it exists, with no platform guard.
With this PR resolving the executable from environment.assetsPath (and packaging scripts publishing
it into assets), a Windows-built extension package can cause macOS to repeatedly attempt (and fail)
to exec a Windows .exe before falling back.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R167-171]

+  assetsPath?: string,
): Promise<SuggestionResponse | null> {
-  const executable = resolveSuggestExecutable();
+  const executable = resolveSuggestExecutable(assetsPath);
  if (!executable || !existsSync(executable)) {
    return null;
Relevance

●●● Strong

Repo emphasizes macOS correctness; macOS Tier A work suggests adding platform guards to avoid
Windows .exe exec attempts (PRs #120,#133).

PR-#120
PR-#133

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR now resolves the Suggest CLI from Raycast assets and passes assetsPath into
fetchSuggestionPills; fetchSuggestionPills then executes the file if it exists, without any platform
check. The packaging scripts copy assets into the packaged extension and publish
QuickShell.Suggest.exe into that assets folder, and platform helpers exist but are not used here.

QuickShell.Raycast/src/lib/suggest-commands.ts[34-42]
QuickShell.Raycast/src/lib/suggest-commands.ts[163-178]
QuickShell.Raycast/src/components/workspace-form.tsx[750-758]
scripts/build-raycast-extension.ps1[59-66]
scripts/build-raycast-suggest.ps1[11-16]
scripts/build-raycast-suggest.ps1[63-64]
QuickShell.Raycast/src/lib/platform.ts[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`fetchSuggestionPills` will attempt to `execFile` the resolved `QuickShell.Suggest.exe` on any platform if the file exists. With the PR switching resolution to Raycast assets, it becomes more likely the `.exe` is present even on macOS (depending on packaging), leading to repeated failed subprocess attempts (caught and silently ignored) before falling back to heuristics.

## Issue Context
- The UI copy explicitly describes macOS using heuristics because the Suggest CLI is Windows-only.
- The code currently only checks for existence, not host platform compatibility.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[34-42]
- QuickShell.Raycast/src/lib/suggest-commands.ts[163-178]
- QuickShell.Raycast/src/lib/platform.ts[1-7]

### Suggested implementation
- Add a Windows-only guard before attempting to execute the CLI.
 - Option A (recommended): in `fetchSuggestionPills`, if `!isWindowsPlatform()` return `null`.
 - Preserve `QUICKSHELL_SUGGEST_EXE` override semantics if you want devs to run an alternate binary cross-platform (e.g., gate only the packaged path, not the env override).
- This ensures macOS always uses the local heuristic fallback without paying the cost of failed exec attempts.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Suggest logs expose local paths ✓ Resolved 🐞 Bug ⛨ Security
Description
New warning logs print the absolute Suggest executable path (and the raw error message) on failures,
which can include user/profile paths from environment.assetsPath and other sensitive local
details. This is a privacy footgun because Raycast logs may be captured/shared when diagnosing
issues.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R201-203]

+  } catch (error) {
+    const detail = error instanceof Error ? error.message : String(error);
+    console.warn(`[quickshell] Suggest CLI failed (${executable}): ${detail}`);
Relevance

●● Moderate

No clear historical guidance on avoiding absolute-path/error-detail logging in Raycast warnings for
privacy.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code logs Suggest CLI not found at ${executable} and `Suggest CLI failed (${executable}):
${detail}; buildSuggestCommandArgs` includes directory/used-command values that flow into the
child process invocation, and the executable path is absolute.

QuickShell.Raycast/src/lib/suggest-commands.ts[48-56]
QuickShell.Raycast/src/lib/suggest-commands.ts[167-205]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`suggest-commands.ts` now logs failure details for Suggest CLI resolution/execution. The logs include the full executable path and a raw error message, which can leak local machine/user paths (and potentially other sensitive detail) into Raycast logs.

## Issue Context
- `executable` is derived from `environment.assetsPath` and is an absolute path.
- The error message is currently logged verbatim.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[167-205]

## Suggested fix
- Log a sanitized message:
 - Avoid printing the full `executable` path (use `path.basename(executable)` or a fixed label like `QuickShell.Suggest.exe`).
 - Prefer logging structured non-sensitive fields (e.g., `error.code`, exit code, signal) instead of `error.message`.
 - If you still want diagnostics, gate verbose details behind an explicit debug env var and redact paths/arguments.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


---

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit bcf862b

Results up to commit 59bb57f ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)



🟡 Remediation Recommended

1. Windows exe executed on macOS ✓ Resolved 🐞 Bug ☼ Reliability
Description
fetchSuggestionPills executes QuickShell.Suggest.exe whenever it exists, with no platform guard.
With this PR resolving the executable from environment.assetsPath (and packaging scripts publishing
it into assets), a Windows-built extension package can cause macOS to repeatedly attempt (and fail)
to exec a Windows .exe before falling back.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R167-171]

+  assetsPath?: string,
): Promise<SuggestionResponse | null> {
-  const executable = resolveSuggestExecutable();
+  const executable = resolveSuggestExecutable(assetsPath);
  if (!executable || !existsSync(executable)) {
    return null;
Relevance

●●● Strong

Repo emphasizes macOS correctness; macOS Tier A work suggests adding platform guards to avoid
Windows .exe exec attempts (PRs #120,#133).

PR-#120
PR-#133

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR now resolves the Suggest CLI from Raycast assets and passes assetsPath into
fetchSuggestionPills; fetchSuggestionPills then executes the file if it exists, without any platform
check. The packaging scripts copy assets into the packaged extension and publish
QuickShell.Suggest.exe into that assets folder, and platform helpers exist but are not used here.

QuickShell.Raycast/src/lib/suggest-commands.ts[34-42]
QuickShell.Raycast/src/lib/suggest-commands.ts[163-178]
QuickShell.Raycast/src/components/workspace-form.tsx[750-758]
scripts/build-raycast-extension.ps1[59-66]
scripts/build-raycast-suggest.ps1[11-16]
scripts/build-raycast-suggest.ps1[63-64]
QuickShell.Raycast/src/lib/platform.ts[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`fetchSuggestionPills` will attempt to `execFile` the resolved `QuickShell.Suggest.exe` on any platform if the file exists. With the PR switching resolution to Raycast assets, it becomes more likely the `.exe` is present even on macOS (depending on packaging), leading to repeated failed subprocess attempts (caught and silently ignored) before falling back to heuristics.

## Issue Context
- The UI copy explicitly describes macOS using heuristics because the Suggest CLI is Windows-only.
- The code currently only checks for existence, not host platform compatibility.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[34-42]
- QuickShell.Raycast/src/lib/suggest-commands.ts[163-178]
- QuickShell.Raycast/src/lib/platform.ts[1-7]

### Suggested implementation
- Add a Windows-only guard before attempting to execute the CLI.
 - Option A (recommended): in `fetchSuggestionPills`, if `!isWindowsPlatform()` return `null`.
 - Preserve `QUICKSHELL_SUGGEST_EXE` override semantics if you want devs to run an alternate binary cross-platform (e.g., gate only the packaged path, not the env override).
- This ensures macOS always uses the local heuristic fallback without paying the cost of failed exec attempts.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Results up to commit d6545c7 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)



🔴 Action Required

1. Publish doesn’t ensure asset ✓ Resolved 🐞 Bug ☼ Reliability
Description
npm run publish is documented to publish QuickShell.Suggest.exe, but the scripts only ensure the
asset via prebuild/predev and prepublishOnly (which does not run for npm run publish). This
can produce a Windows Raycast publish missing assets/QuickShell.Suggest.exe, silently degrading to
local heuristics at runtime.
Code

QuickShell.Raycast/package.json[161]

+    "prepublishOnly": "node scripts/ensure-suggest-asset.js",
Relevance

●● Moderate

No historical reviews about npm publish/prepublishOnly asset guarantees in QuickShell.Raycast
scripts.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The README claims npm run publish publishes the exe, but package.json only adds the ensure step
to predev/prebuild plus prepublishOnly, while the publish script itself is just the Raycast
publish command.

QuickShell.Raycast/README.md[63-66]
QuickShell.Raycast/package.json[156-167]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`npm run publish` (Raycast publishing) is not guaranteed to run `ensure-suggest-asset.js`, even though the README now states it does. As a result, Windows publishes can omit `assets/QuickShell.Suggest.exe`.

## Issue Context
- `prepublishOnly` is not the prereq hook for `npm run publish` (it’s for `npm publish`).
- The `publish` script itself currently does not invoke `ensure-suggest-asset.js`.

## Fix Focus Areas
- QuickShell.Raycast/package.json[156-167]
- QuickShell.Raycast/README.md[63-66]

## Suggested fix
- Make the `publish` script explicitly build/ensure the asset first, e.g.:
 - `"publish": "node scripts/ensure-suggest-asset.js && npx @raycast/api@latest publish"`
- Optionally remove `prepublishOnly` to avoid confusion, or keep it only if you also run `npm publish` anywhere.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



🟡 Remediation Recommended

2. Blanket catch in fetchSuggestionPills ✓ Resolved 📘 Rule violation ☼ Reliability
Description
fetchSuggestionPills catches all errors from exec/JSON parsing and silently degrades to null,
which can hide unexpected failures and make debugging/auditing harder. The catch should only swallow
expected failure types and rethrow (or explicitly signal) unexpected ones.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R201-205]

+  } catch (error) {
+    const detail = error instanceof Error ? error.message : String(error);
+    console.warn(`[quickshell] Suggest CLI failed (${executable}): ${detail}`);
    return null;
  }
Relevance

●●● Strong

Team previously required removing blanket catch blocks and narrowing expected errors (accepted in PR
#137).

PR-#137

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2392968 prohibits blanket catch blocks. The updated code catches any error in
fetchSuggestionPills and always logs + returns null, rather than narrowing to expected errors
(e.g., spawn/ENOENT) and rethrowing unexpected ones.

Rule 2392968: Do not use blanket catch blocks; catch only expected exception types
QuickShell.Raycast/src/lib/suggest-commands.ts[192-205]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`fetchSuggestionPills` uses a blanket `catch (error)` and always returns `null`, which hides unexpected exceptions (e.g., programmer errors, unexpected JSON shape/parse errors) instead of only handling expected failure modes.

## Issue Context
Compliance requires avoiding blanket catch blocks; only expected exception types/failure modes should be handled.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[192-205]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Suggest logs expose local paths ✓ Resolved 🐞 Bug ⛨ Security
Description
New warning logs print the absolute Suggest executable path (and the raw error message) on failures,
which can include user/profile paths from environment.assetsPath and other sensitive local
details. This is a privacy footgun because Raycast logs may be captured/shared when diagnosing
issues.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R201-203]

+  } catch (error) {
+    const detail = error instanceof Error ? error.message : String(error);
+    console.warn(`[quickshell] Suggest CLI failed (${executable}): ${detail}`);
Relevance

●● Moderate

No clear historical guidance on avoiding absolute-path/error-detail logging in Raycast warnings for
privacy.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code logs Suggest CLI not found at ${executable} and `Suggest CLI failed (${executable}):
${detail}; buildSuggestCommandArgs` includes directory/used-command values that flow into the
child process invocation, and the executable path is absolute.

QuickShell.Raycast/src/lib/suggest-commands.ts[48-56]
QuickShell.Raycast/src/lib/suggest-commands.ts[167-205]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`suggest-commands.ts` now logs failure details for Suggest CLI resolution/execution. The logs include the full executable path and a raw error message, which can leak local machine/user paths (and potentially other sensitive detail) into Raycast logs.

## Issue Context
- `executable` is derived from `environment.assetsPath` and is an absolute path.
- The error message is currently logged verbatim.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[167-205]

## Suggested fix
- Log a sanitized message:
 - Avoid printing the full `executable` path (use `path.basename(executable)` or a fixed label like `QuickShell.Suggest.exe`).
 - Prefer logging structured non-sensitive fields (e.g., `error.code`, exit code, signal) instead of `error.message`.
 - If you still want diagnostics, gate verbose details behind an explicit debug env var and redact paths/arguments.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Results up to commit 44b71a6 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)



🟡 Remediation Recommended

1. Pill fields not validated ✓ Resolved 🐞 Bug ☼ Reliability
Description
isSuggestionResponse only checks that pills is an array, but downstream code assumes each pill
has a string command and calls .trim(). If Suggest.exe returns a malformed pill (e.g., command
is non-string), suggestion resolution can throw and break the form flow instead of falling back to
local heuristics.
Code

QuickShell.Raycast/src/lib/suggest-commands.ts[R167-174]

+function isSuggestionResponse(value: unknown): value is SuggestionResponse {
+  if (!value || typeof value !== "object") {
+    return false;
+  }
+
+  const record = value as Record<string, unknown>;
+  return typeof record.generation === "number" && Array.isArray(record.pills);
+}
Relevance

●●● Strong

Team often accepts stricter validation to avoid runtime crashes/fallback breaks (see robustness work
in PRs #133/#137).

PR-#133
PR-#137
PR-#112

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new validator only checks generation and that pills is an array; it does not validate pill
element field types. Downstream functions unconditionally call .trim() on pill.command, and
resolveWorkspaceSetupSuggestions processes response.pills outside fetchSuggestionPills’
try/catch, so a malformed pill can throw and bypass the intended fallback behavior.

QuickShell.Raycast/src/lib/suggest-commands.ts[167-174]
QuickShell.Raycast/src/lib/suggest-commands.ts[126-165]
QuickShell.Raycast/src/lib/suggest-commands.ts[82-97]
QuickShell.Raycast/src/lib/suggest-commands.ts[271-289]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`isSuggestionResponse()` validates only top-level fields (`generation`, `pills` array) but does not validate pill element shapes. Later code calls string methods on `pill.command` (and similar fields), so malformed payloads can throw runtime errors instead of returning `null` and falling back.

## Issue Context
The PR added response-shape validation and more precise exec error handling, but the current validator still allows pills with non-string fields to pass.

## Fix Focus Areas
- QuickShell.Raycast/src/lib/suggest-commands.ts[167-174]
- QuickShell.Raycast/src/lib/suggest-commands.ts[82-97]
- QuickShell.Raycast/src/lib/suggest-commands.ts[126-165]
- QuickShell.Raycast/src/lib/suggest-commands.ts[271-289]

## Suggested fix
- Strengthen validation by verifying each `pills[i]` is an object and at minimum `command` is a string (ideally validate all required `SuggestionPill` fields are strings).
- Alternatively, sanitize: `const pills = record.pills.filter(isValidPill)` and return `{ generation, pills }`, returning `false` (or empty pills) when none are valid.
- Ensure any invalid payload results in `fetchSuggestionPills()` returning `null` so callers reliably fall back to local heuristics.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Powered by Qodo

Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts
Generate Suggest.exe on Windows prebuild/prepublish so Store packages include it, hide the empty disabled dropdown, and leave local-heuristic leftovers selectable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts
Comment thread QuickShell.Raycast/package.json Outdated
Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts Outdated
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit d6545c7

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@QuickShell.Raycast/package.json`:
- Line 161: Update QuickShell.Raycast/package.json so ensure-suggest-asset.js
runs in the actual npm publish flow, using the publish or prepare script rather
than relying only on prepublishOnly. Update QuickShell.Raycast/README.md’s
publish instructions or claim to match the resulting lifecycle behavior.

In `@QuickShell.Raycast/src/lib/suggest-commands.ts`:
- Around line 196-200: Validate the parsed payload in the CLI response handling
before returning it from the function containing the generation-mismatch check.
Ensure the result is a valid SuggestionResponse with a usable pills collection;
otherwise return null so resolveWorkspaceSetupSuggestions falls back locally,
while preserving the existing generation validation and successful return path.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0c41e090-ca73-4300-9854-839b375a6a6f

📥 Commits

Reviewing files that changed from the base of the PR and between d3739e5 and d6545c7.

📒 Files selected for processing (13)
  • .gitignore
  • QuickShell.Raycast/README.md
  • QuickShell.Raycast/package.json
  • QuickShell.Raycast/scripts/ensure-suggest-asset.js
  • QuickShell.Raycast/src/__tests__/suggest-commands.test.ts
  • QuickShell.Raycast/src/components/discover-git-repos-view.tsx
  • QuickShell.Raycast/src/components/workspace-form.tsx
  • QuickShell.Raycast/src/lib/suggest-commands.ts
  • docs/architecture/forms.md
  • docs/architecture/intelligence.md
  • scripts/RaycastLifecycle.ps1
  • scripts/build-raycast-extension.ps1
  • scripts/build-raycast-suggest.ps1
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Analyze C# with CodeQL
🧰 Additional context used
📓 Path-based instructions (4)
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/build-raycast-extension.ps1
  • scripts/RaycastLifecycle.ps1
  • scripts/build-raycast-suggest.ps1
.gitignore

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

If using git, do not ignore **/Properties/launchSettings.json or *.pubxml, because these files are required for deployment.

Files:

  • .gitignore
QuickShell.Raycast/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Require Node.js >=22.14.0 as declared by the project and keep the extension out of the .NET solution.

Files:

  • QuickShell.Raycast/package.json
QuickShell.Raycast/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain Raycast behavior in parity with Core launch behavior and use the project's Vitest test conventions.

Files:

  • QuickShell.Raycast/src/__tests__/suggest-commands.test.ts
  • QuickShell.Raycast/src/components/workspace-form.tsx
  • QuickShell.Raycast/src/components/discover-git-repos-view.tsx
  • QuickShell.Raycast/src/lib/suggest-commands.ts
🪛 ast-grep (0.45.0)
QuickShell.Raycast/scripts/ensure-suggest-asset.js

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: require("node:child_process")
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process)

QuickShell.Raycast/src/lib/suggest-commands.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔍 Remote MCP GitHub Copilot

Additional review context

  • QuickShell.Raycast/src/lib/suggest-commands.ts now resolves QuickShell.Suggest.exe from Raycast assets/ (or QUICKSHELL_SUGGEST_EXE), skips CLI lookup on non-Windows unless the env override is set, logs missing-exe / generation-mismatch cases, and lowers the local fallback seed cap to LOCAL_SETUP_SEED_TASKS = 2.

  • workspace-form.tsx no longer clears manual-add suggestions; it now resolves them with environment.assetsPath and merges seeded tasks + leftover pills via combineSuggestionTasksAndPills. discover-git-repos-view.tsx passes the same environment.assetsPath into the resolver.

  • scripts/build-raycast-suggest.ps1 publishes QuickShell.Suggest\QuickShell.Suggest.csproj as a single-file win-x64 app into QuickShell.Raycast/bin/SuggestPublish, then copies it to QuickShell.Raycast/assets/QuickShell.Suggest.exe. That script is now invoked from both scripts/build-raycast-extension.ps1 and scripts/RaycastLifecycle.ps1 on Windows.

  • QuickShell.Raycast/package.json adds prepublishOnly: node scripts/ensure-suggest-asset.js; predev uses --if-missing, while prebuild always regenerates the asset.

  • Repo search shows the resolveWorkspaceSetupSuggestions callers are localized to workspace-form.tsx and discover-git-repos-view.tsx, and resolveSuggestExecutable is only defined/used in suggest-commands.ts.

  • .gitignore now ignores only QuickShell.Raycast/assets/QuickShell.Suggest.exe, and the QuickShell.Raycast/assets folder already contains the extension’s existing image assets.

  • The README now documents that development requires Node.js 22.14+ and the .NET 10 SDK, and says Windows build/publish flows place QuickShell.Suggest.exe into assets/ while macOS continues to use local heuristics.

🔇 Additional comments (19)
scripts/build-raycast-suggest.ps1 (1)

1-64: LGTM!

scripts/RaycastLifecycle.ps1 (1)

158-167: LGTM!

scripts/build-raycast-extension.ps1 (1)

25-31: LGTM!

QuickShell.Raycast/src/components/discover-git-repos-view.tsx (1)

1-1: LGTM!

Also applies to: 31-31

QuickShell.Raycast/src/components/workspace-form.tsx (1)

4-4: LGTM!

Also applies to: 36-40, 180-185, 298-312, 331-331

docs/architecture/forms.md (1)

32-32: LGTM!

docs/architecture/intelligence.md (1)

78-78: LGTM!

QuickShell.Raycast/scripts/ensure-suggest-asset.js (1)

1-50: LGTM!

QuickShell.Raycast/package.json (1)

157-160: LGTM!

.gitignore (1)

92-92: LGTM!

QuickShell.Raycast/README.md (1)

18-18: LGTM!

QuickShell.Raycast/src/lib/suggest-commands.ts (7)

5-15: LGTM!


38-44: LGTM!


81-100: LGTM!


171-186: LGTM!


201-203: LGTM!


213-220: LGTM!


238-238: LGTM!

QuickShell.Raycast/src/__tests__/suggest-commands.test.ts (1)

1-8: LGTM!

Also applies to: 23-28, 81-92, 115-126

Comment thread QuickShell.Raycast/package.json Outdated
Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts Outdated
Ensure Store publish builds Suggest.exe, validate CLI payloads before use, and avoid logging local paths on Suggest failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts Outdated
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 44b71a6

tonythethompson and others added 2 commits July 29, 2026 07:36
Parse --generation as long so Date.now() values echo correctly, pass the form request counter into Suggest, and add ensure-raycast-suggest.ps1 for Suggest publish plus Raycast deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
Comment thread scripts/ensure-raycast-suggest.ps1
Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 2a3c5c4

tonythethompson and others added 2 commits July 29, 2026 09:46
Validate each suggestion pill shape before use, and make the ensure helper safer for smoke-test JSON and SkipDeploy/stop paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 92bfb64

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@QuickShell.Raycast/src/lib/suggest-commands.ts`:
- Around line 261-269: Update resolveWorkspaceSetupSuggestions and its callers
in workspace-form.tsx so unexpected suggestion-execution errors are caught
rather than rethrown from fire-and-forget flows. Preserve the existing
expected-failure handling, and ensure the mount effect, manual-add branch, and
full-mode branch fall back to local heuristics without producing unhandled
promise rejections.

In `@scripts/ensure-raycast-suggest.ps1`:
- Around line 97-118: Update the Raycast lifecycle flow around
Stop-RaycastProcesses and Start-RaycastApp so both stopping and restarting occur
only when -not $BuildOnly. Keep deployment and build behavior unchanged, and
ensure -BuildOnly neither stops nor launches Raycast regardless of whether a
process was found.
- Around line 83-85: Update the response validation around ConvertFrom-Json in
the smoke-test flow: require $parsed to be an object, generation to equal 1, and
pills to be an array before writing the “Smoke test OK” message. Reject null or
responses missing either property, and preserve the existing success output only
for valid responses.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a6788747-edc6-4e41-aee9-30e17262f884

📥 Commits

Reviewing files that changed from the base of the PR and between d6545c7 and 7ae3653.

📒 Files selected for processing (7)
  • QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs
  • QuickShell.Core/Services/SuggestCommandLineArgs.cs
  • QuickShell.Raycast/README.md
  • QuickShell.Raycast/package.json
  • QuickShell.Raycast/src/components/workspace-form.tsx
  • QuickShell.Raycast/src/lib/suggest-commands.ts
  • scripts/ensure-raycast-suggest.ps1
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: Analyze Raycast TypeScript with CodeQL
  • GitHub Check: Analyze C# with CodeQL
  • GitHub Check: Performance harness (artifacts)
  • GitHub Check: Raycast lint, test, and build
  • GitHub Check: .NET build and test
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{cs,py}

📄 CodeRabbit inference engine (Custom checks)

Keep SessionWorkflowStage members in strictly ascending order: Foundation < MediaLoaded < Transcribed < Diarized < Translated < TtsGenerated. Comparisons must use enum member names rather than raw integer literals. When adding or renumbering members, provide a legacy-compatible JSON converter for old numeric values; when reordering, verify all inequalities across the solution retain their original semantic meaning.

Files:

  • QuickShell.Core/Services/SuggestCommandLineArgs.cs
  • QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs
QuickShell.Core/**/*.cs

📄 CodeRabbit inference engine (AGENTS.md)

Keep QuickShell.Core free of CmdPal SDK dependencies; expose domain behavior through host-independent services and interfaces.

Files:

  • QuickShell.Core/Services/SuggestCommandLineArgs.cs
**/*.cs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.cs: Use namespaces that mirror folders and preserve the repository's QuickShell.* namespace hierarchy.
Keep one type per file; make most types internal, use internal static class for stateless helpers, and internal sealed class for stateful singletons.
Prefer pure logic in internal static helpers and swappable dependencies as interfaces registered through dependency injection.
Use explicit DI factory lambdas where appropriate for AOT and trimming friendliness; avoid reflection-based registration.
Preserve existing #region agent log instrumentation blocks and AgentDebugLog calls.

Files:

  • QuickShell.Core/Services/SuggestCommandLineArgs.cs
  • QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/ensure-raycast-suggest.ps1
QuickShell.Core.Tests/**/*.cs

📄 CodeRabbit inference engine (AGENTS.md)

QuickShell.Core.Tests/**/*.cs: Use xUnit tests with underscore-separated method names; do not introduce Moq or FluentAssertions.
Prefer real services and the established seams (LaunchExecutorTestEnvironment, FakeShortcutRepository, and AgentCliCatalog.AgentCli...Override) instead of mocks; group tests using shared process-wide seams with [Collection].

Files:

  • QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs
QuickShell.Raycast/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Require Node.js >=22.14.0 as declared by the project and keep the extension out of the .NET solution.

Files:

  • QuickShell.Raycast/package.json
QuickShell.Raycast/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain Raycast behavior in parity with Core launch behavior and use the project's Vitest test conventions.

Files:

  • QuickShell.Raycast/src/components/workspace-form.tsx
  • QuickShell.Raycast/src/lib/suggest-commands.ts
🪛 ast-grep (0.45.0)
QuickShell.Raycast/src/lib/suggest-commands.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔍 Remote MCP GitHub Copilot

Additional review context

  • QuickShell.Suggest targets net10.0-windows7.0 and the packaging script publishes with --self-contained false, confirming the documented requirement for the .NET 10 Desktop Runtime.
  • The CLI serializes generation directly in its JSON payload, while PR #139 changes parsing to long; this matches Raycast’s millisecond Date.now() generation values.
  • The PR’s actual package.json uses an explicit "publish" script invoking ensure-suggest-asset.js; repository search found no prepublishOnly hook. Any documentation or review assumption that publishing is lifecycle-hook based should be corrected.
  • The platform helper treats only win32 as Windows and only darwin as macOS; packaged Suggest execution is therefore intentionally skipped on Linux and macOS unless QUICKSHELL_SUGGEST_EXE is set.
🔇 Additional comments (8)
QuickShell.Core/Services/SuggestCommandLineArgs.cs (1)

9-9: LGTM!

Also applies to: 37-38

QuickShell.Core.Tests/SuggestCommandLineArgsTests.cs (1)

24-36: LGTM!

QuickShell.Raycast/package.json (1)

166-166: LGTM!

QuickShell.Raycast/README.md (1)

18-18: LGTM!

Also applies to: 65-65

scripts/ensure-raycast-suggest.ps1 (1)

1-82: LGTM!

Also applies to: 88-96, 121-127

QuickShell.Raycast/src/lib/suggest-commands.ts (2)

5-15: LGTM!

Also applies to: 38-46, 175-260, 277-304


82-99: 🩺 Stability & Availability

No issue: malformed pills are filtered before combining

parseSuggestionResponse() already drops pills without a string command, so combineSuggestionTasksAndPills() only receives valid pills on this path.

			> Likely an incorrect or invalid review comment.
QuickShell.Raycast/src/components/workspace-form.tsx (1)

4-4: LGTM! Call sites correctly thread generation and environment.assetsPath through the updated resolveWorkspaceSetupSuggestions/combineSuggestionTasksAndPills signatures, and the manual-add branch now surfaces suggestions instead of clearing them, matching the PR's stated behavior. Note: none of these call sites catch a potential rethrow from resolveWorkspaceSetupSuggestions — see the root-cause comment on QuickShell.Raycast/src/lib/suggest-commands.ts (fetchSuggestionPills) for that concern.

Also applies to: 36-40, 178-211, 298-314, 331-331

Comment thread QuickShell.Raycast/src/lib/suggest-commands.ts
Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
Comment thread scripts/ensure-raycast-suggest.ps1 Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/ensure-raycast-suggest.ps1 (1)

99-110: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep Raycast restarted if deploy fails. Deploy-RaycastExtension can throw after Stop-RaycastProcesses, which skips the restart block and leaves Raycast down. Move the restart into finally so it still runs on failure, while preserving -NoRestart and -BuildOnly.

🤖 Prompt for 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.

In `@scripts/ensure-raycast-suggest.ps1` around lines 99 - 110, Wrap the
deployment flow after Stop-RaycastProcesses in a try/finally block, placing the
Raycast restart logic in finally so it executes when Deploy-RaycastExtension
throws. Preserve the existing -NoRestart and -BuildOnly conditions and keep the
normal deployment behavior unchanged.
🤖 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 `@scripts/ensure-raycast-suggest.ps1`:
- Around line 93-96: Update the SkipDeploy output in the script to print the
resolved Raycast project path derived from the custom ProjectRoot before the npm
command, and reorder the commands so QUICKSHELL_SUGGEST_EXE is set before npm
run dev. Preserve the existing assetPath value and runnable PowerShell
formatting.

---

Outside diff comments:
In `@scripts/ensure-raycast-suggest.ps1`:
- Around line 99-110: Wrap the deployment flow after Stop-RaycastProcesses in a
try/finally block, placing the Raycast restart logic in finally so it executes
when Deploy-RaycastExtension throws. Preserve the existing -NoRestart and
-BuildOnly conditions and keep the normal deployment behavior unchanged.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cf69637d-3add-4839-88e9-9aeb1d9afff0

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae3653 and 92bfb64.

📒 Files selected for processing (3)
  • QuickShell.Raycast/src/__tests__/suggest-commands.test.ts
  • QuickShell.Raycast/src/lib/suggest-commands.ts
  • scripts/ensure-raycast-suggest.ps1
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⚠️ CI failures not shown inline (2)

GitHub Actions: CodeQL / Analyze C# with CodeQL: Package Raycast command suggestions

Conclusion: failure

View job details

##[group]Run dotnet build QuickShell.sln -c Release -p:Platform=x64 --no-restore --verbosity minimal
 �[36;1mdotnet build QuickShell.sln -c Release -p:Platform=x64 --no-restore --verbosity minimal�[0m
 shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
 env:
   DOTNET_NOLOGO: true
   DOTNET_CLI_TELEMETRY_OPTOUT: true
   NUGET_XMLDOC_MODE: skip
   DOTNET_ROOT: C:\Program Files\dotnet
   CODEQL_ACTION_FEATURE_MULTI_LANGUAGE: false
   CODEQL_ACTION_FEATURE_SANDWICH: false
   CODEQL_ACTION_FEATURE_SARIF_COMBINE: true
   CODEQL_ACTION_FEATURE_WILL_UPLOAD: true
   CODEQL_ACTION_VERSION: 4.37.3
   JOB_RUN_UUID: 3d966b07-2632-474a-baa2-7622c8beb577
   CODEQL_ACTION_INIT_HAS_RUN: true
   CODEQL_ACTION_ANALYSIS_KEY: .github/workflows/codeql.yml:analyze-csharp
   CODEQL_WORKFLOW_STARTED_AT:
   CODEQL_ACTION_CLI_VERSION_INFO: {"cmd":"C:\\hostedtoolcache\\windows\\CodeQL\\2.26.1\\x64\\codeql\\codeql.exe","version":{"productName":"CodeQL","vendor":"GitHub","version":"2.26.1","sha":"1ffdebae722922fb50a64b14a97789ed6161f4a7","branches":["codeql-cli-2.26.1"],"copyright":"Copyright (C) 2019-2026 GitHub, Inc.","unpackedLocation":"C:\\hostedtoolcache\\windows\\CodeQL\\2.26.1\\x64\\codeql","configFileLocation":"C:\\Users\\runneradmin\\.config\\codeql\\config","configFileFound":false,"overlayVersion":4,"features":{"analysisSummaryV2Default":true,"buildModeOption":true,"bundleSupportsIncludeDiagnostics":true,"bundleSupportsIncludeLogs":true,"bundleSupportsOverlay":true,"databaseInterpretResultsSupportsSarifRunProperty":true,"featuresInVersionResult":true,"indirectTracingSupportsStaticBinaries":false,"informsAboutUnsupportedPathFilters":true,"supportsPython312":true,"mrvaPackCreate":true,"threatModelOption":true,"traceCommandUseBuildMode":true,"v2ramSizing":true,"mrvaPackCreateMultipleQueries":true,"setsCodeqlRunnerEnvVar":true,"sarifMergeRunsFromEqualCategory":true,"forceOverwrite":true,"generateSummarySymbolMap":true,"pythonDefaultIsToNotExtractStdlib":true,"queryServerR...

GitHub Actions: CodeQL / 0_Analyze C# with CodeQL.txt: Package Raycast command suggestions

Conclusion: failure

View job details

##[group]Run dotnet build QuickShell.sln -c Release -p:Platform=x64 --no-restore --verbosity minimal
 �[36;1mdotnet build QuickShell.sln -c Release -p:Platform=x64 --no-restore --verbosity minimal�[0m
 shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
 env:
   DOTNET_NOLOGO: true
   DOTNET_CLI_TELEMETRY_OPTOUT: true
   NUGET_XMLDOC_MODE: skip
   DOTNET_ROOT: C:\Program Files\dotnet
   CODEQL_ACTION_FEATURE_MULTI_LANGUAGE: false
   CODEQL_ACTION_FEATURE_SANDWICH: false
   CODEQL_ACTION_FEATURE_SARIF_COMBINE: true
   CODEQL_ACTION_FEATURE_WILL_UPLOAD: true
   CODEQL_ACTION_VERSION: 4.37.3
   JOB_RUN_UUID: 3d966b07-2632-474a-baa2-7622c8beb577
   CODEQL_ACTION_INIT_HAS_RUN: true
   CODEQL_ACTION_ANALYSIS_KEY: .github/workflows/codeql.yml:analyze-csharp
   CODEQL_WORKFLOW_STARTED_AT:
   CODEQL_ACTION_CLI_VERSION_INFO: {"cmd":"C:\\hostedtoolcache\\windows\\CodeQL\\2.26.1\\x64\\codeql\\codeql.exe","version":{"productName":"CodeQL","vendor":"GitHub","version":"2.26.1","sha":"1ffdebae722922fb50a64b14a97789ed6161f4a7","branches":["codeql-cli-2.26.1"],"copyright":"Copyright (C) 2019-2026 GitHub, Inc.","unpackedLocation":"C:\\hostedtoolcache\\windows\\CodeQL\\2.26.1\\x64\\codeql","configFileLocation":"C:\\Users\\runneradmin\\.config\\codeql\\config","configFileFound":false,"overlayVersion":4,"features":{"analysisSummaryV2Default":true,"buildModeOption":true,"bundleSupportsIncludeDiagnostics":true,"bundleSupportsIncludeLogs":true,"bundleSupportsOverlay":true,"databaseInterpretResultsSupportsSarifRunProperty":true,"featuresInVersionResult":true,"indirectTracingSupportsStaticBinaries":false,"informsAboutUnsupportedPathFilters":true,"supportsPython312":true,"mrvaPackCreate":true,"threatModelOption":true,"traceCommandUseBuildMode":true,"v2ramSizing":true,"mrvaPackCreateMultipleQueries":true,"setsCodeqlRunnerEnvVar":true,"sarifMergeRunsFromEqualCategory":true,"forceOverwrite":true,"generateSummarySymbolMap":true,"pythonDefaultIsToNotExtractStdlib":true,"queryServerR...
🧰 Additional context used
📓 Path-based instructions (2)
QuickShell.Raycast/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain Raycast behavior in parity with Core launch behavior and use the project's Vitest test conventions.

Files:

  • QuickShell.Raycast/src/__tests__/suggest-commands.test.ts
  • QuickShell.Raycast/src/lib/suggest-commands.ts
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/ensure-raycast-suggest.ps1
🪛 ast-grep (0.45.0)
QuickShell.Raycast/src/lib/suggest-commands.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔍 Remote MCP DeepWiki, GitHub Copilot

Additional review context

  • PR #139 changes SuggestCommandLineArgs.TryParse generation from int to long, matching Raycast’s millisecond-scale Date.now() values; a regression test covers 1785335300454.
  • The packaged executable is published with dotnet publish --self-contained false -r win-x64 -p:PublishSingleFile=true, so the .NET 10 Desktop Runtime is required at runtime.
  • ensure-suggest-asset.js is an explicit publish script prerequisite; no lifecycle prepublishOnly hook is shown. It skips non-Windows platforms and validates both the PowerShell exit code and resulting asset.
  • Runtime lookup precedence is: QUICKSHELL_SUGGEST_EXE, then environment.assetsPath/QuickShell.Suggest.exe; packaged execution is skipped on non-Windows unless the override is set.
  • parseSuggestionResponse requires numeric finite generation, an array of pills, and rejects non-empty payloads containing no valid pills. Generation mismatches and expected process failures fall back to local heuristics.
  • Related PR #112 adds the searchable command-suggestion dropdown in workspace-form.tsx; PR #137 changes discovered repositories to use full workspace seeding. These overlap directly with PR #139’s suggestion plumbing and discovered-repository call path.
  • DeepWiki could not provide repository context because tonythethompson/QuickShell was not indexed.
🔇 Additional comments (4)
QuickShell.Raycast/src/lib/suggest-commands.ts (1)

38-45: LGTM!

Also applies to: 82-98, 167-200, 241-287, 300-330

QuickShell.Raycast/src/__tests__/suggest-commands.test.ts (1)

7-7: LGTM!

Also applies to: 24-27, 82-93, 116-126, 141-181

scripts/ensure-raycast-suggest.ps1 (2)

83-85: The response-contract validation issue remains unresolved.

Any parseable JSON, including null or an object missing generation/array-valued pills, is still reported as a successful smoke test. Validate the expected object shape before logging “Smoke test OK.”


100-102: Keep -BuildOnly free of Raycast lifecycle side effects.

This is still unresolved from the previous review: guard both stopping and restarting with -not $BuildOnly, and do not set $stoppedRaycast = $true unconditionally.

Also applies to: 111-115

Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
Catch unexpected Suggest failures so form flows fall back locally, and tighten ensure-raycast-suggest smoke-test and BuildOnly/SkipDeploy behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/ensure-raycast-suggest.ps1 (1)

133-139: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not report deployment after -BuildOnly.

Deploy-RaycastExtension -BuildOnly only builds and explicitly skips deployment and the dev server, but the unconditional completion message says “deploy complete” and points users at the workspace form. Use a separate BuildOnly completion message and omit runtime guidance in that mode.

🤖 Prompt for 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.

In `@scripts/ensure-raycast-suggest.ps1` around lines 133 - 139, Update the
completion-output block after Deploy-RaycastExtension so the -BuildOnly path
reports only that the build completed, without deployment or
workspace/dev-server guidance. Keep the existing deployment-complete message,
runtime instructions, and asset details for the normal deployment path, using
the BuildOnly parameter to select the appropriate messages.
🤖 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 `@scripts/ensure-raycast-suggest.ps1`:
- Around line 103-108: Resolve the custom project path to an absolute path
before the -SkipDeploy output in the script’s command-printing block. Update the
$assetPath value, or its source, so the QUICKSHELL_SUGGEST_EXE command remains
valid after Set-Location changes to $raycastRoot; preserve the existing printed
command flow.
- Around line 86-99: The smoke validation around the response checks must
enforce the runtime contract before printing success: require generation to be a
finite numeric value without string coercion and retain the expected value of 1,
then validate every non-empty element of parsed.pills has the required runtime
pill fields so arrays like [{}] are rejected. Update the checks near
$parsed.generation and $parsed.pills, preserving the existing failure messages
where applicable and only emit “Smoke test OK” after all validations pass.

---

Outside diff comments:
In `@scripts/ensure-raycast-suggest.ps1`:
- Around line 133-139: Update the completion-output block after
Deploy-RaycastExtension so the -BuildOnly path reports only that the build
completed, without deployment or workspace/dev-server guidance. Keep the
existing deployment-complete message, runtime instructions, and asset details
for the normal deployment path, using the BuildOnly parameter to select the
appropriate messages.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: be06340a-3701-4e02-acd6-578a3c8e3d25

📥 Commits

Reviewing files that changed from the base of the PR and between 92bfb64 and 804232e.

📒 Files selected for processing (2)
  • QuickShell.Raycast/src/lib/suggest-commands.ts
  • scripts/ensure-raycast-suggest.ps1
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: Analyze C# with CodeQL
  • GitHub Check: Analyze Raycast TypeScript with CodeQL
  • GitHub Check: Performance harness (artifacts)
  • GitHub Check: Raycast lint, test, and build
  • GitHub Check: .NET build and test
🧰 Additional context used
📓 Path-based instructions (2)
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/ensure-raycast-suggest.ps1
QuickShell.Raycast/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain Raycast behavior in parity with Core launch behavior and use the project's Vitest test conventions.

Files:

  • QuickShell.Raycast/src/lib/suggest-commands.ts
🪛 ast-grep (0.45.0)
QuickShell.Raycast/src/lib/suggest-commands.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔍 Remote MCP DeepWiki, GitHub Copilot

Additional review context

  • PR #112 introduced the Raycast command-suggestion dropdown and earlier resolveWorkspaceSetupSuggestions wiring; PR #139 extends that path with packaged assets, assetsPath, generation tokens, and combined task/pill handling.
  • PR #137 changed discovered-repository flows to use full workspace seeding. PR #139 now passes Date.now() and environment.assetsPath when seeding discovered repositories.
  • QuickShell.Suggest.exe is published as a framework-dependent, single-file win-x64 executable, so the target machine requires the corresponding .NET runtime. The build script temporarily overrides DOTNET_ROOT and MSBuildSDKsPath, then copies the output into QuickShell.Raycast/assets.
  • Runtime executable resolution gives precedence to QUICKSHELL_SUGGEST_EXE; otherwise it uses the supplied Raycast assets path. Non-Windows execution is skipped unless the override is explicitly set.
  • The new response parser requires a finite numeric generation, an array of pills, and all required string fields on retained pills. A non-empty response with no valid pills is rejected; generation mismatches and expected process failures fall back to local heuristics.
  • DeepWiki could not retrieve repository context because tonythethompson/QuickShell is not indexed.
🔇 Additional comments (2)
QuickShell.Raycast/src/lib/suggest-commands.ts (1)

311-324: LGTM!

Also applies to: 335-335

scripts/ensure-raycast-suggest.ps1 (1)

112-117: LGTM!

Also applies to: 126-126

Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
Comment thread scripts/ensure-raycast-suggest.ps1 Outdated
Require absolute SkipDeploy paths, numeric generation without string coercion, valid pill shapes, and BuildOnly-specific completion output.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/ensure-raycast-suggest.ps1 (1)

169-174: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Propagate the requested configuration into deployment.

-Configuration Debug builds and smoke-tests Debug at Line 65, but Deploy-RaycastExtension rebuilds QuickShell.Suggest.exe as Release before deployment. The deployed asset can therefore differ from the validated one.

Proposed fix
# scripts/ensure-raycast-suggest.ps1
 Deploy-RaycastExtension `
     -ProjectRoot $ProjectRoot `
+    -Configuration $Configuration `
     -SkipTests:$SkipTests `

# scripts/RaycastLifecycle.ps1
 function Deploy-RaycastExtension {
     param(
         [string]$ProjectRoot,
+        [ValidateSet('Debug', 'Release')]
+        [string]$Configuration = 'Release',
         [switch]$SkipTests,
         [switch]$BuildOnly,
         [switch]$StartDevServer
@@
-        & $suggestBuildScript -ProjectRoot $ProjectRoot -Configuration Release -Platform x64
+        & $suggestBuildScript -ProjectRoot $ProjectRoot -Configuration $Configuration -Platform x64
🤖 Prompt for 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.

In `@scripts/ensure-raycast-suggest.ps1` around lines 169 - 174, Pass the
requested Configuration value from the script’s build and smoke-test flow into
the Deploy-RaycastExtension call, so deployment rebuilds QuickShell.Suggest.exe
using the same Debug or Release configuration that was validated. Update the
deployment invocation and its supporting parameter flow without changing the
existing BuildOnly or StartDevServer behavior.
🤖 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 `@scripts/ensure-raycast-suggest.ps1`:
- Around line 102-110: Update Test-SuggestPillShape and the related root-payload
validation to enforce exact JSON key casing: inspect the actual property names
and require root keys and pill fields to match the expected lowercase names
using -ceq, rather than relying on case-insensitive PSObject.Properties lookups.
Reject mismatched casing before reporting the smoke contract as valid.

---

Outside diff comments:
In `@scripts/ensure-raycast-suggest.ps1`:
- Around line 169-174: Pass the requested Configuration value from the script’s
build and smoke-test flow into the Deploy-RaycastExtension call, so deployment
rebuilds QuickShell.Suggest.exe using the same Debug or Release configuration
that was validated. Update the deployment invocation and its supporting
parameter flow without changing the existing BuildOnly or StartDevServer
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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3def0524-e5f9-425f-b4bf-7315ac811a91

📥 Commits

Reviewing files that changed from the base of the PR and between 804232e and 8ba68c0.

📒 Files selected for processing (1)
  • scripts/ensure-raycast-suggest.ps1
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: Analyze Raycast TypeScript with CodeQL
  • GitHub Check: Analyze C# with CodeQL
  • GitHub Check: .NET build and test
  • GitHub Check: Performance harness (artifacts)
  • GitHub Check: Raycast lint, test, and build
🧰 Additional context used
📓 Path-based instructions (1)
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/ensure-raycast-suggest.ps1
🔍 Remote MCP DeepWiki, GitHub Copilot

Additional review context

  • DeepWiki could not provide repository context because tonythethompson/QuickShell is not indexed.
  • PR #139 changes the C# CLI contract: --generation is now parsed as long, matching Raycast’s Date.now() millisecond values; a regression test covers 1785335300454.
  • The packaged executable is published as framework-dependent win-x64 single-file output (--self-contained false), then copied to QuickShell.Raycast/assets/QuickShell.Suggest.exe; therefore the documented .NET runtime prerequisite is operationally relevant.
  • Runtime precedence is explicit: QUICKSHELL_SUGGEST_EXE overrides the packaged path; otherwise Raycast resolves the executable from environment.assetsPath. Non-Windows platforms skip the packaged CLI unless the override is set.
  • PR #112 established the earlier suggest-commands.ts/workspace-form.tsx suggestion plumbing; PR #139 extends those call paths with assetsPath, generation cancellation, validation, and fallback handling.
  • PR #137 established full discovered-repository workspace seeding; PR #139 now passes Date.now() and environment.assetsPath through that resolution path.
  • The response parser requires a finite numeric generation, an array of pills, and all five required string fields per retained pill. Non-empty responses with no valid pills, malformed JSON, generation mismatches, missing executables, and expected process failures fall back to local heuristics.
🔇 Additional comments (1)
scripts/ensure-raycast-suggest.ps1 (1)

47-51: LGTM!

Also applies to: 74-100, 152-167, 176-193

Comment thread scripts/ensure-raycast-suggest.ps1
Pass Configuration through Deploy-RaycastExtension and require exact lowercase smoke-test JSON property names.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qodo-code-review

qodo-code-review Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo


Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Powered by Qodo

@tonythethompson
tonythethompson enabled auto-merge (squash) July 30, 2026 12:06
@tonythethompson
tonythethompson merged commit 9eba43d into master Jul 30, 2026
11 checks passed
@tonythethompson
tonythethompson deleted the codex/raycast-suggestion-integration branch July 30, 2026 12:07
@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown

QUI-7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants