Skip to content

[scanner] 🐛 send: --session drops a positional text word equal to the session name #301

Closed

Description

@hivecommons-hive

Bug

cmdSend in src/cli.ts decides whether the first positional argument is the session name by comparing values, not by checking which form supplied the session:

const session = flags['session'] ?? positional[0];
const text = flags['text'] ?? positional.slice(session === positional[0] ? 1 : 0).join(' ');

When --session=<name> is given and the first word of the positional text happens to equal <name>, that word is silently dropped from the text.

Reproduce

pluk-send --session=foo foo          # → "Error: text is required" (should send "foo")
pluk-send --session=foo foo bar      # → sends "bar" (should send "foo bar")
pluk send --session=foo foo bar      # same

Expected

The leading positional is only consumed as the session when --session was not supplied. The split should key off flags['session'] === undefined, not off string equality.

Fix sketch

const sessionFromFlag = flags['session'] !== undefined;
const session = sessionFromFlag ? flags['session'] : positional[0];
const text = flags['text'] ?? positional.slice(sessionFromFlag ? 0 : 1).join(' ');

Plus a regression test next to pluk-send --session takes all positional args as text in test/cli-branches.test.js.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    agent/scannerCreated by Hive for agent-filed issue provenance
    on Oct 19, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 19, 2026
  3. hivecommons-hive commented on Oct 19, 2026

    @hivecommons-hive
    ContributorAuthor

    Folded finding. This was filed as a separate issue, but 1 open agent-filed issue (plus 18 closed as completed in the last 14 days) already cite src/cli.ts, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.

    Review backlog (docs-currency): Positional-text form of send is undocumented in README and --help

    Filed from an out-of-scope finding in the Hive review of PR #302.

    PR: #302 (#302)
    Perspective: docs-currency
    Severity: info (P3)
    Evidence: README.md:242 (

    pluk/README.md

    Line 242 in 6bbb0e1

    Inject text into a running tmux session — used by rationguard to send rebuttals, or by you to send commands:
    )
    Finding: Positional-text form of send is undocumented in README and --help

    README.md:242-252 and the usage block at src/cli.ts:27 only show pluk send <session> --text="..."; the positional-text form (pluk send <session> word word / pluk-send --session=x word) that this PR fixes is not described anywhere operator-facing. Pre-existing gap, not introduced by this PR; nothing in the docs states the old (buggy) behavior so no doc update is required to land it.

    Fingerprint: 2ea06091abf6001b8be425bdd0110519bd38a20ecd9233ee18312e36b8c2e848

    filed by Hive review backlog

  4. hivecommons-hive commented on Oct 19, 2026

    @hivecommons-hive
    ContributorAuthor

    Linked again from the Hive review of PR #302.

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

    agent/reviewerCreated by Hive for agent-filed issue provenanceagent/scannerCreated by Hive for agent-filed issue provenancehelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/claimed-by-scannerkind/bugCategorizes issue or PR as related to a bug.stage/040-covered-by-prAn open PR covers this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions