fix: gate agentcore run ingest behind ENABLE_GATED_FEATURES#1619
Conversation
Knowledge bases (FMKB) are gated behind ENABLE_GATED_FEATURES, but `agentcore run ingest` — which operates exclusively on knowledge bases — was reachable regardless of the flag, both as a CLI command and as a TUI Run-menu option. Match the existing FMKB gating used by `add knowledge-base` / `remove knowledge-base`: - CLI: hide the `ingest` subcommand from help when the gate is off, and reject invocation early with "Knowledge bases are not yet available." - TUI: omit the "Ingest knowledge base" item from the Run menu when the gate is off. Adds an e2e gating test driving the built CLI.
|
Claude Security Review: no high-confidence findings. (run) |
Package TarballHow to installgh release download pr-1619-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.20.2.tgz |
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Thanks for tightening up the FMKB gating — the CLI and TUI changes match the existing KnowledgeBasePrimitive pattern cleanly. A few issues with the new test file and one UX consistency question before this is ready to merge.
| const projectName = 'TestProj'; | ||
| // Create the project with gated features enabled so the KB add path is | ||
| // available; the ingest gating is exercised separately below. | ||
| const result = await runCLI(['create', '--name', projectName, '--no-agent'], testDir); |
There was a problem hiding this comment.
Comment/code mismatch: the comment says "Create the project with gated features enabled so the KB add path is available", but no env: { ENABLE_GATED_FEATURES: '1' } is passed to this runCLI call, and the test never actually adds a KB to the project. Please either drop the comment or align it with what the test does (just creating a bare project for the ingest invocations).
Coverage Report
|
notgitika
left a comment
There was a problem hiding this comment.
LGTM! Thanks for adding a test file for this but please ensure that there is a comment or an issue that ensures cleanup of this file.
Please address the automation findings too.
Problem
Knowledge bases (FMKB) are gated behind the
ENABLE_GATED_FEATURESflag, butagentcore run ingest— which operates exclusively on knowledge bases — was reachable regardless of the flag. This was inconsistent withadd knowledge-base/remove knowledge-base, which are properly gated, and effectively leaked an unlaunched FMKB feature in both the CLI and TUI.Fix
Match the existing FMKB gating pattern (
KnowledgeBasePrimitive.registerCommands):src/cli/commands/run/command.tsx): mark theingestsubcommand ashiddenfrom--helpwhen the gate is off, and reject invocation early with the sameKnowledge bases are not yet available.message used elsewhere.src/cli/tui/screens/run-eval/RunScreen.tsx): omit the "Ingest knowledge base" item from the Run menu when the gate is off.Testing
Added
src/cli/commands/run/__tests__/run-ingest-gating.test.ts(drives the built CLI, mirrorsadd-knowledge-base.test.ts):run ingestexits 1 with "Knowledge bases are not yet available." when the gate is offingesthidden fromrun --helpwhen off, visible whenENABLE_GATED_FEATURES=1Verified locally:
npm run build✅ (CLI bundle builds; unrelated optional@aws/agent-inspectorasset-copy warning only)npm run typecheck✅eslint+prettieron changed files ✅