Skip to content

One MainSequence across Code sessions; share and cache Agents and icons (0.4.22) - #31

Merged
MainSequenceDev merged 2 commits into
mainfrom
claude/shared-pane-state
Oct 26, 2026
Merged

MainSequenceDev merged 2 commits into
mainfrom
claude/shared-pane-state

Conversation

@MainSequenceDev

Copy link
Copy Markdown
Contributor

Why

Every Code session ran its own copy of the MainSequence pane, and the plugin store was read only when a session booted. Switching to a session in another project showed that session's own, often stale, environment, section and settings: choosing Production in one session did not reach the others. Agents also searched again in every session, and their icons arrived batch after batch. On a slow backend the second batch (Sentinel, SentinelExecutor) timed out and never appeared.

What changes

One pane across sessions. Only Home's This session card belongs to a session.

  • Settings are shared as they change. There is no Save step; an edit reaches the other sessions about a second after typing stops.
  • The organization environment follows in every session, which registers that environment's tools. Tools of the previous environment are refused, including in a background session before its tools run.
  • The open section and its details follow: repository, deployments list or run, project, MCP, agent details, and searches.
  • A sign-in, sign-out, MCP connect/disconnect or repository setup/removal is re-read by the others.
  • Activity, the header counter and the status line cover every session. Each operation names its session; only that session can cancel it. A session that stops reporting for three minutes shows its running operation as Interrupted. Reads stay in their own session's Activity.
  • A session re-reads the store when its pane opens or draws (Desktop draws a session when you switch to it), every two seconds while the pane is open, and before a MainSequence tool runs.
  • Checked in the 2.1.308 engine source: $.store.get reads the store file from disk on every call, and $.store.set merges one key under a file lock, so sessions never overwrite each other's keys.

Agents and icons, shared and cached for ten minutes.

  • The listing is shared by every session for ten minutes and drawn at once. An older listing is drawn while it is read again. Search uses the cache; Refresh reads now.
  • One worker serves up to eight agents (was four) and fetches four icons at a time. Batches run together instead of one after another.
  • The worker keeps idle icons for ten minutes in one owner-only file per backend, environment and account, under the MainSequence state folder (claude-desktop/agent-icons), so every session's worker reads one cache. Failed reads are never kept and are retried once a minute later. Icons and tags never enter the plugin store.
  • Icons are re-checked every ten minutes instead of every minute. The old one-minute check re-downloaded every icon from each open pane, because the icon route does not answer If-None-Match.

Measured on a local backend

  • Agent listing: about 15 s, from five sequential requests. It is now read once per ten minutes for all sessions.
  • One icon batch of four: 24 s. The second batch, which holds Sentinel and SentinelExecutor, landed about 20 s after the first, or timed out.
  • Sentinel's icons are valid animated color PNGs (about 44 KB of markup). Nothing was wrong with them except where they sat in the load order.
  • While this was being tested, five 0.4.20 workers were waiting on the backend at once.

Verification

  • npm run release:check with the 2.1.308 engine: typecheck, 113 Node tests, docs, the 0.4.22 ZIP and distribution check, native plugin validate and 11 native tests all pass.
  • New tests run two sessions over one store. They cover environment, section, settings, project detail, Activity with cancel ownership and interrupted runs, the sign-in signal, a background tool call after an environment change, and no echo of a session's own writes.
  • New tests cover the shared Agents listing, eight-agent parallel batches and the one-minute retry. Worker tests cover the disk cache: reuse across workers, Refresh, expiry, owner-only permissions, failed reads not kept, and agents without icons.
  • A new native test starts from a store another session left, and checks the section, environment, Activity and settings, and that a section change is shared.
  • Not done yet: live GUI acceptance in Claude Desktop with two sessions open. The local backend began timing out on the API during testing, so the cross-session icon fast path was verified by tests only.

Release

The version is 0.4.22 in package.json and the lockfile. Merging does not publish: the annotated tag v0.4.22 and the catalog update wait for owner approval.

🤖 Generated with Claude Code

MainSequenceDev and others added 2 commits October 26, 2026 19:22
Every Code session ran its own copy of the pane, and the plugin store was
read only at session boot, so switching to a session in another project
showed its own stale environment, section and settings. The pane is now one
across sessions; only Home's This session card belongs to a session.

- Settings are shared as they change (no Save step), the environment and the
  open section with its details and searches follow in every session, and a
  sign-in, sign-out, MCP change or repository setup is re-read elsewhere.
- Activity, the running counter and the status line cover every session's
  operations; only the running session can cancel one, and a session that
  stops reporting shows its running operation as Interrupted. Reads stay in
  their own session's Activity.
- A session re-reads the store when its pane opens or draws, every two
  seconds while open, and before a MainSequence tool runs. The engine reads
  the store file from disk on every get and writes one key under a file
  lock (checked in the 2.1.308 engine), so sessions never overwrite each
  other's keys.

Agents searched again in every session and their icons arrived batch after
batch; on a slow backend the second batch (Sentinel, SentinelExecutor)
timed out and never appeared.

- The Agents listing is shared by every session for ten minutes and drawn at
  once; an older one is drawn while it is read again. Refresh reads now.
- One worker serves up to eight agents, fetching four icons at a time, and
  batches run together. The worker keeps idle icons for ten minutes in one
  owner-only file per backend, environment and account under the
  MainSequence state folder, shared by every session's worker; failed reads
  are never kept and are retried once a minute later.
- Icons are re-checked every ten minutes instead of every minute, which
  re-downloaded every icon from each open pane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MainSequenceDev
MainSequenceDev merged commit a6adae7 into main Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant