Summary
On main (current HEAD 828d3a320, after 4d7fc0f37), hermes --tui fails to build out of the box with a TypeScript error. First invocation on a fresh install dies during the auto-build step:
❯ hermes --tui
Installing TUI dependencies…
TUI build failed.
> [email protected] build
> npm run build --prefix packages/hermes-ink && tsc -p tsconfig.build.json && npm run build:compile && chmod +x dist/entry.js
> @hermes/[email protected] build
> esbuild src/entry-exports.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/ink-bundle.js
src/app/slash/commands/ops.ts(86,9): error TS2322: Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
dist/ink-bundle.js 416.8kb
⚡ Done in 21ms
dist/entry.js is never produced → subsequent hermes --tui attempts re-run npm run build and fail the same way. TUI is effectively unusable on current main.
Environment
- hermes-agent
main @ 828d3a3 (PR context)
- macOS 14, Node v22.22.2, npm 11.6.4
- Clean
node_modules (post npm install)
Root cause
ui-tui/src/app/slash/commands/ops.ts (introduced in 4d7fc0f):
const params: { session_id: string; confirm?: boolean; always?: boolean } = {
session_id: ctx.sid
}
But in ui-tui/src/app/slash/types.ts:
Every other slash command that forwards ctx.sid — prompt.background, config.set, session.compress, session.branch, image.attach in session.ts — just passes it through without type-narrowing; the gateway already handles a null session_id. ops.ts is the outlier that declares the narrower string, so strict TS rejects the assignment.
Fix
Widen the param type to string | null to match the rest of the codebase and the actual ctx.sid type. PR: #NNN (replace with link).
Regression
Introduced in 4d7fc0f37 — feat(gateway,cli): confirm /reload-mcp to warn about prompt cache invalidation.
Probably slipped through because the TUI dev loop (npm run dev → tsx --watch) doesn't run tsc -p tsconfig.build.json, so the stricter build-time typecheck never fires until end users hit hermes --tui's on-demand build path.
Summary
On
main(current HEAD828d3a320, after4d7fc0f37),hermes --tuifails to build out of the box with a TypeScript error. First invocation on a fresh install dies during the auto-build step:dist/entry.jsis never produced → subsequenthermes --tuiattempts re-runnpm run buildand fail the same way. TUI is effectively unusable on currentmain.Environment
main@ 828d3a3 (PR context)node_modules(postnpm install)Root cause
ui-tui/src/app/slash/commands/ops.ts(introduced in 4d7fc0f):But in
ui-tui/src/app/slash/types.ts:Every other slash command that forwards
ctx.sid—prompt.background,config.set,session.compress,session.branch,image.attachinsession.ts— just passes it through without type-narrowing; the gateway already handles a null session_id.ops.tsis the outlier that declares the narrowerstring, so strict TS rejects the assignment.Fix
Widen the param type to
string | nullto match the rest of the codebase and the actualctx.sidtype. PR: #NNN (replace with link).Regression
Introduced in
4d7fc0f37—feat(gateway,cli): confirm /reload-mcp to warn about prompt cache invalidation.Probably slipped through because the TUI dev loop (
npm run dev→tsx --watch) doesn't runtsc -p tsconfig.build.json, so the stricter build-time typecheck never fires until end users hithermes --tui's on-demand build path.