Skip to content

[Bug]: session_search misreports platform/source metadata in session summaries #15909

@Freffles

Description

@Freffles

Describe the bug

The session_search tool incorrectly reports the source field in session summaries. The actual session file contains the correct platform metadata, but the search summary displays a different value.

Example:

  • Session file metadata: "platform": "api_server" (created via Hermes Workspace)
  • session_search output: "source": "telegram"

This affects all sessions — the source is being misreported at read/summarize time, not at write time.


To Reproduce

  1. Start a new chat in Hermes Workspace (creates session via api_server platform)
  2. Ask the agent to search for that session: session_search(query="<topic from session>")
  3. Compare the source field in the search result with the actual session file:
    head -20 ~/.hermes/sessions/session_<ID>.json

Expected:

"source": "api_server"

Actual:

"source": "telegram"  // or another incorrect platform

Evidence

Session file (~/.hermes/sessions/session_20260426_010820_6ed506e7.json):

{
  "session_id": "20260426_010820_6ed506e7",
  "platform": "api_server",
  "model": "qwen3.5:397b",
  ...
}

session_search output for the same session:

{
  "session_id": "20260426_010820_6ed506e7",
  "source": "telegram",
  "model": "qwen3.5:397b",
  ...
}

Impact

  • Confuses users about where sessions originated
  • Breaks trust in session metadata for auditing/debugging
  • Blocks A2A handoffs — agents can't reliably determine session provenance, which is critical for multi-agent workflows and platform continuity

Root Cause (likely)

The bug is in the session_search tool's summarization logic — either:

  1. Reading the wrong field from the session JSON
  2. Using a hardcoded/default value instead of the actual platform field
  3. Transforming the value incorrectly during summary generation

The session files themselves are correct — this is a read-time bug, not a write-time bug.


Suggested Fix

  1. Locate the session_search implementation in hermes-agent (likely in tools/ or agent/)
  2. Verify it reads the platform field directly from the session JSON
  3. Ensure the source field in summaries maps 1:1 from platform
  4. Add a test case that verifies platform accuracy across different session sources (cli, telegram, api_server, discord, etc.)

Related

  • Potential A2A (Agent-to-Agent) session visibility — accurate provenance is required for handoffs
  • No existing issue tracks this specific metadata accuracy problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/toolsTool registry, model_tools, toolsetstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions