fix(tui): allow nullable session_id in /reload-mcp params#17774
Closed
Heltman wants to merge 1 commit intoNousResearch:mainfrom
Closed
fix(tui): allow nullable session_id in /reload-mcp params#17774Heltman wants to merge 1 commit intoNousResearch:mainfrom
Heltman wants to merge 1 commit intoNousResearch:mainfrom
Conversation
The params object literal for the /reload-mcp RPC declared
`session_id: string`, but `ctx.sid` is typed as `string | null`. TypeScript
fails the strict build with:
src/app/slash/commands/ops.ts(86,9): error TS2322:
Type 'string | null' is not assignable to type 'string'.
Every other slash command that forwards ctx.sid (e.g. prompt.background,
config.set, session.compress, session.branch in session.ts) passes it
through as-is — the gateway already handles a null session_id. Widen the
param type to match and unblock the TUI build.
Regression from 4d7fc0f (feat(gateway,cli): confirm /reload-mcp to warn
about prompt cache invalidation).
This was referenced Apr 30, 2026
Contributor
|
Thanks @Heltman — this was already fixed on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17773.
Problem
hermes --tuifails to build on currentmainbecause the/reload-mcpslash command declares its params with a non-nullablesession_id: string, butctx.sidis typed asstring | null:First invocation on a fresh install dies during the auto-build step;
dist/entry.jsis never produced; TUI is effectively unusable.Fix
Widen the param type to
string | nullto matchctx.sidand the convention used by every other slash command that forwards the session id (e.g.session.ts—prompt.background,config.set,session.compress,session.branch,image.attachall just spreadsession_id: ctx.sidwithout narrowing, and the gateway already handles null).Smallest correct change; no runtime behavior difference.
Verification
Regression introduced in
4d7fc0f37—feat(gateway,cli): confirm /reload-mcp to warn about prompt cache invalidation. The TUI dev loop (tsx --watch) skipstsc -p tsconfig.build.json, so the build-time typecheck only fires when end users hit the launcher's on-demand build path. A CI job runningnpm run buildon the TUI would catch future regressions of this class.