Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/cli/tui/screens/create/CreateScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,12 @@ export function CreateScreen({ cwd, isInteractive, onExit, onNavigate }: CreateS
<Box marginBottom={1} flexDirection="column">
<Text color="red">A project already exists at this location.</Text>
{flow.existingProjectPath && <Text dimColor>Found: {flow.existingProjectPath}</Text>}
<Box marginTop={1}>
<Box marginTop={1} flexDirection="column">
<Text>
Use <Text color="cyan">add agent</Text> to create a new agent in the existing project.
Use <Text color="cyan">add harness</Text> to add a harness to the existing project.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description correctly calls out that this is only safe once add harness is ungated, but the change as written doesn't enforce that — the message renders the same regardless of __PREVIEW__. Today on main:

  • src/cli/primitives/registry.ts:26harnessPrimitive = isPreviewEnabled() ? new HarnessPrimitive() : undefined
  • src/cli/cli.ts:131-132 only registers commands for primitives in ALL_PRIMITIVES, so add harness is not registered in GA builds
  • .github/workflows/release.yml runs npm run build (GA, __PREVIEW__ = false) when releasing from main to npm latest

So if this PR merges to main and a latest release happens before harness is ungated, GA users will land on the existing-project-error screen, follow the instruction to run agentcore add harness, and hit error: 'harness' is not a valid subcommand.

A few ways to address:

  1. Gate the message on isPreviewEnabled() — show the new harness-first wording only in preview builds, keep the existing "Use add agent…" wording in GA. When the harness ungating PR lands and removes isPreviewEnabled() from registry.ts, it can also remove this branch and leave just the new message. Most defensive option, makes this PR independently safe to merge.
  2. Hold the PR and merge it as part of (or immediately after) the harness ungating PR, with a release-branch coordination so a latest build never goes out with this message but without add harness registered.
  3. Add a guard at registration time so the message is sourced from whether harnessPrimitive is defined (e.g. import harnessPrimitive and conditionally render the harness line). Same effect as option 1 but keyed off the actual registration rather than the build flag.

Option 1 or 3 would let this land independently of release sequencing.

</Text>
<Text dimColor>
Or use <Text color="cyan">add agent</Text> to add a code-based agent.
</Text>
</Box>
</Box>
Expand Down
Loading