Skip to content

CLI: derive the remaining session-less command lists and cover web beside a leased connection #4850

Closed

Description

@thymikee

Purpose

Follow-ups from the review of #4839, which made a command that takes no session read no active connection (isFlagSupportedForCommand('session', command) in resolveActiveConnectionDefaults).

Required behavior

  1. One rule for session-less commands. shouldResolveRemoteAuth and REMOTE_MATERIALIZATION_DEFERRED_COMMANDS in src/cli.ts are still hand-kept lists of session-less commands. Derive them from the same predicate where the meaning is the same, and keep an explicit entry only where a command differs for another reason.
  2. Help text. The leased-sessions paragraph in src/commands/schema/cli-help.ts says every command names its session. State that this applies to commands that take a session.
  3. Test. src/__tests__/cli-leased-session.test.ts covers auth status beside an active leased connection. Add a web doctor case.

Completion conditions

Activity

  1. added
    needs-triage
    on Nov 20, 2026
  2. apex-sentinel-staging commented on Nov 20, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: feature

    The issue requests follow-up refactoring and test coverage from a prior PR, including deriving session-less command lists, updating help wording, and adding a web doctor test case.

  3. added and removed
    needs-triage
    on Nov 21, 2026
  4. samanyudas commented on Nov 21, 2026

    @samanyudas
    Contributor

    Note

    🤖 Claude Opus 5.5 responding on behalf of @samanyudas

    I'm taking this one. The plan:

    1. Derive shouldResolveRemoteAuth and REMOTE_MATERIALIZATION_DEFERRED_COMMANDS in src/cli.ts from the same session predicate as resolveActiveConnectionDefaults. An explicit entry stays only where a command differs for a different reason.
    2. Reword the leased-sessions paragraph in src/commands/schema/cli-help.ts so it covers only commands that take a session.
    3. Add a web doctor case to src/__tests__/cli-leased-session.test.ts, and confirm it fails with fix(cli): run a command that takes no session while a leased connection is active #4839 reverted.

    No command should change behavior, and src/cli.ts stays at or under 1,000 lines.

  5. samanyudas commented on Nov 21, 2026

    @samanyudas
    Contributor

    Note

    🤖 Drafted by Claude Opus 5.5. Reviewed by @samanyudas and posted on their behalf.

    Decision: scope: the PR also changes auth behavior, so the "no behavior change" condition no longer holds for auth. Deriving the lists showed two bugs that came from the hand-kept rules. auth status --remote-config <profile> leased a device and saved an active connection. With a profile that names a lease provider, it failed with REMOTE_SESSION_REQUIRED, which auth cannot satisfy because it rejects --session. No other command changes behavior.

  6. added a commit that references this issue on Nov 21, 2026
    55be96b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions