Skip to content

History “Open session … as new tab” fails for local Claude Code (AgentSessions read error) and opens empty tab for local Codex #251

@mcj-coder

Description

@mcj-coder

Summary

Clicking “Open session … as new tab” in History fails for local Claude Code (no tab opens, AgentSessions read error). For local Codex, a tab opens but is empty.

Environment

  • Maestro: 0.14.5
  • OS: Windows
  • Agents: Claude Code (local), Codex (local)

Repro A — Local Claude Code

  1. Open History.
  2. Click “Open session … as new tab” for a history entry that belongs to a different local project than the current active session.
  3. Nothing opens; log adds:
    [ERROR] [[AgentSessions]] read error {}
    

Expected: new tab opens with stored session messages
Actual: no tab opens; AgentSessions read error

Likely root cause (code)

  • History button only passes agentSessionId (no project path).
    src/renderer/components/HistoryPanel.tsx:629
  • onOpenSessionAsTab is wired directly to handleResumeSession.
    src/renderer/hooks/props/useRightPanelProps.ts:220
  • handleResumeSession always uses activeSession.projectRoot for agentSessions.read.
    src/renderer/hooks/agent/useAgentSessionManagement.ts:165-195

If the history entry belongs to another local project, it reads the wrong path and throws.

Suggested fix

Thread projectPath (and sshRemoteId where relevant) from History → RightPanel → handleResumeSession, and use those when reading stored sessions.


Repro B — Local Codex

  1. Run Codex in Maestro and generate History entries.
  2. Click “Open session … as new tab” for a Codex history entry.
  3. A new tab opens but has no messages.

Expected: tab loads stored Codex session messages
Actual: tab is empty

Likely root cause (code)

Codex session ID from output uses thread_id, and stored sessions use “session_meta” with payload.id.

findSessionFile() only checks:

  • filename UUID
  • metadata.id
    but not metadata.payload.id

So session file is not found; read returns empty.

Relevant code:

  • src/main/parsers/codex-output-parser.ts:210,414 (sessionId from thread_id)
  • src/main/storage/codex-session-storage.ts:917-946 (findSessionFile does not check payload.id)

Suggested fix

Update findSessionFile() to match metadata.payload?.id as well as metadata.id.


Extra

The log message shows {} because the error is stringified without message; optional: include error message/code in AgentSessions read failure logs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions