fix(chat): preflight Hermes direct launch safely#3911
Merged
Conversation
# Conflicts: # src/app/api/chat/send/route.ts
CompleteDotTech
marked this pull request as ready for review
July 26, 2026 23:55
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 #3860## What changed- Resolves each direct Hermes CLI launch through one native plan:
hermes.exeon Windows andhermeselsewhere, retaining the exact resolved command, familiar-scoped environment, and child working directory.- Uses the plan for direct-chat preflight,hermes chat --helpmodel probing, spawn, and harness status/version reporting; unready Hermes status never falls back towhich/wherediscovery. Windows.cmd/.batshim-only installs are unlaunchable, never ready.- Keeps model probing optional: failed or unsupported help only suppresses--model; it does not make a launchable Hermes unavailable.- Emits structured, path-safe runtime errors for unavailable launches and started process/auth/config failures. Failed Hermes stdout and session ids are withheld until a zero exit, so failures cannot fabricate assistant text, session stubs, or persistence.- Retries a stale Hermes native session without--resumewithout emitting a terminal process failure, leaking stale output/session ids, or suppressing the successful retry's persistence.- Preserves Hermes API mode, SSH routing, and other harness launch contracts.## ValidationPassed onc3c4b900(mergedorigin/mainaf95b0bc):- Hermes runtime availability, direct-chat availability integration (including stale-session retry), model routing/capabilities, harness status, adapter merge, Familiar Studio, and API contract tests-pnpm check:tests-wired-pnpm lint-pnpm typecheck-git diff --check origin/main...HEADBroader-suite note: localpnpm test:apireachedscripts/dev-app-teardown.test.mjsafter three passing files, then reproduced its pre-existing native-Windows fake-server bind timeout (port 61865). Hermes tests were run directly and pass; this environmental failure was not masked.## CIA fresh CI run is queued forc3c4b900; the PR remains draft. There are no review comments, reviews, or unresolved actionable threads.