Skip to content

Runtime Host should project live-run state, distinguishing known-empty from unknown #3059

Closed

Description

@Astro-Han

Problem

Nothing outside the Runtime process can tell whether a task is actually running. The rail infers it from streaming, which only knows about turns the local renderer sent, so a task running under a bot channel or in a second window reads as idle.

SessionSummary.runningTurnIds looks like the answer and is documented as the runtime's projection of the runs it holds. It does not reach Desktop:

  • SessionManager.listSessions() (packages/runtime/src/session-manager.ts) is the only path that attaches it.
  • Runtime Host's catalog does not call that; session-catalog-coordinator.ts reads storage directly via listCatalogPage().
  • The wire projection's field list (packages/runtime-host/src/protocol/session-catalog.ts) does not include it, and the projection function does not add it.
  • Desktop Main's converter (runtime-host-session-catalog-ipc-main.ts) copies persisted fields only.

The identifier appears nowhere in packages/runtime-host/src or apps/desktop/src/main outside a test fixture. #3033 removed a read of it that could never fire.

What is needed

Host should project live-run state as part of the catalog, versioned, and the projection has to distinguish known-empty from unknown. Collapsing those two is what lets a persisted status: 'running' left behind by a crash pulse forever: with no way to say "the Host holds no run for this task", a reader cannot tell "not running" from "no information".

Metadata mutation responses describe a header alone and legitimately omit live state, so whatever carries it must not be erased when a summary is replaced wholesale (use-app-shell-session-list.ts).

Runtime Host is the sole authority for execution, so this belongs there and needs its own review.

Context

Found by Codex in the adversarial review of #3033.

Activity

  1. Sun-GLiang commented on Aug 15, 2026

    @Sun-GLiang
    Member

    I'd like to take this issue.
    My proposed implementation plan is:

    1. Extend the Runtime Host session-catalog projection with a versioned live-run-state payload.
    2. Preserve the distinction between unknown state, known-empty state, and active running turn IDs.
    3. Wire the live state through the Desktop Main conversion layer without allowing metadata-only mutation responses to erase previously known state.
    4. Update the session rail and transient-cleanup logic to use Runtime Host state while retaining local streaming behavior during synchronization gaps.
    5. Add protocol, Runtime Host, Desktop, and UI tests covering remote runs, stale persisted statuses, and all three live-state cases.

    I’ll implement this on a dedicated branch and open a PR for review.

  2. Astro-Han commented on Aug 15, 2026

    @Astro-Han
    ContributorAuthor

    Assigned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions