Skip to content

fix(server): reuse a live lease instead of minting a second tab - #653

Open
kushals256 wants to merge 1 commit into
reticlehq:mainfrom
kushals256:fix/lease-reuse-same-origin
Open

fix(server): reuse a live lease instead of minting a second tab#653
kushals256 wants to merge 1 commit into
reticlehq:mainfrom
kushals256:fix/lease-reuse-same-origin

Conversation

@kushals256

@kushals256 kushals256 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • A second reticle_lease acquire on the same origin minted another tab. Both stayed connected, so every later reticle_snapshot / reticle_query required sessionId for the rest of the run.
  • Acquire now reuses the live lease and says so. If that tab is gone (a reload dropped the session), the dead lease is released and a fresh one is minted.
  • The parallel suite still isolates via acquireLeasedSession — ten flows on one origin need separate contexts on purpose.
  • Closes [agent] a second reticle_lease acquire on the same origin poisons default session resolution #600.

Test plan

  • Second acquire on the same origin (different path) returns the first sessionId, reused: true, and does not call the pool again
  • Different origin still mints a second lease
  • Dead lease on this origin is released, then a fresh one is minted (activeCount stays 1)
  • leaseIdOnOrigin prefers the alias the app registered
  • Format, lint, typecheck on @reticlehq/server

A second reticle_lease acquire on the same origin left both tabs
connected, so every later snapshot and query required sessionId.
Reuse the live lease; if that tab is gone, release it and mint.

Signed-off-by: Kushal S <skushal.mys@gmail.com>
@kushals256
kushals256 force-pushed the fix/lease-reuse-same-origin branch from 58af158 to 600acef Compare September 1, 2026 08:10
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.

[agent] a second reticle_lease acquire on the same origin poisons default session resolution

1 participant