fix: tighten enhancedChat probe so vanilla agent routes via portable chat (#261)#269
Merged
outsourc-e merged 1 commit intomainfrom May 3, 2026
Merged
Conversation
The previous probe used a generic GET to /api/sessions/__probe__/chat/stream
and treated any non-404/403 status as 'available'. Vanilla hermes-agent
serves a router-level handler at sessions paths but doesn't actually
expose the streaming POST endpoint there, so it was returning 405 (or
similar) on the GET, which the probe interpreted as 'enhanced chat is
available'. Workspace then routed sends through streamChat() which
posts to /api/sessions/{id}/chat/stream, which 404s on vanilla agent,
and the bundle's error mapper surfaced it as a generic 'Authentication
error' to the user.
Replace the generic probe with probeEnhancedChatStream() that:
- POSTs (the real method) instead of GET
- Treats 404 (path missing) and 405 (path mismatch) as not-available
- Treats any other status as available (4xx structured errors / 401
auth gates / streaming start all imply the path is registered)
Result: getChatMode() correctly returns 'portable' on vanilla agent,
send-stream.ts takes the openaiChat path, chat works without patches.
Refs #261.
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.
Why
aksbit's diagnostic in #261 showed workspace calling
POST /api/sessions/{id}/chat/streamagainst vanilla hermes-agent and getting 404s rendered as 'Authentication error'. Looking at the code path:getChatMode()returns'portable'only whenenhancedChatcapability is false.getChatMode()returned'enhanced-claude', send-stream took the streamChat branch, and posted to a path that doesn't exist at runtime.Fix
Replace generic probe with
probeEnhancedChatStream():After this,
enhancedChatis correctlyfalseon any vanilla agent build,chatMode === 'portable', and send-stream takes theopenaiChatpath that actually works.Test plan
pnpm buildcleannousresearch/hermes-agent, capability log should showmissing=[enhancedChat]and chat-send should work end-to-end via /v1/chat/completions.Refs
Fixes #261. The other half of #261 (auth cast + available-models 404) was addressed in #265 (merged).