Skip to content

[Bug]: sessions_list tool returns incorrect transcriptPath #28379

@fafuzuoluo

Description

@fafuzuoluo

Summary

The sessions_list tool returns a transcriptPath field that points to the wrong directory. The path uses the agent workspace root instead of the actual state directory where session transcripts are stored.

Steps to reproduce

1、Start a conversation via any channel (e.g. Feishu, Discord)
2、Call sessions_list tool (or equivalent Gateway RPC)
3、Inspect the transcriptPath field in the response

Expected behavior

~/.openclaw/agents/main/sessions/<session-id>.jsonl

The file at the returned path does not exist.

Actual behavior

~/.openclaw/workspace/<session-id>.jsonl

OpenClaw version

2026.2.26

Operating system

macOS Darwin 21.6.0

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Root Cause

In register.status-health-sessions-B5LtB2me.js, the transcriptPath is resolved via:

const transcriptPath = resolveSessionFilePath(entry.sessionId, entry, sessionPathOpts);

The sessionPathOpts passed here uses the workspace directory as sessionsDir, bypassing the correct resolution logic in resolveAgentSessionsDir() (in paths-BwXONNJC.js), which correctly resolves to <stateDir>/agents/<agentId>/sessions/.

Suggested Fix

sessionPathOpts should derive sessionsDir from resolveAgentSessionsDir(agentId) rather than the workspace path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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