Skip to content

Builtin memory/automations/custom-instructions CLIs silently ignore unknown flags (core bb and tasks reject them) #2299

Closed

Description

@MGrin

What happens

bb memory update <id> --summary "..." --details-file <path> applies the summary, silently discards --details-file, prints Updated mem_... to v4 and exits 0. The record is left with a corrected summary over stale details.

This is not specific to that flag. The memory plugin's parser never rejects an unknown option at all.

bb memory add --name n --summary s --details d --reason r --zzz-nonsense zzzval
  -> rc=0, record saved, flag ignored

Scope — measured on bb 0.39.0, macOS, 2026-08-22

Probe is --zzz-nonsense zzzval. Every arm carries a control: the bare command must exit 0 first, or the arm is reported UNKNOWN. Write verbs were probed against nonexistent ids, with tasks as the ordering control — its parse rejection pre-empts the not-found lookup, which is what makes the technique valid.

surface verbs probed unknown flag
core bb (commander) status, thread list, plugin list, thread tell rejects — error: unknown option '--x'
builtin tasks show, list, update, comment rejects
builtin workflows list, stop rejects
builtin github repos, issues errors, but for the wrong reason (Unexpected argument "zzzval")
builtin keep-awake status errors, prints usage
builtin memory search, get, catalog, add, update, forget silent — accepts, drops, rc=0
builtin automations list, show, update, pause silent
builtin custom-instructions get, set silent; set swallows the flag into its variadic positional as data
builtin provider-retry status silent

So core bb is strict and 4 of 9 builtin plugins are not.

Mechanism, read from the shipped bundles

builtin-plugins/memory/dist/server.js — parseArgv collects every --x into a map; option() and requireOption() only ever pull the names a verb knows about. Nothing asks what was left unread.

builtin-plugins/tasks/dist/server.js is the same lineage — same CliError, same option/requireOption — plus assertAllowed(args, allowedOptions, allowedFlags) at 29 call sites. That is why tasks rejects and memory does not.

If that reading is right, the fix is porting one small function one directory over. We have not read your source tree, only the bundles as shipped, so treat the mechanism as our best inference and the table as the measurement.

Why it is worth fixing rather than documenting

The failure is a silent partial write, and every guard in the path behaves correctly while it happens:

  • --expected-version is a concurrency guard. The version was correct.
  • The write did succeed.
  • A length-comparison guard cannot see it — the details did not shrink, they did not change at all.

It also looks like success in the two places an operator checks: exit code 0, and a version bump.

One consequence we can measure locally: a record's summary claimed something its details did not contain, for two hours, before anyone noticed. Another thread had already repaired a different record the same way, unprompted, and the author never learned.

A smaller, related gap

bb tasks has --description-file (create, update) and --body-file (comment). bb memory has no *-file flags at all — grep -oE '"[a-z][a-z-]*-file"' over each bundle returns two for tasks and nothing for memory. Passing prose through argv is separately awkward when it contains backticks or $(...), which is why callers reach for a file flag and then get the behaviour above.

This is secondary. Rejecting unknown flags is the fix that matters — with it, the missing flag becomes a loud error instead of a quiet one.

Not verified

Any bb other than 0.39.0; plugins outside the table; whether the same parser backs other builtins we did not probe. Happy to run further probes or test a patch.

Activity

  1. added theissue type on Aug 23, 2026
  2. added
    cli
    memory
    automations
    custom-instructions
    provider-retry
    on Aug 23, 2026
  3. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2299.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): bb forwards plugin argv untouched ("parsing argv is plugin-owned") and the memory, automations, custom-instructions, and provider-retry plugins each hand-roll a parser that collects every --x into a map and only reads known names, with no leftover check like tasks' assertAllowed(), so unknown flags (e.g. --details-file) are silently dropped and the verb still writes and exits 0.
    • Proposed fix: Per plugin, reject unread options before any service call: memory — add a per-verb KNOWN_OPTIONS allow-list and assertKnownOptions(command, args) right after parseArgv(rest) (prototype in 2299/repro/memory-fix.patch; repro tests pass, existing 8 memory tests pass, live CLI now prints "unknown option --details-file" + usage and exits 1 with the record untouched; note --pinned is a bare flag on add and valued on update so one name set is checked against both maps); automations — same allow-list on parseArgs, throwing before service.* (also fixes automation subcommand --help can execute mutations #2323 if --help short-circuits to usage); custom-i…
    • Caveats: Reproduced on base 494f665 rather than the reporter's bb 0.39.0 (no intervening commit touches these parsers; origin/main has nothing past base). The github plugin was not installed on my instance; its "wrong reason" error was verified from validateGithubCliArgs source only. The automations arm needs --project or every verb fails on that first, which masks the bug; with a real project all six ve…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  4. added
    confirmed-repro
    on Aug 24, 2026
  5. ryanbbrown commented on Aug 28, 2026

    @ryanbbrown
    Contributor

    Current nested-help behavior adds related evidence for the same builtin plugin CLI parser boundary: bb memory update --help exits 1 with update requires a memory id, and bb docs status --help exits 2 instead of showing registered usage. The automation-specific mutation risk already has its own exact issue, #2323.

    This issue is the right owner for silently ignored unknown flags. #2621 covers the related but separate Memory/Docs help failures and hidden core-command limits, so it is not a duplicate of the silent-write defect here.

  6. added
    plugins
    on Sep 30, 2026
  7. ymichael commented on Oct 8, 2026

    @ymichael
    Collaborator

    Fixed by #3913: builtin plugin CLIs now go through the shared parser and reject unknown flags with exit code 1.

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

    automationscliconfirmed-reprocustom-instructionsmemorypluginsprovider-retry

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions