Skip to content

fix(desktop): make rawText required in SlashItemMetadata#39634

Open
eriicp21 wants to merge 1 commit into
NousResearch:mainfrom
eriicp21:fix-rawText-ts-compat
Open

fix(desktop): make rawText required in SlashItemMetadata#39634
eriicp21 wants to merge 1 commit into
NousResearch:mainfrom
eriicp21:fix-rawText-ts-compat

Conversation

@eriicp21

@eriicp21 eriicp21 commented Jun 5, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes a TypeScript compilation error (TS2411) in the desktop app build. The SlashItemMetadata interface extends Record<string, string>, which requires all property values to be string. However, rawText was declared as optional (string | undefined), causing tsc -b to fail during npm run pack on Windows. Since rawText is always assigned in toItem(), making it required resolves the type incompatibility without changing runtime behavior.

This error appears with TypeScript 6.0.3 and strict: true in apps/desktop/tsconfig.json.

This PR addresses the TypeScript compilation error described in #39404. The separate updater reliability issue (deletion of existing app on failed update) is not covered here.

Related Issue

Fixes #39404 (TypeScript build error part)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts: Changed rawText?: string to rawText: string in the SlashItemMetadata interface.

How to Test

  1. Clone the repo and install dependencies:

    git clone https://github.com/NousResearch/hermes-agent.git
    cd hermes-agent
    npm install
  2. Run the desktop TypeScript build:

    cd apps/desktop
    npx tsc -b

Before the fix: error TS2411: Property 'rawText' of type 'string | undefined' is not assignable to 'string' index type 'string'.

After the fix: Build completes successfully.

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 (N/A — TypeScript/desktop change, no Python tests affected)
  • I've added tests for my changes (N/A — type-level fix, runtime behavior unchanged)
  • I've tested on my platform: Windows 11

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, Linux) per the compatibility guide — This is a type-only change with no runtime effect; safe across platforms.
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

For New Skills

N/A

Screenshots / Logs

Build error before fix:

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

Build passes after fix.

Property rawText was typed as optional (string | undefined) but the
interface extends Record<string, string>, which requires all values
to be string. Since rawText is always assigned in toItem(), this
change fixes the TS2411 build error on 	sc -b.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 5, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of the already-merged fix #39334 (and closed #39338) — same single-line change making SlashItemMetadata.rawText required to satisfy the Record<string, string> index signature and clear the TS2411 desktop build failure (#39332 / #39404). This may already be resolved on main.

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

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) 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.

Desktop build fails on main (TS2411 in use-slash-completions.ts); failed update also deletes the existing app

2 participants