Skip to content

fix(sync): stop an attach early when the project has no tools or skills (AIC-3646) - #1044

Open
ctawiah wants to merge 1 commit into
mainfrom
ctawiah/sync-attach-empty-catalog
Open

ctawiah wants to merge 1 commit into
mainfrom
ctawiah/sync-attach-empty-catalog

Conversation

@ctawiah

@ctawiah ctawiah commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Human

ldcli sync prompts attach tool and attach skill now stop right after the project step when the project has no tool or skill to attach. Before, the command asked for the project and the variation, and the user found the empty list only at the last step.

Why

Nate reported this in the October blitz (AIC-3646). The catalog search was the last step of the flow, so an empty project cost the user two answers before the command could say that there was nothing to attach.

What changes

  • attachToVariation in internal/sync/prompt/attach.go reads one page of the catalog after selectAttachmentProject and before selectManagedVariation. When the page is empty, it returns:
project "production" has no tools to attach. Create one in LaunchDarkly first.
  • An attach with a named key skips the check. The read of that key returns its own 404 when the key does not exist.
  • A workspace with one project picks it without a prompt, so the message is the first thing the user sees. With several projects, the user picks the project and then sees the message, before the variation step.

Testing

go test ./... passes, and golangci-lint run ./internal/sync/... reports 0 issues.

  • TestPromptAttachToolStopsWhenTheProjectHasNoTools and TestPromptAttachSkillStopsWhenTheProjectHasNoSkills fail on main and pass here. They assert the error text, one read of the catalog, and that nothing was attached.
  • The test fake now serves the list endpoints for tools and skills.

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

🤖 Generated with Claude Code


Note

Overview
Interactive attach tool / attach skill flows now fail right after project selection when the LaunchDarkly project has no tools or skills of that kind, instead of prompting for a variation first and only showing an empty catalog at the end.

After selectAttachmentProject, attachToVariation calls new requireAttachments, which fetches one catalog page via SearchAttachments and returns an error such as project "production" has no tools to attach. Create one in LaunchDarkly first. Attaches that specify a named key skip this check (missing keys still fail on the single-resource read).

Tests add GET list handling on the acceptance directAPI fake plus cases that assert the early error, a single catalog read, and that nothing is attached.

Reviewed by Cursor Bugbot for commit fcbeed1. Bugbot is set up for automated code reviews on this repo. Configure here.


Related Jira issue: AIC-3646: [blitz] Show an empty tool or skill list before the last attach step

…ls (AIC-3646)

An interactive attach asked for the project and the variation, and only
then searched LaunchDarkly for tools or skills. When the project had none,
the user learned that at the last step.

The attach now reads one page of the catalog right after the project step.
When the project has no tool or skill of the kind, it stops with an error
that names the project, before the variation prompt. An attach with a named
key skips the check, because the read of that key gives its own error.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ctawiah
ctawiah marked this pull request as ready for review November 18, 2026 20:43
@ctawiah
ctawiah requested a review from a team as a code owner November 18, 2026 20:43
@ctawiah
ctawiah requested review from nkester-ld and tiffanylphan and removed request for a team November 18, 2026 20:43
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