Skip to content

fix(sessions): resolve transcript paths with explicit agent context#16288

Merged
gumadeiras merged 5 commits into
openclaw:mainfrom
robbyczgw-cla:fix/16271-16278-session-path-agentid
Feb 14, 2026
Merged

fix(sessions): resolve transcript paths with explicit agent context#16288
gumadeiras merged 5 commits into
openclaw:mainfrom
robbyczgw-cla:fix/16271-16278-session-path-agentid

Conversation

@robbyczgw-cla

@robbyczgw-cla robbyczgw-cla commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #16271 and #16278 — transcript path resolution used wrong agent context in multi-agent setups.

Root cause

resolveSessionFilePath() was called without explicit agentId in several dispatch paths. When agent context was missing or mismatched, resolution fell back to the wrong sessions directory and failed with Session file path must be within sessions directory.

Changes

Pass agentId through session-file resolution call sites:

  • src/gateway/server-methods/chat.ts
  • src/gateway/session-utils.fs.ts
  • src/agents/subagent-announce.ts
  • src/agents/tools/sessions-list-tool.ts
  • src/config/sessions/transcript.ts

Harden resolveSessionFilePathOptions():

  • src/config/sessions/paths.ts — if both storePath and agentId are provided and the resolved dir looks like a default path for a different agent, prefer the explicit agentId

Impact

  • Single-agent setups: unchanged
  • Multi-agent setups: transcript resolution now consistently uses correct agent context

AI-assisted (Claude). Reviewed by human.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: S experienced-contributor labels Feb 14, 2026
@robbyczgw-cla
robbyczgw-cla force-pushed the fix/16271-16278-session-path-agentid branch from b0d6b99 to 4539408 Compare February 14, 2026 16:11
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed channel: discord Channel integration: discord size: S labels Feb 14, 2026
@robbyczgw-cla
robbyczgw-cla force-pushed the fix/16271-16278-session-path-agentid branch 2 times, most recently from 14df9c2 to 55d9345 Compare February 14, 2026 16:44
@gumadeiras gumadeiras self-assigned this Feb 14, 2026
@gumadeiras
gumadeiras force-pushed the fix/16271-16278-session-path-agentid branch 3 times, most recently from 258ac8d to fa117c4 Compare February 14, 2026 18:44
robbyczgw-cla and others added 5 commits February 14, 2026 13:44
… paths

Sub-agent and implicit-main-agent sessions failed with 'Session file
path must be within sessions directory' because resolveSessionFilePath
was called without agentId in several reply dispatch paths. This caused
transcript paths to resolve against the main agent's directory instead
of the correct agent's directory.

Fixes openclaw#16271
Fixes openclaw#16278
@gumadeiras
gumadeiras force-pushed the fix/16271-16278-session-path-agentid branch from fa117c4 to 7cbe9de Compare February 14, 2026 18:44
@gumadeiras
gumadeiras merged commit cab0abf into openclaw:main Feb 14, 2026
9 checks passed
@gumadeiras

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @robbyczgw-cla!

GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
…penclaw#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9de
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vincentkoc pushed a commit to vincentkoc/openclaw that referenced this pull request Feb 15, 2026
…penclaw#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9de
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…penclaw#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9de
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…penclaw#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9de
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…penclaw#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9de
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Implicit "main" agent not in agents.list causes "Session file path must be within sessions directory" on all channel messages

2 participants