Skip to content

[Feature]: Prevent pinned threads from auto-settling #11711

Description

@ImBIOS

Problem

A sidebar pin (pinnedAt) is an explicit keep-active signal, but the server currently auto-settles pinned threads anyway:

  • isAutoSettlementCandidate in apps/server/src/orchestration/ThreadSettlementPolicy.ts never checks pinnedAt, so pinned threads are swept for both inactivity and merged/closed-PR settlement.
  • decider.ts thread.auto-settle has no pinned guard — it even emits a companion thread.unpinned event, silently dropping the user's pin.
  • Docs (docs/user/thread-sidebar.md) state: "Pinning does not prevent automatic settlement."

The existing ThreadSettlementPolicy.test.ts case is even named "blocks pins, ..." but only covers settledOverride: 'active' (the transient keep-active override), not the sidebar pin.

Related:

Proposal

  • isAutoSettlementCandidate returns false when pinnedAt != null (covers inactivity + PR paths, skips PR lookups).
  • thread.auto-settle decider rejects when pinnedAt != null (stale-sweep race: pin landed after the snapshot), while thread.settle (manual) still succeeds and clears the pin.
  • Docs updated: pinning prevents automatic settlement.

Acceptance

  • Inactive pinned thread never auto-settles
  • Merged/closed-PR pinned thread never auto-settles
  • Unpinning re-arms normal auto-settle rules
  • Manual settle of a pinned thread still works and unpins

Activity

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

    acceptedfeature request acceptedenhancementRequested improvement or new capability.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions