Skip to content

fix(session): pass targetSessionsDir to forkSessionFromParent#101996

Closed
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/session-parent-fork-prepare-dir
Closed

fix(session): pass targetSessionsDir to forkSessionFromParent#101996
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/session-parent-fork-prepare-dir

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Description

This PR resolves an issue where global and cross-agent session forks fail to inherit history and terminate silently.

Changes

  • In session-parent-fork-prepare.ts, pass targetSessionsDir: path.dirname(params.storePath) instead of sessionsDir: path.dirname(params.storePath) into the forkSessionFromParent() parameters. This allows the resolver to correctly resolve the parent session file path from the parent's actual session directory (e.g. the global directory) instead of incorrectly attempting to look up the parent transcript inside the target sessions directory.

Fixes #101811

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Close: current main already carries the same-or-better parent-fork implementation through the targetStorePath accessor contract, and this PR is stale against that API.

Root-cause cluster
Relationship: superseded
Canonical: #101699
Summary: The current PR is superseded by the merged accessor-boundary implementation that already owns parent-fork target placement on current main.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Close this PR and keep the current targetStorePath accessor implementation; a new issue or fresh PR should only be opened with proof of a remaining current-main fork failure.

Do we have a high-confidence way to reproduce the issue?

No high-confidence current-main reproduction of the linked session-fork bug remains: current source resolves the parent store target and passes the child store through targetStorePath. The PR's own patch defect is source-reproducible because it passes a non-existent targetSessionsDir property and drops required fork identifiers.

Is this the best way to solve the issue?

No, this PR is not the best way to solve the issue because current main already solved the directory/target placement through targetStorePath inside the accessor boundary. The maintainable end state is the existing merged implementation, not reintroducing caller-passed directory params.

Security review:

Security review cleared: The diff only changes one TypeScript session-fork callsite and introduces no dependency, workflow, secret, permission, or code-execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • jalehman: Authored and merged the current accessor-boundary parent-fork contract that replaced caller-passed directory params with targetStorePath. (role: recent area contributor; confidence: high; commits: a68caa185bf1, 75f2d08c4a29, 003c51975c77; files: src/auto-reply/reply/session-fork.ts, src/config/sessions/session-accessor.ts, src/gateway/session-create-service.ts)
  • steipete: Authored the merged session-management feature that introduced sessions.create fork behavior, including cross-agent-aware transcript placement and tests. (role: feature introducer; confidence: high; commits: 88f1ec38d4a5, e0852f05e320; files: src/gateway/session-create-service.ts, src/gateway/server.sessions.create.test.ts, src/auto-reply/reply/session-fork.ts)
  • vincentkoc: Recent history on session store target resolution and selected global session handling overlaps the parent-store lookup invariant this PR discusses. (role: adjacent session-store contributor; confidence: medium; commits: 10d1af6867fc, 5e09113edec4; files: src/gateway/session-utils.ts, src/gateway/server.sessions.create.test.ts)

Codex review notes: model internal, reasoning high; reviewed against bf310355387d; fix evidence: commit a68caa185bf1, main fix timestamp 2026-07-07T10:47:02-07:00.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global session forks fail due to resolveSessionFilePath fallback to default agent

1 participant