Skip to content

fix: tighten enhancedChat probe so vanilla agent routes via portable chat (#261)#269

Merged
outsourc-e merged 1 commit intomainfrom
fix/streamchat-fallback-vanilla-agent
May 3, 2026
Merged

fix: tighten enhancedChat probe so vanilla agent routes via portable chat (#261)#269
outsourc-e merged 1 commit intomainfrom
fix/streamchat-fallback-vanilla-agent

Conversation

@outsourc-e
Copy link
Copy Markdown
Owner

Why

aksbit's diagnostic in #261 showed workspace calling POST /api/sessions/{id}/chat/stream against vanilla hermes-agent and getting 404s rendered as 'Authentication error'. Looking at the code path:

  1. getChatMode() returns 'portable' only when enhancedChat capability is false.
  2. The capability probe used a generic GET that treated any non-404/403 as 'available'.
  3. Vanilla agent's session router 405s/400s a GET to that path \u2014 not 404 \u2014 so the probe lied.
  4. 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():

  • POST (the real method) instead of GET
  • Treat 404/405 as 'not available'
  • Treat any other status as available (covers fork variants + auth-gated setups)

After this, enhancedChat is correctly false on any vanilla agent build, chatMode === 'portable', and send-stream takes the openaiChat path that actually works.

Test plan

  • pnpm build clean
  • Manual smoke: with vanilla nousresearch/hermes-agent, capability log should show missing=[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).

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.
@outsourc-e outsourc-e merged commit da12206 into main May 3, 2026
3 checks passed
@outsourc-e outsourc-e deleted the fix/streamchat-fallback-vanilla-agent branch May 3, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat-send fails on any current vanilla hermes-agent build — streamChat() targets non-existent endpoints

1 participant