Skip to content

P2: GC expired provenAbsentLeafPtyVerdicts entries without re-probe #12660

Closed

Description

@AmethystLiang

Priority

P2 — nice-to-have / narrow impact (from prod-release scan of terminal liveness PRs).

Summary

provenAbsentLeafPtyVerdicts caches controller-proven PTY absence for 15s so keystroke bursts to a dead leaf do not re-probe every call. Expired entries are only deleted when that same ptyId is probed again. Unique dead ids that are never touched again remain in the Map for the lifetime of the runtime process.

Evidence

Impact

  • Session-lifetime Map growth of string → number only (timestamps), not large buffers
  • Unlikely to matter at realistic session scale; residual unbounded-structure concern for very long-lived main processes with many unique dead leaf ids

Suggested fix

  • Sweep expired keys on controller inventory refresh, or
  • Cap map size (e.g. LRU / oldest-first eviction), or
  • Clear entries for a ptyId when that PTY’s lifecycle generation advances / on exit (partially covered for related maps already)

Acceptance

  • Expired verdicts do not accumulate unboundedly without re-access
  • Existing 15s write-rejection behavior for proven-absent leaves is preserved
  • Tests pin GC / cap behavior

Source

Prod-release scan of curated PRs including #12574 / #12578 / #12579 / #12589 (2026-08-05).

Activity

  1. innocarpe commented on Aug 6, 2026

    @innocarpe
    Contributor

    Working on a focused fix for this: GC expired provenAbsentLeafPtyVerdicts without requiring a re-probe

    Plan:

    • Keep the change scoped to one behavior
    • Preserve existing contracts / filters
    • Add regression coverage where the surface is testable

    Will open a PR linked to this issue.

  2. innocarpe commented on Aug 6, 2026

    @innocarpe
    Contributor

    Opened a focused fix: #12810

    Sweeps TTL-expired proven-absent leaf PTY cache entries without requiring a re-probe.

    Happy to iterate on review feedback.

  3. added a commit that references this issue on Sep 13, 2026
    bb5aea8
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

    bugSomething isn't workingterminal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions