Skip to content

fix(j5): the Inbox stops saying "loading" for a server that is off or retrying - #975

Merged
Jacksondr5 merged 3 commits into
j5/mainfrom
j5code/inbox-disabled-server-958
Nov 9, 2026
Merged

Jacksondr5 merged 3 commits into
j5/mainfrom
j5code/inbox-disabled-server-958

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

A saved server the person has turned off shows ": loading…" above the Inbox's asks forever, even after a pull to refresh (Jackson, Checkpoint 3 on his iPhone). A disabled server's connection phase is available, and J5's read sources treated available as still loading. Part of #958.

What changed

createJ5ReadSourcesAtom (packages/client-runtime/src/j5/readSources.ts) now builds its sources from upstream's enabledEnvironmentIds, the same list upstream's thread and project lists are built from. A server the person turned off, or one this client can't use, is left out: no notice, no read, and it no longer holds the Inbox's loading state or marks the bell's count "last known". Turning it back on brings it back, starting as loading.

resolveJ5ReadSource now reads available as offline, not loading, since nothing is connecting to it. It also takes upstream's rule for a server that keeps retrying: a retry after a failure, or the wait before the next one (presentConnectionState's "Reconnecting"), is not a first load. Such a source reads as offline, keeping its saved rows, and its line says ": reconnecting…", upstream's word. "offline." stays for a client with no network. Before, a stopped server could read either word, depending on the moment ("loading…" during an attempt, "offline." between attempts), and a disabled one read "loading…" forever. A dropped socket now reads "reconnecting…" briefly, not "loading…".

The code is shared, so the fix covers every J5 read on web and mobile: the Inbox and its count, Crew proposals and runtime requests, worktree cleanup, and Fleet.

Tests: written first in readSources.test.ts. Both failed on j5/main: a disabled server came back as "Off: loading", and both a resolved available phase and a retrying connection came back as loading. A retrying source's line says "reconnecting…", and one with no network says "offline.". A server making its first connection still reads as loading.

Not in this PR: the rest of #958, that every test server on one host calls itself "openclaw". That's rig work, so the issue stays open for it.

UI changes

Android, base 067d732e1a (before) and this PR's head (after), with a second saved server, "Secondary".

State Before After
Secondary turned off Inbox with the secondary server turned off, before Inbox with the secondary server turned off, after
Bell with Secondary off Inbox bell with the secondary server turned off, before Inbox bell with the secondary server turned off, after
Pull to refresh finished, Secondary off Inbox after a pull with the secondary server turned off, before Inbox after a pull with the secondary server turned off, after
Secondary stopped and retrying Inbox with the secondary server stopped, before Inbox with the secondary server stopped and reconnecting, after

After: Secondary retrying, with saved results.

Inbox with the secondary server reconnecting and showing saved results, after

After: Secondary back up, its line gone.

Inbox after the secondary server reconnected, after

Before: Secondary stopped. It reads "offline." throughout this sample.

reconnecting-067d-before.mp4

After: Secondary stopped reads "reconnecting…", and the line goes when it restarts.

reconnecting-9d27-after.mp4

Before: a pull with Secondary turned off.

pull-disabled-067d-before.mp4

After: a pull with Secondary turned off.

pull-disabled-9d27-after.mp4

Live testing

Android: PASS at 9d27f18fc9, this PR's head, by the crew tester (Sol 6.1). One real Haiku 5.5 ask was on the primary server, with a second isolated test server saved as Secondary.

  • Secondary turned off:
    • Base showed "Secondary: loading…" indefinitely, and the bell read "last known 1 open; some environments could not be refreshed" (badge 1*).
    • Head shows no line, and the bell reads "1 open" (badge 1).
    • A pull settles cleanly.
  • Secondary stopped: head reads "Secondary: reconnecting…" steadily through retries and a pull, adding "(showing saved results)" once it has cached rows. The line goes when the server restarts.
  • Base's switching between "loading…" and "offline.", which the code suggests, was not seen in a 33-second sample: base stayed "offline.". Head's steady "reconnecting…" is verified either way.

Not exercised:

  • "offline." for a phone with no network: the tester left the network on.
  • Web's J5 pages with two servers: they share this code, so they get the same lines.
  • iOS, dark theme, and relay or tunnel connections.

Upstream impact

None. Only J5-owned files change.

Checklist

  • One concern: what J5's read sources say about a server that isn't connected
  • Tests: written first, failing on j5/main
  • UI changes: before/after stills and videos above
  • Live testing: Android passed; the section above says what was not exercised
  • Upstream-owned files: none edited
  • Upstream product: no change; J5 now follows upstream's list of enabled servers
  • Surfaces: shared read sources cover web and mobile and every J5 read view. Re-enabling a server brings it back. No contract change.
  • Docs: none needed

Built by Claude Opus 5.5 in Claude Code (J5 crew seat builder-identity).

🤖 Generated with Claude Code

…the Inbox

J5's read sources treated a disabled server's "available" phase as still
loading, so the Inbox, its count and web's J5 pages showed "<server>:
loading…" for it forever. They now skip disabled servers, as upstream's
thread and project lists do, and read "available" as not connecting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 9, 2026 4:15am UTC

Request Review

Upstream presents a connection attempt after a failure as reconnecting, and
its query fails rather than waits. J5's read sources now read that attempt as
offline, so a server that keeps retrying no longer switches between
"loading…" and "offline".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Nov 9, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head 7a3e28b

Both of us reviewed the PR independently. Neither found anything that blocks merge.

  • Your first question: web's J5 views. Every createJ5ReadSourcesAtom consumer goes through the same loop, so a server the person turned off, or one with unsupportedReason, drops out of all of them consistently. On web that's the Inbox (open, answered, count), worktree cleanup (open, decided), Crew proposals, Crew runtime requests, Fleet and Fleet detail; on mobile, its Inbox atoms.
    • Before, such a server stayed a permanent "loading" source, which also kept incomplete set, so the bell showed "?" or "N*".
    • Nothing in those views needs a turned-off server's cached rows. The rule is upstream's own: enabledEnvironmentIds gives the same predicate and order its thread and project lists use.
    • A filtered server gets no query, state or config read. The derivation still depends on the catalog, so turning the server back on restores it; reviewer-sol checked on→off→on with a real AtomRegistry.
    • An enabled server that's offline keeps its cached data and its notice.
  • Your second question: the placeholder is safe. An unpublished state used to be read as available, which mapped to loading. It's now read as connecting, which also maps to loading, so the status is unchanged.
  • available → offline can't flash on a working server. available is the supervisor's not-desired state (desired: false). The registry creates every enabled server's supervisor with initiallyDesired: entry.enabled && entry.unsupportedReason === undefined (registry.ts:369), so an enabled server starts connecting or offline, never available.
  • Tests. They were written first and cover: a turned-off server left out and never queried, a server still starting reading as loading, and available reading as offline. 30 focused shared tests pass.

The panel has no open code findings. Before merge it still needs the tester's captures and green J5 CI.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (test files excluded in mixed PRs). label Nov 9, 2026
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

J5 read source creation now includes only enabled catalog environments. Disconnected sources with an available phase resolve to offline, and sources without supervisor state default to connecting.

Changes: J5 read source selection and status

Layer / File(s) Summary
Source selection and status
packages/client-runtime/src/j5/readSources.ts, packages/client-runtime/src/j5/readSources.test.ts
Source creation visits enabled catalog environments. Missing supervisor state defaults to connecting, and an available phase on a disconnected source resolves to offline. Tests cover enabled, disabled, and starting environments, along with status and fixture updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Jacksondr5/j5code#958: This PR changes the resolveJ5ReadSource mapping that the issue identifies as keeping a never-connected saved server in loading state. The duplicate-name and alternating-retry concerns are outside this PR’s scope.

Possibly related PRs

  • Jacksondr5/j5code#662: Its fleet delivery merge consumes J5ReadSources<FleetResponse>, whose source status and membership are changed by this PR.

Suggested reviewers: bryantderosier

Merge Risk: Minimal · up to 7a3e2

No actionable issue is identified in the J5 read-source change; it is ready for normal validation and merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the fix and the affected surface: the J5 Inbox shows "loading" for a server that is off or retrying. The raw summary confirms the changeset does this: disabled servers are omitted from…
Description check Passed The description follows the repository template closely. It includes Problem, What changed, UI changes, Live testing, Upstream impact, and Checklist sections. It names the tracking issue (#958) as par…
Full details: Title check

Explanation

The title names the fix and the affected surface: the J5 Inbox shows "loading" for a server that is off or retrying. The raw summary confirms the changeset does this: disabled servers are omitted from read sources, and the retrying/available phases no longer map to loading. The title is specific and matches the main change, so it passes.

Full details: Description check

Explanation

The description follows the repository template closely. It includes Problem, What changed, UI changes, Live testing, Upstream impact, and Checklist sections. It names the tracking issue (#958) as part of the scope, and it explains the behavior change for disabled servers and for available/reconnecting connection phases. It also documents the tests written first, which fail on j5/main. The UI section has before/after evidence with alt text naming state and side. Live testing reports an Android PASS at a specific commit, lists what was not exercised, and explains why. Upstream impact states no upstream-owned files changed. The Problem section does not include a 'Closes #123' style link to a tracking issue on this repository; it says 'Part of #958' and the issue stays open, which is consistent with a partial fix. The checklist items are all marked, and the 'Built by' footer names the model and harness, as the template requests. The only gaps are minor: the template's 'Closes #' line is replaced by 'Part of #958', which is a reasonable choice for a partial fix, and the description is long relative to the template.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 067d732 and 7a3e28b.

Files selected for processing: 2

  • packages/client-runtime/src/j5/readSources.test.ts
  • packages/client-runtime/src/j5/readSources.ts

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@Jacksondr5 Jacksondr5 changed the title fix(j5): a server the person turned off no longer reads "loading" in the Inbox fix(j5): the Inbox stops saying "loading" for a server that is off or retrying Nov 9, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol, head 11f33c3

Both of us reviewed the retrying-server commit independently. Neither found anything.

  • Rule. reconnecting = state !== null && (state.attempt > 1 || state.lastFailure !== null) is the exact complement of upstream's presentConnectionState test for a first connection (attempt <= 1 && lastFailure === null). It only affects phase connecting: a retrying server reads offline, and saved rows show as "offline (showing saved results)". Unsupported and connected keep their precedence, and an unpublished state still reads loading.

  • Checked with a real AtomRegistry (reviewer-sol):

    attempt lastFailure status
    1 none loading
    2 none offline
    1 a failure offline
    2 a failure offline
  • Tests. They were written first. 29 focused readSources, Inbox and connection-presentation tests pass.

Note (not blocking): a dropped connection restarts as connectingState(…, 1, latestFailure) (supervisor.ts:1154). So an ordinary reconnect, for example on app resume, briefly reads "offline (showing saved results)" where it read "loading…". Upstream calls that state "Reconnecting…". Offline is the truthful one of J5's existing statuses, so no new state is needed, but the tester may see the flash.

The panel has no open code findings. Before merge it still needs the captures and green J5 CI.

…pstream does

Upstream presents a retry after a failure, and the wait before the next one, as
reconnecting. A J5 source in that state keeps reading as offline, so saved
rows stay, but its line now says "<server>: reconnecting…". "offline." stays
for a client with no network.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol, head 9d27f18

Both of us reviewed this commit independently. Neither found anything.

  • Rule. reconnecting now matches presentConnectionState's "Reconnecting" exactly: phase backoff, or connecting with attempt > 1 or a lastFailure.
  • Output field. J5ReadSource.reconnecting?: true is set only when the status is offline, in the same style as guest?: true, so a connected or unsupported source never carries a stale flag. Consumers still see "offline", and their saved rows and the count's incompleteness are unchanged.
  • Notice. The shared j5SourceNotice prints ": reconnecting…", adding " (showing saved results)." when there's data, so web picks up upstream's word too. "offline." stays for phase offline, meaning no network.
  • Tests. They were written first and cover reconnecting with and without cached data, plus backoff. 29 focused tests pass.

Our earlier note is settled: an ordinary reconnect after a dropped socket now reads "reconnecting…", as upstream does.

The panel has no open code findings. Before merge it still needs the captures and green J5 CI.

This branch was successfully deployed

1 active deployment
Preview — 9d27f18f Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant