Skip to content

fix: capture-fallback hint advertised --tags, which add rejects — now --tag - #355

Merged
vilosource merged 3 commits into
mainfrom
fix/fallback-hint-tag-flag
Oct 19, 2026
Merged

vilosource merged 3 commits into
mainfrom
fix/fallback-hint-tag-flag

Conversation

@vilosource

Copy link
Copy Markdown
Owner

What

The capture-fallback line injected into every session (ADR-0065 §1) is what an agent pastes when the kb_* MCP tools are gone. It advertised add <type> "…" [--tags a,b], and add rejects that with unknown flag --tags, so the fallback fails exactly when it's needed. This was found by the review of #354.

  • src/engine.ts: [--tags a,b] becomes [--tag a,b].
  • test/capture-fallback.test.ts: a behavioural guard. It extracts every [--flag value] the rendered line advertises, runs the real built CLI add with them against a temp brain, and asserts the entry landed with its tags. It does not grep the source.

Observed red first

Before the fix the new test failed with unknown flag --tags for 'add'. After the fix it passes. Full suite: 816/816.

Delivery

This is an engine change, so it reaches consumers only through a plugin re-vendor and release, and through npm. It lands on main here; the release follows the normal chain.

🤖 Generated with Claude Code

… — it now says --tag

The injected capture-fallback line (ADR-0065 §1) is what an agent pastes when
the kb_* tools are gone. It advertised `add <type> "…" [--tags a,b]`, and the
CLI rejects that with "unknown flag --tags", the very trap args.ts names
(four entries once landed untagged). So the fallback failed at the moment it
was needed. Found by the #354 review.

- src/engine.ts: [--tags a,b] -> [--tag a,b].
- test/capture-fallback.test.ts: a behavioural guard, not a source grep. It
  pulls every [--flag value] out of the rendered line and runs the real
  built CLI `add` with them against a temp brain, then asserts the entry
  landed with the tags. Observed RED before the fix ("unknown flag --tags"),
  green after. Suite 816/816.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ada70012-e5ef-4dfd-bc6d-4120693d7b54
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Jason Viloria added 2 commits October 19, 2026 17:44
…lower value] (review round 1 M1)

The gate on #355 found that the guard extracted only bracketed lower-case flags.
The same --tags bug written unbracketed, a capitalised --Tag, or a bare --bogus
all stayed green. Every --flag token after `add` is now extracted. Each of
those three mutants, plus the original [--tags a,b], was observed red; green
after restore.
@vilosource
vilosource merged commit b0afd71 into main Oct 19, 2026
6 checks passed
@vilosource
vilosource deleted the fix/fallback-hint-tag-flag branch October 19, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant