Skip to content

holders: the first holder is found only by a sessions/ file event; a lost FSEvent hides a Terminal-held session #889

Done

Description

@SSFSKIM

What's wrong

src/engine-host/fs/holders.ts starts its liveness poll (POLL_MS 2 s) only while at least one holder is known (:298). Until then the first holder, such as a Terminal that takes a session, is learned only from the sessions/ file watch (src/engine-host/fs/service.ts:977, watcher.ts:157). If that FSEvent comes late or never, MAWS doesn't see the session as held until something else changes in sessions/.

Evidence

CI-opt measured the mini on 2026-11-28 at 02:44Z with a 40-file fs.watch probe:

events delivered median p90 max
MacBook 40 of 40 10 ms 17 ms
mini 35 of 40 (5 never arrived within 10 s) 846 ms 3.5 s 4.9 s

The mini's fseventsd sits at 2.1 GB resident and about 80% CPU after 30 days up.

The matching failure is e2e/lane-a.spec.ts:175/:184 drive(): session.get holder.kind stays "none" for 10 s. It failed in 15 scenes, in 3 Actions jobs on the mini, across three unrelated branch families. Hosted lane-a was always green. Details are in CI-opt's collect-1128-read.md, section 2.

A person on a machine whose fseventsd degrades meets the same thing: a session held in Terminal is not shown as held.

The work

Give the holder registry a way to find its first holder that doesn't depend on one event arriving. For example, a slow idle poll while no holder is known, cheap enough to run always: one readdir of sessions/ every few seconds. Or rescan on the next poll tick after any watch silence. Choose the interval from the cost.

Add a unit test that drops the sessions/ event and proves the holder is still found within the bound. Keep the watcher as the fast path.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 28, 2026
  2. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: architect's builder

  3. removed
    status:in-progress
    on Nov 28, 2026
  4. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: landed on master 70b127f (no PR; master-first commit of arch/holder-discovery 4cf06d7)

  5. added 4 commits that reference this issue on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions