Skip to content

[Bug]: Session summary never works on remote hosts, and an empty fold then reports "Up to date" with no content #135

Closed

Description

@nplez1

Short summary

The right-sidebar Summary tab never produces a brief for a session running on a remote host. Focusing such a session shows "Focus an agent session to see its summary." — the empty state for "no agent is focused" — and when it does bind to a session it reports "No readable transcript for this session yet." even though that session's transcript is readable and parses. Switching away from the pane and back then shows "Up to date" over a blank body, so the one state that should mean "here is the brief" is also the state that shows nothing.

A summary is the only way back into a long agent session without re-reading the terminal, and remote-host worktrees are most of my usage, so this tab is dead for exactly the sessions that need it.

What happens

Focused on a session on an SSH/remote-host workspace, Summary tab:

  • Focus an agent session to see its summary. — the notFocused copy (SessionSummaryPane.tsx:88-96).
  • Nothing ever folds, and the ledger cache session-summaries.json is never created.

Focused on a local session whose transcript definitely exists:

  • Header hint No readable transcript and body No readable transcript for this session yet.
  • Verified in the same tree: reading the live pi session file at the transcriptPath the hook reported returns 4 events through readSessionSummaryTranscriptEvents itself. So this message is not a missing file and not a parser gap — src/main/session-summary/session-summary-transcript-source.ts handles it.

Switching to another tab and back:

  • Header says Up to date, body is empty, no fold runs visibly, nothing changes on the next visits either.

Reproduction

  1. Agent hooks running locally (agent-hooks/last-status.json has live pi rows with providerSession.transcriptPath).
  2. Focus an agent session in a remote-host workspace → Summary tab shows Focus an agent session to see its summary.
  3. Focus a local agent session → No readable transcript for this session yet.
  4. Click another sidebar tab, come back to Summary → Up to date over an empty body.

Seen on 1.4.214-np.33 (macOS, pi agent), still the behaviour at f1cda22ad2.

Root cause, from the tree at f1cda22ad2

1. The fold is local-host only, and the request cannot even name a host. sessionSummary.open takes { paneKey, foldParams }. Main resolves everything from the local side:

  • src/main/ipc/session-summary.ts:24-33 — getAgentStatusEntry looks the pane up in the local hook server's snapshot, and the brain is built with cwd: join(tmpdir(), 'orca-session-summary').
  • src/main/session-summary/session-summary-transcript-source.ts:69 (stat(filePath)) and :158-164 (isReadableFile) open the transcript path on this machine. A remote hook's transcriptPath is a path on the remote host, so it is never readable here.
  • src/main/session-summary/session-summary-agent-cli-fold-brain.ts:36,59 — mkdirSync a local scratch dir and spawnSourceControlAgent a local CLI to do the folding.

The design doc states the limitation outright (docs/reference/session-summary.md:112-117): "The fold spawns the agent CLI on the local machine and reads the transcript from the local filesystem … Storage is host-keyed; resolution is local" — the store was made host-keyed in anticipation, but nothing is host-aware. rg -n "remote|host" src/main/session-summary finds nothing.

2. "Cannot summarize here" is reported as "nothing is focused." The pane's subject is the strictly-focused pane (session-summary-subject.ts:36-38), and every failure to name one collapses into the same copy. A remote pane whose status row is missing from the local store — the client clears transient rows per connection (agent-status-cleanup-actions.ts:171) — lands on notFocused, which tells the user to do something they already did.

3. An empty fold is persisted as a summary, so the next visit claims "Up to date" with nothing in it. SessionSummaryService.close() (session-summary-service.ts:158-170) calls ensureStoredEntry unconditionally, which creates a fresh entry around emptySessionSummaryLedger() (:316-327) even when no fold ever produced a ledger. On reopen, resolveSessionSummaryHeaderState sees a non-null ledger and falls through to Up to date, while the ledger view renders nothing because every section is empty. This is the same class of bug #57 fixed for the ledger === null case, one step further along.

Related, and probably what produced No readable transcript for a readable transcript: a fold that returns no new events is recorded as unavailable (session-summary-service.ts:216-219), which the UI renders as "no readable transcript". A session that is readable but has nothing new since its last fold therefore accuses itself of having no transcript.

Why not just hide the tab on remote hosts

Hiding it makes the remote case honest but does not make it useful, and the pieces for a real fix are already in the tree:

  • Host-scoped transcript plumbing already exists next door: src/preload/api/ai-vault-api.ts:39 (searchStatus(executionHostScope?)) and the AI Vault scanners run per execution host. A host-aware transcript read is a solved shape here, not a new subsystem.
  • The ledger store is already host-keyed, so folding a remote session needs no migration.
  • sessionSummary.open needs the owning ExecutionHostId in its request; from there either read the transcript from the owning host and fold locally, or ask the host to run its own fold. Reading-then-folding locally keeps the model list meaningful, which is the reason the doc gives for keeping resolution local.
  • The copy needs three distinct states instead of two: nothing focused / this host cannot summarize this session / no transcript yet. And an empty ledger must not be reported as Up to date — close() should not write an entry at all when no ledger was ever produced.

Not verified

  • Not reproduced against a live SSH host from inside this session, so I have not pinned whether the remote notFocused comes from the status-row lookup returning nothing or from a pane key that resolves and then fails at the transcript read. Both are consistent with the symptom, and both are answered by the same host-aware fix.
  • The Up to date empty state was reproduced on a local session only; I have not checked whether a remote pane ever reaches it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions