Skip to content

bb-knowledge-base: long queries, long filter keys and an aborted signal are accepted locally, rejected on AWS #1279

Open

Description

@belaboe

Before opening, please confirm

  • I have searched for duplicate or closed issues.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Which package(s) are affected?

Other (@aws-blocks/bb-knowledge-base)

Describe the bug

The local KnowledgeBase (a keyword index over the source folder) doesn't apply the Bedrock Knowledge Bases request limits, and its waitUntilSynced() ignores its options:

Call Local Deployed
retrieve(<20,001-character query>) ok, 3 results KnowledgeBaseValidationError (query text max 20,000)
retrieve(q, { filter: { [<101-character key>]: { equals: 'x' } } }) ok, 0 results KnowledgeBaseValidationError (filter key 1 to 100 characters)
waitUntilSynced({ signal }) with an already-aborted signal resolves rejects with AbortError

The first two matter for apps that pass user input (a pasted document, a filter built from form fields) straight to retrieve(). The third breaks the documented contract ("An already-aborted signal rejects immediately, before any polling"), so cancellation logic can't be tested locally.

(Ranking and chunk text also differ, which is expected from a keyword index versus vector search and is not part of this report.)

Expected behavior

The mock validates query length and filter key length with the same KnowledgeBaseValidationError, and waitUntilSynced() honors signal (and timeoutMs) the same way the AWS implementation does, even though the local index is always in sync.

Reproduction steps

const kb = new KnowledgeBase(scope, 'docs', { source: './knowledge', description: 'Docs' });

await kb.retrieve('word '.repeat(4001));                                  // ok locally, KnowledgeBaseValidationError deployed
await kb.retrieve('setup', { filter: { ['k'.repeat(101)]: { equals: 'x' } } }); // same
const c = new AbortController(); c.abort();
await kb.waitUntilSynced({ signal: c.signal });                           // resolves locally, AbortError deployed

Environment

  • @aws-blocks/* 0.8.0 (main at 34e758c)
  • Local: npm run dev dev server, Node 22, macOS
  • Deployed: a sandbox stack in us-east-1

Additional context

Activity

  1. added
    pending-triage
    pending-maintainer-response
    on Nov 3, 2026
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

    pending-maintainer-responsepending-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions