openclaw - ✅(Solved) Fix [Bug]: sessions_list tool does not return sessionFile field, causing UI to show wrong transcript [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56925Fetched 2026-04-08 01:45:55
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
cross-referenced ×2referenced ×2

The sessions_list tool does not return the sessionFile field from sessions.json, causing Control UI to display the wrong transcript content when sessionId and sessionFile point to different files.

This is a continuation/incomplete fix of #28379.

Root Cause

In sessions.json:

{
  "sessionId": "xxx-xxx-xxx",
  "sessionFile": "/home/user/.openclaw/agents/some-agent/sessions/xxx-xxx-xxx.jsonl"
}

The sessionFile field contains the correct path, but sessions_list does not return it.

Fix Action

Fixed

PR fix notes

PR #56935: fix: include sessionFile in sessions_list tool response

Description (problem / solution / changelog)

Summary

The sessions_list tool was not returning the sessionFile field from session records, causing the Control UI to derive an incorrect transcript path — especially for multi-agent setups where sessionId and sessionFile point to different locations.

Root Cause

In sessions-list-tool.ts, the sessionFile field was already being read from the gateway response and used to compute transcriptPath, but it was never included in the returned row object. This meant the Control UI could not access the raw sessionFile path directly.

Changes

  • Added sessionFile?: string to the SessionListRow type in sessions-helpers.ts
  • Added sessionFile to the row object returned by sessions-list-tool.ts
  • Added a test case in sessions-list-tool.test.ts verifying sessionFile is present in the tool output

Testing

Existing tests pass. Added test for sessionFile field presence.

Fixes openclaw/openclaw#56925

Changed files

  • src/agents/tools/sessions-helpers.ts (modified, +1/-0)
  • src/agents/tools/sessions-list-tool.test.ts (modified, +57/-0)
  • src/agents/tools/sessions-list-tool.ts (modified, +1/-0)

Code Example

{
  "sessionId": "xxx-xxx-xxx",
  "sessionFile": "/home/user/.openclaw/agents/some-agent/sessions/xxx-xxx-xxx.jsonl"
}
RAW_BUFFERClick to expand / collapse

Summary

The sessions_list tool does not return the sessionFile field from sessions.json, causing Control UI to display the wrong transcript content when sessionId and sessionFile point to different files.

This is a continuation/incomplete fix of #28379.

Steps to reproduce

  1. Multi-agent setup (multiple agents configured)
  2. Have conversations in different agents
  3. Open Control UI and select a session from a non-default agent
  4. Click on a conversation to view transcript

Expected behavior

Control UI should display the correct transcript for the selected session.

Actual behavior

Control UI shows content from a different session because:

  1. sessions_list returns only sessionId
  2. UI derives transcript path from sessionId (e.g. ~/.openclaw/workspace/<sessionId>.jsonl)
  3. But the actual path is stored in sessionFile field (e.g. ~/.openclaw/agents/<agentId>/sessions/<sessionId>.jsonl)

Root cause

In sessions.json:

{
  "sessionId": "xxx-xxx-xxx",
  "sessionFile": "/home/user/.openclaw/agents/some-agent/sessions/xxx-xxx-xxx.jsonl"
}

The sessionFile field contains the correct path, but sessions_list does not return it.

Suggested fix

sessions_list should return the sessionFile field or compute transcriptPath correctly using resolveAgentSessionsDir(agentId).

OpenClaw version

2026.3.24

Related

  • #28379
  • #56079

extent analysis

Fix Plan

To fix the issue, we need to modify the sessions_list tool to return the sessionFile field. Here are the steps:

  • Modify the sessions_list function to include the sessionFile field in its response.
  • Update the UI to use the sessionFile field to derive the transcript path.

Example code:

# Modified sessions_list function
def sessions_list():
    sessions = []
    for session in sessions_json:
        sessions.append({
            'sessionId': session['sessionId'],
            'sessionFile': session['sessionFile']  # Include sessionFile field
        })
    return sessions

# Updated UI code to use sessionFile field
def get_transcript_path(session):
    return session['sessionFile']  # Use sessionFile field to derive transcript path

Verification

To verify the fix, follow these steps:

  • Run the modified sessions_list tool and verify that it returns the sessionFile field.
  • Open Control UI and select a session from a non-default agent.
  • Click on a conversation to view transcript and verify that the correct transcript is displayed.

Extra Tips

  • Make sure to update the sessions_list function to handle cases where the sessionFile field is missing or empty.
  • Consider adding error handling to the UI code to handle cases where the transcript file is not found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Control UI should display the correct transcript for the selected session.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: sessions_list tool does not return sessionFile field, causing UI to show wrong transcript [1 pull requests, 1 participants]