Skip to content

bug(context-pivot): restore tool visibility at session start #744

Closed

Description

@outlier27-cell

Problem

context-pivot decides whether to expose its tool from context usage, but its session_start handler discards the supplied ExtensionContext and calls setVisibleForContext() without it. After /new, /resume, or /reload, a session whose current context is already at the 30k threshold has the tool hidden until a later agent_start event.

Minimal reproduction

  1. Start or resume a TUI session whose getContextUsage().tokens is at least 30,000.
  2. Observe session_start.
  3. The tool is disabled because the handler evaluates no usage.
  4. Start an agent turn; only then is context_pivot enabled.

Expected behavior

Tool availability should match the active session's context immediately after session_start.

Proposed scope

Pass the supplied context into the existing visibility calculation and add a lifecycle regression for above-threshold session start.

Activity

  1. outlier27-cell commented on Oct 11, 2026

    @outlier27-cell
    ContributorAuthor

    I am claiming this issue. The current session-start handler discards its supplied context despite the existing visibility helper accepting one; I will add the threshold regression and open a focused fix.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions