feat: compile-time feature flag for preview/GA consolidation#1341
Open
jesseturner21 wants to merge 9 commits into
Open
feat: compile-time feature flag for preview/GA consolidation#1341jesseturner21 wants to merge 9 commits into
jesseturner21 wants to merge 9 commits into
Conversation
…lidation Replace the dual-branch (main/preview) workflow with a single branch using a compile-time __PREVIEW__ constant. esbuild's define block replaces the constant at build time, enabling dead code elimination for GA builds while keeping all harness/preview code in the same source tree. Key changes: - Add src/cli/feature-flags.ts with isPreviewEnabled() wrapper - Configure esbuild define block and vitest define for __PREVIEW__ - Gate harness commands (add tool, remove tool/harness) behind isPreviewEnabled() - Gate harness UI screens and create flow behind the flag - Add globalThis shim in index.ts for tsx dev mode - Update bundle.mjs to produce dual tarballs (GA + preview) - Support ESBUILD_OUTFILE env var for isolated test builds - Port all harness-related source files from preview branch - Add preview-flag.test.ts verifying dead code elimination
Contributor
Package TarballHow to installgh release download pr-1341-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.14.1.tgz |
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
Prettier requires unquoted object keys when valid identifiers.
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
Contributor
Coverage Report
|
Harness features are gated behind BUILD_PREVIEW=1 and eliminated from GA bundles. Integration and e2e tests that exercise harness commands must skip when running against the default (GA) build.
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
…mory cleanup - Wrap harness-related CLI options in invoke command behind isPreviewEnabled() so they don't leak into GA build's --help output - Wrap harness-related CLI options in create command behind isPreviewEnabled() - Fix remove harness leaving orphaned memory entries in agentcore.json - Fix deploy preflight rejecting harness-only projects - Add integration test for harness re-add after removal
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
The derived effectiveMode approach didn't trigger re-renders, leaving the deploy screen stuck after completion. Switch to queueMicrotask + setMode (matching the preview branch pattern) so the transition fires correctly. Also handles browser mode by calling onLaunchBrowser after deploy.
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
- Deploy screen in TUI dev mode now matches preview branch: shows "Deploying project resources..." with DeployStatus CFN messages, filters redundant step, yellow error text, and log path link. - Persist deployHash in deployed-state.json after successful deploys so canSkipDeploy can detect unchanged projects and skip re-deploy.
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
- InvokeScreen: Ctrl+N for new session (was bare N), hint messages rendered in gray, context-sensitive "Loading..."/"Thinking..." label, directional scroll arrows instead of numeric range - DevScreen: disable keyboard input while exiting (!isExiting guard) - deploy/actions: imperative harness teardown before stack destroy (gated behind isPreviewEnabled) so harnesses aren't orphaned - browser-mode: resolve harness traces via resolveAgentOrHarness instead of ignoring harnessName parameter - resolve-agent: add resolveHarness and resolveAgentOrHarness helpers
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
- isHint check now comes after isExec (matching preview branch) so exec messages always render as magenta, not gray - When a project has both runtimes and harnesses and no flag is given, show a clear error listing both --runtime and --harness options
Contributor
|
Claude Security Review: the review run failed before completing. See the run for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__PREVIEW__feature flag that replaces the dual-branch (main/preview) workflow with a single branchdefineblock inlines the constant at build time, enabling dead code elimination — GA builds contain zero harness codenpm run bundlenow produces dual tarballs: GA (aws-agentcore-<ver>-<ts>.tgz) and Preview (aws-agentcore-<ver>-preview-<ts>.tgz)isPreviewEnabled()Key design decisions
isPreviewEnabled()) over raw constant access — provides a seam for testing and future extensionindex.tsfortsxdev mode (esbuild define only applies during bundling)dist/)HarnessPrimitive,harness-deployer, orimperativeManagerTest plan
preview-flag.test.tsverifies dead code elimination in both GA and preview buildsagentcore add --helpshows no harness/tool commands;agentcore create --defaultsproduces no harness.jsonagentcore add --helpshows harness+tool;agentcore create --model-provider Bedrockproduces harness project