Skip to content

bug(shell): quoted arguments starting with a cue word are misclassified as natural language #930

Closed

Description

@AmitoVrito

Found while reviewing #925.

_looks_like_natural_language (src/synapsekit/shell/lexer.py) returns True whenever the quoted content matches _NL_CUES (find/list/run/show/open/check/search/…) regardless of at_line_start. This misclassifies ordinary quoted shell arguments that happen to begin with a cue word:

  • git commit -m "find and fix the bug" → the commit message is dropped and planned as natural language
  • grep "search term" file.txt → "search term" is stripped out of the command
  • echo "run the tests" → argument stripped

The existing test only covers "hello world" (no cue word), so it passes while the bug hides.

Fix: gate the _NL_CUES heuristic (and the standalone-phrase shorthand) on at_line_start/quote_at_start; keep only the explicit nl:/ask: prefixes unconditional. Add regression tests for cue-word quoted args mid-command.

Activity

  1. added
    bug
    on Aug 12, 2026
  2. added 2 commits that reference this issue on Aug 12, 2026
    fbc5503
    3df9ac9
  3. AmitoVrito commented on Aug 12, 2026

    @AmitoVrito
    CollaboratorAuthor

    Fixed in #925 (commit 3df9ac9) — cue-word/bare-phrase NL heuristics are now gated on the quote opening a command; regression tests cover git commit -m and grep. CI green. Lands on main when #925 merges.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions