Skip to content

Retry failed post-settlement mecatui session reconciliation #2076

Open

Description

@jbeda

Problem

In the in-flight-run reload path of #2071, a snapshot can release the live-feed barrier while deferring cumulative usage and context occupancy until the run settles. At settlement, refreshAfterSettledRun clears reloadNeedRefresh before the follow-up GetSession succeeds (cmd/mecatui/ui/reload_ordering.go:188-193). If that RPC fails, handleSnapshotFailure returns without retry because reloadPending is already false (reload_ordering.go:121-131). The UI retains the last displayed counters, which may remain stale indefinitely even when the session and feed are otherwise healthy. The run-settlement path in cmd/mecatui/ui/update.go:1949-1953 has the same early-clear behavior.

Expected

Keep a reconciliation obligation until a successful, current-session authoritative fetch (or session switch/exit); retry failed post-settlement fetches on a bounded backoff without blocking the already released live feed or overwriting newer session data. Preserve last confirmed display while retrying.

Regression proof

Exercise: start reload during an active run, defer counters and release the feed on the initial snapshot, settle the run, fail the follow-up GetSession, then succeed on a retry. Assert usage and occupancy converge, retries stop on success or session switch/exit, and no stale reply overwrites newer state.

Discovered during review of #2071; this issue tracks the retry failure separately from title ordering and view-preservation coverage.

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