Skip to content

feat(api-server): stream chat reasoning chunks#13401

Open
manuelschipper wants to merge 1 commit into
NousResearch:mainfrom
manuelschipper:feat/api-server-reasoning-stream
Open

feat(api-server): stream chat reasoning chunks#13401
manuelschipper wants to merge 1 commit into
NousResearch:mainfrom
manuelschipper:feat/api-server-reasoning-stream

Conversation

@manuelschipper

Copy link
Copy Markdown
Contributor

Summary

  • Forward AIAgent reasoning callbacks through /v1/chat/completions streaming.
  • Emit reasoning as OpenAI-style delta.reasoning_content chunks, separate from delta.content.
  • Keep the existing hermes.tool.progress SSE event behavior unchanged.
  • Add focused Chat Completions SSE regression coverage.

Why

API-server clients can already receive assistant text and tool progress while a run is active, but reasoning-capable models have no compatible path to stream reasoning tokens through Chat Completions. This exposes that signal to OpenAI-compatible clients without mixing reasoning into the persisted assistant message content.

Supersedes #4265 with a fresh branch on current main and a narrower scope.

Verification

  • scripts/run_tests.sh tests/gateway/test_api_server.py (118 passed)

@mxnstrexgl

Copy link
Copy Markdown

🤖 Automated PR Review\n\n### Security Scan\n- ✓ No hardcoded secrets found\n- ✓ No SQL injection vectors\n- ✓ No path traversal risks\n- ✓ No unsafe deserialization\n- ✓ No command injection\n\n### Code Quality\n- ✓ Clean implementation\n- ✓ Tests included/updated\n- ✓ No code duplication detected\n\n### Summary\n✓ Automated review complete. No concerns detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants