Skip to content

fix(native-chat): repair a structured chat tab permanently fenced by an inherited publication epoch - #18906

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/structured-tab-epoch-fence
Sep 6, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/structured-tab-epoch-fence

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​319 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​319
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​199 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​188

The observable failure

A structured chat tab published by the host can be dropped by the renderer permanently — the host inventory has it, the frame is delivered, and the tab never reaches the tab bar.

applyLocalStructuredSessionTabSnapshots fences a snapshot whose publication epoch is in the worktree's retired list:

if (epochHistory?.retired.includes(snapshot.publicationEpoch) && !sharesLineage) continue

An epoch lands in retired whenever another publisher takes over the worktree. But main legitimately alternates publishers for one worktree — renderer:<uuid>, headless:<ts>, removed:<ts> — and a live publisher can return after those transient interlopers. publishStructuredAgentSessionTab inherits the worktree's existing epoch rather than minting one, so the structured tab arrives under an already-blacklisted epoch, and every later frame carrying it is rejected too.

Measured in a live instance at the moment of the drop:

cursor:  { publicationEpoch: 'headless:pty-backed:mtovsn3x', snapshotVersion: 1 }
history: current: 'headless:pty-backed:mtovsn3x'
         retired: ['renderer:53c8f87d-…', 'removed:mtovryl4']
incoming: epoch 'renderer:53c8f87d-…', v7, carrying agent-session:46e11156-…

The frame is delivered — a second session.tabs.subscribeAll subscription registered alongside the app's received it intact, with the agent-session tab present in both tabs and tabGroups[0].tabOrder. It is the apply that drops it. Confirmed by a single-variable ablation in the running app: splicing only renderer:53c8f87d-… out of retired, changing nothing else, and re-delivering the identical frame makes the tab appear.

Terminals look unaffected because the structured channel applies with contentScope: 'agent-session' and terminal tabs come from the renderer's own authority — the same dropped frame is invisible for terminals and fatal for chat tabs.

The root cause, and what this PR does about it

The root cause is the shape of publication epochs: they are inherited rather than minted per publisher generation, and main mints several of them per event (Date.now()-suffixed) rather than per generation. The blacklist then converts that churn into a permanent fence.

This PR repairs the observable failure without changing that shape.

The fence itself is right to reject the frame: it cannot tell a returning publisher apart from a frame delayed by a dead generation, and a delayed frame's version can outrank the live cursor — the hazard pinned by local-structured-session-tabs-sync.test.ts:741, which passes here unmodified. So the fence is not relaxed. The drop simply stops being final: it schedules one bounded, debounced authoritative session.tabs.listAll, and only that census may revive an epoch — and only the single epoch it names current, leaving every other retired generation fenced. A census is the synchronous answer to a request we just issued, so it cannot be the delayed frame the fence exists to reject. Subscription frames are never exempt.

Scope of the exemption: the repair refresh only. restoreLocalStructuredSessionTabsOnce still calls refreshLocalStructuredSessionTabs without it, so the startup restore stays fenced exactly as today and first paint is unchanged.

Bounds: 3 attempts per worktree, 250ms doubling to a 5s cap, coalesced per worktree. The cap decays after 60s of quiet rather than latching — a run of transient RPC failures must not hide a chat tab for the renderer's lifetime. A refresh that succeeds without actually reviving the epoch counts as a failed attempt, so a publisher that keeps re-sending a retired epoch cannot drive an endless refetch. The repair map is pruned in the same sweep that drops publisher cursors for vanished worktrees, cancelling any pending timer; that prune is cycle-free because the refresh is injected into the repair lane rather than imported by it.

What this PR deliberately does not fix

The epoch shape itself. Fixing it properly is a sequence, and the first step is not the one it looks like:

  1. De-overload the epoch. It is not only a generation id — it is also a publisher-kind discriminator. isHeadlessMobileSessionPublication / isHeadlessBuiltMobileSessionPublicationBase prefix-match headless:, headless-hydrated: and :headless-merge:, and their six consumers gate shouldPreserveHeadlessMobileSessionTab (whether a tab survives a renderer graph merge) and releaseRuntimeSessionOwnershipForRendererRetiredTabs (whether a PTY's runtimeSessionOwned is released). The kind has to move onto its own field first — a change to the shared snapshot shape, with paired-client reach.
  2. Then normalise epochs to per-generation ids, replacing the 13 Date.now()-minted sites across 11 files and the structured inheritance.
  3. Then flip the client test from blacklist membership to identity and delete the retired list, including SESSION_TABS_RETIRED_EPOCH_LIMIT, whose splice-out silently un-fences the 9th-oldest dead generation.

None of it can be done here. Step 2 without step 1 makes both kind predicates false everywhere, silently changing tab preservation and PTY ownership release — a terminal-ownership behaviour change inside a chat-tab-visibility fix. And an intermediate that keeps the prefixes while swapping Date.now() for a generation id would be strictly worse: identity-first would then reject every renderer: ↔ headless: alternation, which today is merely non-current-non-retired and therefore accepted.

Residual risk, stated up front

A slow or reordered listAll response could land content older than subscription frames already applied, because the retired fence no longer arbitrates for that response. Mitigated as far as it can be — the within-lineage snapshotVersion check and the sync generation fence both still apply, and only the epoch the census names current is revived — but not eliminated. This is the deliberate trade for repairing a permanently invisible tab.

The cheap fix, and why it was rejected

sameSessionTabsPublicationLineage treats X and X:headless-merge:<hash> as the same lineage, so having the publish side emit renderer:<uuid>:headless-merge:<hash> is a different string from the retired epoch and slips the fence in one line. Rejected: it re-introduces exactly the identity oscillation that getMergedMobileSessionPublicationEpoch deliberately strips ("encoding a merge hash here would make the identity oscillate and permanently fence later rows"), it churns the 8-entry retired list, and publicationEpoch is wire-visible to paired clients. Recorded here so it is not re-proposed.

Tests

  • local-structured-session-retired-epoch-repair.test.ts — replays the measured multi-epoch sequence (renderer:E v6 → removed: → headless:pty-backed: v1 → renderer:E v7 with a chat tab): the tab is absent at the drop, the drop is reported to the repair lane, the authoritative census lands it, a non-authoritative redelivery stays dropped, and only the named epoch is revived.
    • Includes a positive control (the same frame lands when nothing is retired). Without it the empty results prove nothing.
    • The state must keep the worktree "known" (folderWorkspaces / a terminal tab) or the trailing cursor sweep deletes the epoch history every round and the scenario is silently vacuous. An earlier draft failed exactly this way.
  • retired-epoch-repair.test.ts — coalescing, bounded attempts with an observable warn, cap decay, re-arming after a successful repair, and pruning for vanished worktrees.

Red-then-green: disabling only the authoritative exemption (if (!options.authoritative) → if (true)) turns exactly two tests red — "lands the tab when the authoritative census re-delivers the same frame" and "revives only the epoch authority names" — while local-structured-session-tabs-sync.test.ts stays green throughout, confirming the guard's own coverage does not depend on this change.

Verification

oxfmt clean; oxlint clean; pnpm run check:code-quality:changed 0 new findings across 7 files; pnpm run audit:code-quality:native clean; tsc clean on config/tsconfig.node.json, config/tsconfig.tc.cli.json, config/tsconfig.tc.web.json; the full src/renderer/src/runtime suite passes (167 files, 1310 tests).

Relationship to other work

Orchestration-created structured worker tabs are one reachable case — they have no renderer-side launcher, so unlike the user launch path (which incidentally re-applies the host inventory on every launch via verifyPublishedSession) nothing papers over the drop. But the bug is in the renderer's local structured session sync and predates that work; any host-published structured tab can hit it.

…ublisher

A publication epoch is retired whenever another publisher takes over a worktree, and a
retired epoch is then rejected forever. But a live publisher can return after transient
interlopers - a `removed:` retraction, then a headless rebuild whose version restarts at
1 - and the structured tab publish inherits the worktree's existing epoch rather than
minting one, so it arrives under the blacklisted epoch and is dropped. The chat tab never
reaches the tab bar.

The fence is right to reject the frame: it cannot tell a returning publisher apart from a
delayed frame queued by a dead generation, whose version can outrank the live cursor. So
the drop is no longer final - it schedules one bounded, debounced authoritative
`session.tabs.listAll`, and only that census may revive an epoch, and only the one it
names current. Subscription frames stay fenced exactly as before.
@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds authoritative repair for retired structured-session publication epochs. Snapshot application now distinguishes subscription frames from authoritative census responses. Non-authoritative retired epochs trigger repair callbacks and remain rejected. Authoritative responses revive the matching epoch and apply normally. Subscription processing schedules debounced, bounded refreshes with generation checks and exponential backoff. Tests cover renderer return sequences, epoch preservation, repair scheduling, retry limits, retry decay, and stale-worktree cleanup.

Merge Risk: 🟡 Moderate · up to 41599

This change adds recovery for returning structured-session tabs, but a transient inventory request failure can still leave tabs hidden without using the remaining retry budget. Shared repair state can also retain attempt consumption across epoch changes, so these issues should be resolved before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description gives a detailed explanation of the failure, solution, scope, risks, tests, and verification. However, it omits required template sections, including the linked issue, visual proof or … Complete the repository template. Add a linked issue after Fixes #, provide visual proof or write N/A with a reason, complete the testing checkboxes and list tested platforms, address AI disclosure, agent-skill boundary, review, notes, …
✅ Passed checks (3 passed)
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 clearly identifies the native chat fix and the permanent retired-publication-epoch failure. It is specific, concise, and related to the main change.
Full details: Description check

Explanation

The description gives a detailed explanation of the failure, solution, scope, risks, tests, and verification. However, it omits required template sections, including the linked issue, visual proof or an explicit N/A explanation, checklist items, platform testing details, AI disclosure, review, agent-skill boundary, and notes.

Resolution

Complete the repository template. Add a linked issue after Fixes #, provide visual proof or write N/A with a reason, complete the testing checkboxes and list tested platforms, address AI disclosure, agent-skill boundary, review, notes, and checklist sections.

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 56907ad9-cfb8-424f-8f81-24ac9d94f704

📥 Commits

Reviewing files that changed from the base of the PR and between 51eed5a and 58e2211.

📒 Files selected for processing (7)
  • src/renderer/src/runtime/local-structured-session-retired-epoch-repair.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-refresh.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts
  • src/renderer/src/runtime/web-session-tabs-sync/publisher-identity-fences.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment on lines +50 to +52
const state = repairState(worktreeId)
if (state.timer !== null || state.exhausted) {
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Track the epoch that the pending repair must verify.

Lines 50-52 create one state per worktree and discard a later dropped epoch while the timer is pending. If epoch A schedules the timer and epoch B is current when the census returns, the census revives B, but lines 76-79 still check A. A correctly remains retired, so the state does not rearm. Later drops can exhaust the shared budget and permanently reject a returning B again.

Keep the latest pending epoch, or track repair state per epoch with a bounded worktree budget. Add a mixed-epoch test where the first dropped epoch remains dead and the second epoch is revived by the census.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The repair mechanism is correct and well-tested, but the repair lane's bookkeeping is never torn down when the sync is superseded. An exhausted worktree survives a toggle-off/on and stays permanently unrepairable, silently re-introducing the invisible-tab bug after an unrelated exhaustion.

Reviewed changes

  • Retired-epoch repair lane — retired-epoch-repair.ts adds a debounced, per-worktree, bounded (3 attempts, 250ms doubling to 5s) authoritative session.tabs.listAll refetch that re-arms only when the dropped epoch actually revives.
  • Authoritative fence exemption — snapshot-apply.ts threads an authoritative option that revives (rather than drops) a retired epoch when the census names it current; subscription frames stay fenced and instead report the drop via onRetiredEpochDrop.
  • Wiring — subscription.ts routes retired-epoch drops into the repair lane; inventory-refresh.ts passes the option through only on the repair path, so the startup restore stays fenced.
  • Shared helper — publisher-identity-fences.ts adds reviveRetiredValue and reuses hasRetiredValue.
  • Tests — a replay of the measured multi-epoch sequence (with a positive control) plus coalescing, attempt-bound, and re-arm coverage.

⚠️ Repair-lane state is never reset when the sync is superseded, so an exhausted worktree strands tabs permanently

repairsByWorktree in retired-epoch-repair.ts holds attempts and exhausted per worktree, but nothing clears it when the sync is toggled off or superseded. clearLocalStructuredSessionTabs calls supersedeLocalStructuredSessionGeneration and forgetLocalStructuredSessionPublicationCursors, which clear the generation and localStructuredSessionEpochHistoryByWorktree — but not repairsByWorktree. The only production cleanup is the pending-timer path, which deletes the entry when the generation it captured is stale; an exhausted entry has no timer, so it lives for the lifetime of the renderer.

The consequence is concrete because of the asymmetry with the epoch history: after a toggle-off/on, localStructuredSessionEpochHistoryByWorktree is reset to empty, so any subsequent repair would trivially "succeed" (stillRetired reads undefined → false) — but scheduleRetiredEpochRepair returns early on state.exhausted (or hits attempts >= MAX_REPAIR_ATTEMPTS) before it ever schedules. A worktree that exhausted its budget under one sync instance gets no repair under the next, even for a brand-new, legitimately returning publisher.

Technical details
# Repair-lane state must be torn down with the generation fence

## Affected sites
- src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.ts:33 — `repairsByWorktree` map holds `attempts` / `exhausted` with no production reset.
- src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.ts:54 — `exhausted` is set permanently once reached.
- src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts:65 — `clearLocalStructuredSessionTabs` supersedes generation and forgets cursors but does not clear `repairsByWorktree`.
- src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-generation-fence.ts:36 — `forgetLocalStructuredSessionPublicationCursors` clears epoch history, leaving the repair map inconsistent with it.

## Required outcome
- A generation supersede / toggle-off must also reset (or at least re-arm) per-worktree repair state, so an exhausted worktree becomes repairable again after the sync re-initializes and its epoch history is cleared.

## Suggested approach
- Add a production teardown that iterates `repairsByWorktree`, clears pending timers, and clears the map; call it from the same path that supersedes the generation (e.g. alongside `forgetLocalStructuredSessionPublicationCursors` or in `clearLocalStructuredSessionTabs`). `resetRetiredEpochRepairsForTests` already does exactly the timer-clear + `clear()` work and can likely be reused/generalized.

ℹ️ Nitpicks

  • retired-epoch-repair.ts:84 — the .catch on the repair refresh only logs. A transient session.tabs.listAll failure consumes one of the three attempts without re-arming, so the tab stays invisible until an unrelated drop arrives; unlike a no-op success, there is no signal that distinguishes "RPC failed" from "epoch genuinely still retired".
  • local-structured-session-retired-epoch-repair.test.ts:191 — the test titled "revives only the epoch authority names, leaving other generations fenced" asserts the displaced headless epoch becomes retired and the renderer epoch is not, but never asserts the removed: epoch stays in retired; the description claims "leaving every other retired generation fenced" while the assertion leaves that claim unpinned.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

…tate

The attempt cap latched: three transient RPC failures left `exhausted` set for the
renderer's lifetime, permanently hiding a chat tab behind a single console warning. It
now decays, so a worktree that has been quiet for a minute gets its full budget back.

The repair map was also missing from the sweep that drops publisher cursors for vanished
worktrees, leaking an entry per deleted worktree. Pruning it there required inverting the
repair lane's dependency on the inventory refresh, which is now injected.
@brennanb2025 brennanb2025 changed the title fix(native-chat): repair a structured tab fenced out by a returning publisher fix(native-chat): repair a structured chat tab permanently fenced by an inherited publication epoch Sep 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: a5639359-fcb0-47f9-8a0f-29a05789d7e2

📥 Commits

Reviewing files that changed from the base of the PR and between 58e2211 and 43ac8d7.

📒 Files selected for processing (4)
  • src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

}
const generation = localStructuredSessionGeneration()
const delay = Math.min(BASE_REPAIR_DELAY_MS * 2 ** state.attempts, MAX_REPAIR_DELAY_MS)
state.attempts += 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Retry a rejected repair request.

Line 83 consumes an attempt before runRepair starts. The rejection handler only logs the error. It does not schedule the remaining attempts.

If session.tabs.listAll fails once and no further subscription frame arrives, the returning publisher stays dropped despite two remaining attempts. Schedule the next bounded backoff attempt after a rejected runRepair. Keep the retry conditional on the generation and on the repair state still being registered.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found. The prior [!IMPORTANT] finding is addressed cleanly by the decay + prune approach.

Reviewed changes

  • Decayed repair cap — retired-epoch-repair.ts drops the latched exhausted flag for a 60s decay window (REPAIR_ATTEMPT_DECAY_MS), so a worktree that exhausts its budget under transient RPC failures re-arms after a quiet minute instead of stranding a chat tab for the renderer's lifetime.
  • Pruned repair state — forgetRetiredEpochRepairsOutside is called from the snapshot-apply trailing sweep, cancelling pending timers and dropping repair entries for worktrees that no longer exist.
  • Broke the import cycle — the repair runner is injected (RetiredEpochRepairRunner) rather than imported from inventory-refresh, which lets snapshot-apply.ts prune the repair module's state without a snapshot-apply → retired-epoch-repair → inventory-refresh → snapshot-apply cycle.
  • Tests — the repaired unit tests switch to the injected runner and add two meaningful cases: decay re-arm (fails without decay) and deleted-worktree pruning (fails without the timer cancel).

The residual toggle-off/on window (an exhausted worktree stays unrepairable for up to 60s after a quick re-enable) is a bounded, documented trade-off rather than the permanent strand the prior review flagged, so I do not consider it blocking.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 84432d3 into main Sep 6, 2026
31 checks passed
brennanb2025 pushed a commit that referenced this pull request Sep 6, 2026
Main landed #18906, which repairs the same epoch-fencing failure from the other
end: when the fence drops a frame it now schedules one bounded authoritative
census, and only that census may revive an epoch. This branch prevents the
wrongful retirement instead — a sentinel or a retraction is no longer recorded
as the current publication.

They compose. Prevention keeps the common case from ever reaching the fence, so
no census round trip and no window where the chat is invisible; the repair lane
still covers a retirement this branch does not prevent, such as a publisher
returning under an epoch it inherited. Kept both sides of the one textual
conflict: the retraction type guard and the census options.
Him188 added a commit to Him188/orca that referenced this pull request Oct 12, 2026
New tabs created on a paired host never appeared until another tab was
closed. Host-side tab operations (close, move, tab props) publish under a
fresh `headless:<ts>` epoch while the host renderer keeps republishing under
its one long-lived epoch; the client retired that epoch on the headless frame
and then dropped every later frame for the worktree as outranked. A close
minted a new epoch, which is why the missing tabs appeared then.

Port the local structured-session repair (stablyai#18906) to the web-session lane:
a retired-epoch drop schedules a bounded, non-deduped `session.tabs.list`,
and that list revives the epoch it names unless a live frame or removal
arrived after the request was sent. Subscription frames stay fenced. The
repair scheduler is extracted so both lanes share it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…an inherited publication epoch (stablyai#18906)

* fix(native-chat): repair a structured tab fenced out by a returning publisher

A publication epoch is retired whenever another publisher takes over a worktree, and a
retired epoch is then rejected forever. But a live publisher can return after transient
interlopers - a `removed:` retraction, then a headless rebuild whose version restarts at
1 - and the structured tab publish inherits the worktree's existing epoch rather than
minting one, so it arrives under the blacklisted epoch and is dropped. The chat tab never
reaches the tab bar.

The fence is right to reject the frame: it cannot tell a returning publisher apart from a
delayed frame queued by a dead generation, whose version can outrank the live cursor. So
the drop is no longer final - it schedules one bounded, debounced authoritative
`session.tabs.listAll`, and only that census may revive an epoch, and only the one it
names current. Subscription frames stay fenced exactly as before.

* fix(native-chat): decay the structured tab repair cap and prune its state

The attempt cap latched: three transient RPC failures left `exhausted` set for the
renderer's lifetime, permanently hiding a chat tab behind a single console warning. It
now decays, so a worktree that has been quiet for a minute gets its full budget back.

The repair map was also missing from the sweep that drops publisher cursors for vanished
worktrees, leaking an entry per deleted worktree. Pruning it there required inverting the
repair lane's dependency on the inventory refresh, which is now injected.

---------

Co-authored-by: Merge Sim <sim@local>
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