Skip to content

feat: inspect raw LLM request/response payloads in session events - #14

Merged
vivganes merged 1 commit into
mainfrom
feat/raw-llm-io
Jun 28, 2026
Merged

feat: inspect raw LLM request/response payloads in session events#14
vivganes merged 1 commit into
mainfrom
feat/raw-llm-io

Conversation

@vivganes

@vivganes vivganes commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stores and streams the raw JSON sent to the LLM provider and the raw SSE chunks returned, alongside the existing parsed fields in session events. This enables debugging exact LLM inputs/outputs without needing to intercept network traffic.

Changes

Backend

  • provider.pyassemble_response() now returns raw_request (full JSON payload sent to provider) and raw_response (list of raw SSE JSON chunks)
  • agent_loop.pymodel_request event includes raw_payload; model_response event includes raw_response

Frontend

  • EventTimeline.tsx — Collapsible "Raw request payload" section on model_request events, and "Raw response (N chunks)" section on model_response events

Tests

  • 4 new tests covering: raw payload shape/model/stream, raw response chunks, tools + tool_choice in payload, and extra params (temperature, max_tokens) in payload

Test Plan

  • All 51 backend tests pass (including 4 new)
  • ruff check passes clean
  • Start a session and verify raw payload/response appear in the event timeline
  • Verify collapsible sections work for both event types

🤖 Generated with Hermes Agent

Store and stream the raw JSON sent to the provider (model_request) and
the raw SSE chunks returned (model_response) alongside the existing
parsed fields, so you can debug exact LLM inputs/outputs.

- provider.py: assemble_response now returns raw_request and raw_response
- agent_loop.py: model_request event includes raw_payload; model_response
  event includes raw_response
- EventTimeline.tsx: collapsible "Raw request payload" and "Raw response
  (N chunks)" sections for model_request/model_response events
- tests: 4 new tests covering raw payload shape, tool_choice, params, and
  raw response chunks

Co-Authored-By: Flash <flash@hermes>
@vivganes
vivganes merged commit 526511e into main Jun 28, 2026
2 checks passed
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.

1 participant