Skip to content

fix(desktop): satisfy slash metadata typecheck#39334

Merged
ethernet8023 merged 1 commit into
NousResearch:mainfrom
helix4u:fix/desktop-slash-rawtext-type
Jun 4, 2026
Merged

fix(desktop): satisfy slash metadata typecheck#39334
ethernet8023 merged 1 commit into
NousResearch:mainfrom
helix4u:fix/desktop-slash-rawtext-type

Conversation

@helix4u

@helix4u helix4u commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the Desktop TypeScript build failure introduced by the slash command metadata change in #39289. SlashItemMetadata extends Record<string, string>, but rawText was declared optional as string | undefined, which makes tsc -b fail with TS2411.

The metadata object always sets rawText: command, so this makes the interface match the actual runtime shape.

Related Issue

Fixes #

Support thread evidence: Windows Desktop installer failed at apps/desktop build failed (exit 1) on commit 1eeb7da2e6e5 with:

src/app/chat/composer/hooks/use-slash-completions.ts(19,3): error TS2411: Property rawText of type string | undefined is not assignable to string index type string.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts — Changed SlashItemMetadata.rawText from optional to required so it satisfies the Record<string, string> index signature and matches the object literal that always supplies rawText: command.

How to Test

  1. On origin/main at 1eeb7da2e6e5, the Windows Desktop installer log shows npm run pack failing during tsc -b with TS2411 in use-slash-completions.ts.
  2. Apply this change.
  3. Run cd apps/desktop && npm run type-check.

Result: npm run type-check passes locally.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: WSL/Linux via Desktop TypeScript build check

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — Windows Desktop installer build failure; TypeScript-only fix
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

For New Skills

N/A

Screenshots / Logs

Failing installer log excerpt from support thread:

src/app/chat/composer/hooks/use-slash-completions.ts(19,3): error TS2411: Property rawText of type string | undefined is not assignable to string index type string.

Validation run:

cd apps/desktop && npm run type-check

Passed.

@helix4u helix4u marked this pull request as ready for review June 4, 2026 21:45
@rdnot

rdnot commented Jun 4, 2026

Copy link
Copy Markdown

comfirm reproducible on windows 11 (desktop build failed due to this)

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists javascript Pull requests that update javascript code labels Jun 4, 2026
@ethernet8023 ethernet8023 merged commit d29caf3 into NousResearch:main Jun 4, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants