Skip to content

Package Raycast command suggestions - #139

Open
tonythethompson wants to merge 8 commits into
masterfrom
codex/raycast-suggestion-integration
Open

Package Raycast command suggestions#139
tonythethompson wants to merge 8 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 across flows. Adds a manual-create suggestions dropdown, hides it when empty, and hardens payload parsing and failure handling with safe fallbacks.

  • New Features

    • Build and ship QuickShell.Suggest.exe into QuickShell.Raycast/assets on Windows via predev/prebuild/publish and deploy/build scripts (scripts/build-raycast-suggest.ps1, QuickShell.Raycast/scripts/ensure-suggest-asset.js, scripts/ensure-raycast-suggest.ps1); the ensure script smoke-tests the CLI and can skip deploy.
    • Resolve the CLI via environment.assetsPath; still supports QUICKSHELL_SUGGEST_EXE and macOS heuristic fallback (Windows-only packaged CLI).
    • Manual Add Workspace shows suggestions in the dropdown (seeded tasks + pills) without auto-adding commands; propagate generation and assets path through forms and Discover to avoid mismatches. 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.
    • Ensure Store publish builds QuickShell.Suggest.exe into assets/; validate Suggest JSON, generation, and pill shape (drop malformed pills, reject corrupt payloads), and handle failures without logging local paths (fallback to heuristics; non-Windows skips the CLI unless overridden).
    • Parse --generation as long to match Date.now() and pass the form request counter through Suggest to prevent mismatched responses.

Written for commit 92bfb64. 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

📝 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/build/publish, 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 comparisons were touched in this PR; the diff is confined to Raycast suggest packaging and parsing code.
Gpu/Cpu Runtime Boundary ✅ Passed This PR only changes Raycast suggest packaging/tests and a helper script; no inference/, CPU/GPU requirements, or diarization runtime boundary files are touched.
Managed Host Restart Safety ✅ Passed PASS: The PR only changes Raycast suggest asset files/tests; none of the host-manager/readiness classes or restart paths are touched.
Title check ✅ Passed The title matches the main change: packaging Raycast command suggestions and related support work.
Description check ✅ Passed The description is clearly related to the packaging, assets-path resolution, dropdown behavior, and documentation changes in this PR.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 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
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
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. 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


View more (4)
5. 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


6. 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


7. SkipDeploy uses exit ✓ Resolved 🐞 Bug ☼ Reliability
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


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 92bfb64 ⚖️ Balanced

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



Results up to commit 2a3c5c4 ⚖️ Balanced


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



🟡 Remediation Recommended

1. Fragile JSON smoke-test parse ✓ Resolved 🐞 Bug ☼ Reliability
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


2. Blanket catch in Raycast stop ✓ Resolved 📘 Rule violation ☼ Reliability
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


3. SkipDeploy uses exit ✓ Resolved 🐞 Bug ☼ Reliability
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



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
@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 on lines +83 to +85
$parsed = $stdout | ConvertFrom-Json
$pillCount = @($parsed.pills).Count
Write-Host "Smoke test OK: generation=$($parsed.generation), pills=$pillCount" -ForegroundColor Green

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate the Suggest response contract before reporting success.

Any parseable JSON—including null or an object without generation/pills—logs “Smoke test OK.” Require an object, generation == 1, and an array-valued pills property before declaring readiness.

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

Comment on lines +97 to +118
Write-Host '2/3 Stopping Raycast (so the extension can reload)...' -ForegroundColor Cyan
$stoppedRaycast = $false
try {
Stop-RaycastProcesses
$stoppedRaycast = $true
}
catch {
Write-Warning "Could not stop Raycast: $($_.Exception.Message)"
}

Write-Host '3/3 Building and deploying QuickShell.Raycast...' -ForegroundColor Cyan
Deploy-RaycastExtension `
-ProjectRoot $ProjectRoot `
-SkipTests:$SkipTests `
-BuildOnly:$BuildOnly `
-StartDevServer:(-not $BuildOnly)

if (-not $NoRestart -and $stoppedRaycast) {
Write-Host 'Restarting Raycast...' -ForegroundColor Cyan
if (-not (Start-RaycastApp)) {
Write-Warning 'Raycast deploy finished but Raycast could not be restarted.'
}

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep -BuildOnly free of Raycast lifecycle side effects.

-BuildOnly still stops Raycast, and $stoppedRaycast becomes true whenever Stop-RaycastProcesses returns—even when no process existed—so lines 114-119 can launch Raycast. Guard both stop and restart blocks with -not $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 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.

@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 on lines +93 to +96
Write-Host ' cd QuickShell.Raycast'
Write-Host ' npm run dev'
Write-Host (" `$env:QUICKSHELL_SUGGEST_EXE = '{0}'" -f $assetPath) -ForegroundColor DarkGray
return

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== ensure-raycast-suggest.ps1 around reported lines =="
nl -ba scripts/ensure-raycast-suggest.ps1 | sed -n '1,180p'

echo
echo "== search for ProjectRoot and QUICKSHELL_SUGGEST_EXE usage =="
rg -n "ProjectRoot|QUICKSHELL_SUGGEST_EXE|ensure-raycast-suggest|QuickShell.Raycast" scripts . -g '!**/node_modules/**'

Repository: tonythethompson/QuickShell

Length of output: 259


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== top of scripts/ensure-raycast-suggest.ps1 =="
nl -ba scripts/ensure-raycast-suggest.ps1 | sed -n '1,120p'

echo
echo "== exact instruction lines and nearby logic =="
nl -ba scripts/ensure-raycast-suggest.ps1 | sed -n '80,110p'

Repository: tonythethompson/QuickShell

Length of output: 252


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('scripts/ensure-raycast-suggest.ps1')
text = p.read_text(encoding='utf-8')
for i, line in enumerate(text.splitlines(), 1):
    if 1 <= i <= 180:
        print(f"{i:4d}: {line}")
PY

Repository: tonythethompson/QuickShell

Length of output: 5361


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('scripts/ensure-raycast-suggest.ps1')
for i, line in enumerate(p.read_text(encoding='utf-8').splitlines(), 1):
    if 1 <= i <= 180:
        print(f"{i:4d}: {line}")
PY

Repository: tonythethompson/QuickShell

Length of output: 5361


Print the SkipDeploy commands in runnable order

Set QUICKSHELL_SUGGEST_EXE before npm run dev, and print the resolved Raycast path instead of cd QuickShell.Raycast so a custom -ProjectRoot still works.

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

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