Repository navigation
Conversation
Setup now accepts us-east-2, ap-northeast-2, eu-west-3, and eu-north-1. The access token check sends LD-API-Version 20240415. The credential error no longer shows the AWS SDK cause. It lists at most 5 profiles and points to aws configure list-profiles. errors.Unwrap still returns the cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If credential lookup fails for a profile with SSO configuration, setup and status ask to run `aws sso login --profile <name>`. On yes, the command runs it and builds the AWS clients one more time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status command now names each role with a state, not an ARN. Each association names its service, not only the service ID. If nothing is set up, the output names the setup command. The JSON output does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…devops-existing-space
Setup now shows a plan before the first write to AWS. The plan names the AWS account, the region, the profile, the agent space action, and the MCP server action. Setup then asks "Continue? [y/N]". Only "y" or "yes" continues. Any other answer stops setup with an error. The new --yes flag skips the question. Without a terminal, or with --output json, setup does not ask. The progress lines now name the thing first and put IDs in parentheses. They do not show ARNs. The JSON result keeps the ARNs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup now prints the plan in every plaintext run, also with --yes and without a terminal. It asks the question only in an interactive run. JSON runs print no plan, so stdout stays valid JSON. The plan now names each IAM role and what setup will do to it, and what setup will do to the operator app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The aws sso login offer now follows the same rule as the setup question: JSON runs never ask. A service with no name or type now prints as "Service (id)" in the status list. The token check uses the API version constant from internal/resources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With both flags, setup ran the full provisioning on the existing space, which overwrote its operator app sign-in configuration. The flags are now mutually exclusive. The README now describes the setup plan and the aws sso login offer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
First review pass at Main issues
Smaller issues
Works as expected: the plan output, the |
With --auth-flow or another sign-in flag, --agent-space-id now runs the full setup on that space: roles, account association, and the operator app sign-in. Without one, setup only connects the MCP server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--agent-space-id now runs the full setup only when --auth-flow is passed. Before, --idc-instance-arn alone also triggered it and then enabled the operator app with the default iam sign-in. IdC flags now need --auth-flow=idc, and IdP flags need --auth-flow=idp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setup test helper now gives stderr its own buffer, so a test can tell which stream a line went to. setupWith now sets the progress logger, so tests that call it see the progress lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The aws sso login prompt took stdin before setup shared it, so with piped input it could consume the lines meant for the later prompts. All prompts now read through one shared reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The token prompt made its own terminal check. It now uses the same interactive value as the rest of setup, so one decision controls every prompt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup now builds one plan, shows it, and executes that plan. The plan holds a step for each IAM role: create, update, or leave unchanged. If a role changed after the plan, setup stops with ErrPlanChanged and does not adopt or recreate it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup now compares both IAM roles with their planned steps before it changes either one, so a changed operator app role no longer leaves a half-updated agent space role. A role that appeared with the ldcli:managed tag counts as already done, and setup continues. The plan-changed errors are now short and name the role. The silent token prompt test now runs with a terminal present, so it can fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a role planned for creation already exists with the ldcli:managed tag, setup now prints that it updated the role. If an untagged role appears while setup creates it, the error now says the role appeared. Tests now cover CreateRole reporting an existing role, and the idp sign-in with --agent-space-id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Role X already exists, so ldcli updated it" line now prints once, after the role update succeeds, and only for a planned create that found the role. Tests now cover both roles, and check that a created role, a role left unchanged, and a failed update print no such line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests now fail UpdateAssumeRolePolicy, AttachRolePolicy, and PutRolePolicy for each role, and check that no "already exists" line prints. A planned update also prints no such line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The write-failure tests now also run when CreateRole finds the role, and check that the error comes from the call that failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan now holds a typed agent space step: create, reuse, or connect, with the space ID and its name from AWS. Setup checks the step before any write, then uses the planned ID and does not search by name again. If a space with the planned name appeared, or the planned space is gone, setup stops with ErrPlanChanged. The reuse line now shows the space name that AWS returned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The create check now stops only for a same-name space that the plan did not see, so --new-agent-space works when a space with that name already exists. Setup checks the space again right before it creates it, and RunPlan rejects a connect step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan now reads the same-name spaces once, so a space that appears between two lists cannot slip into the set the plan saw. FindAgentSpace gets its doc comment back. Tests now cover a space that appears during the role writes, and the connect plan rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A test now adds a same-name space right after the plan lists spaces, and checks that setup stops instead of creating a duplicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --yes, setup no longer offers to run aws sso login. The help now says that setup stops for a missing token only when no MCP server is registered. A test covers --yes with an agent space that matches the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup now checks every token that it will send to AWS, for a register or a token replace, before it changes anything. A token that LaunchDarkly rejects with 401 or 403 stops setup. That covers a first setup, the connect path, and a pasted token. A token for a server that setup reuses is not sent, so it is not checked. Tests replace awsdevops.CheckToken so that they never call the real LaunchDarkly API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --replace-mcp-token, the plan now names each agent space that uses the MCP server, because the replace disconnects and reconnects each one. If that set of spaces changes before the run, setup stops before any write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup now compares the spaces linked to the MCP server with the plan again right before it disconnects them, so a space linked during the role or space writes stops setup. A test checks that list order does not matter. disassociateEverywhere gets its doc comment back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When you choose an existing agent space from the list and pass --auth-flow, setup now runs the full setup on that space, as it does for --agent-space-id. Without --auth-flow, it only connects the MCP server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup wrote the plan and its prompts to stdout and the progress to stderr. A json run showed no plan. If you redirected stdout, setup hid its prompts and waited for input. Now the plan, the space list, the prompts, and the progress go to stderr. Stdout contains only the result. Every run shows the plan, and a json run keeps valid JSON on stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before, a space that you picked from the list got only the MCP server. An unattended run found a space by its name and ran the full setup on it. Thus one space got two different results. Also, Enter at the list picked the first space that AWS returned. Now setup finds the spaces that it made by their description. A space that setup made gets the full setup in every mode. A space that setup did not make gets only the MCP server, unless you pass --auth-flow. An unattended run no longer uses a space only because of its name. The list marks the spaces that setup made. Enter picks a space only if exactly one space that setup made has the --agent-space-name name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A connect run built the operator app URL from the space ID and did not check the app. If the app was off, setup printed a URL that did not work. Now the connect plan reads the app. If the app is on, setup prints the URL that AWS returns. If the app is off, the plan says so, and the run tells you to run setup again with --auth-flow. The connect path now needs the aidevops:GetOperatorApp permission, as the full setup already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The credential error told every named profile to run aws sso login, and it never showed the cause. For a credential_process profile, that advice was incorrect, and you could not see what failed. Now an SSO profile gets the aws sso login advice. Another profile gets the SDK cause. A profile with no credentials gets a message that says so. The cause stays hidden if it comes from the EC2 metadata service, because that error only says that no other source had credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --new-agent-space, or the new space choice in the list, setup made a second space with the --agent-space-name name. After that, setup could not pick its own space, so unattended runs stopped and the list had no default. Now setup stops before it changes AWS and asks for another name. A new space never has a used name at plan time, so the plan no longer keeps the list of same-name spaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup and ConnectExisting only had callers in tests, so they are now in export_test.go. FindAgentSpace had no callers, so this commit deletes it. resolveAgentSpace now reads opts.AuthFlowSet, so authFlagSet is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--agent-space-name had the default launchdarkly. That name is not useful for a team space, because LaunchDarkly is only one MCP server in it. Now the flag has no default. With a name, Enter at the list picks the space with that name, or a new space with that name when no space has it. Without a name, the list has no default. A new space without a name makes setup ask for one, and it asks again for an empty or used name. An unattended run reuses the one space that setup made, and it needs --agent-space-name to create a space. Every prompt now reads through one shared stdin reader, so the list does not take the answer for the name prompt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If GetOperatorApp returned no URL for an app that was on, RunPlan gave an empty URL. Then setup told you that the app was off. Now RunPlan builds the URL from the space ID, as ConnectPlan does. This commit also adds a test for the name prompt with --new-agent-space. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unattended run with --agent-space-name stopped when no space had the name, and when the named space was not made by setup. Thus no single command worked on the first run and on later runs. Now the run does what Enter does at the list. It uses the one space with the name: full setup if setup made it, connect only if not. It creates the space when no space has the name. It stops when two or more spaces have the name. Without a name, it still reuses the one space that setup made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A json run that connected to a space with its operator app off only left out operatorAppUrl. Now the result has operatorAppEnabled. A full setup sets it to true, and a connect run sets it from the app state. The plaintext message about an app that is off uses the same field. This commit also deletes the "Pass --new-agent-space" hint. The CLI always sets the space ID before it reuses a space, so the hint never showed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Taking over this PR -- these commits (
Behavior change from Testing: Not tested against real AWS:
/this is a robot |
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e5a2342. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e5a2342. Configure here.
Each prompt put a new buffer around stdin, so the first prompt took all pasted lines. Now prompts read stdin one byte at a time. Without --profile or AWS_PROFILE, the SDK uses the default profile. The SSO login offer and the credential error now use it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Requirements
Related issues
main, with @Andrewjeska as author.Describe the solution you've provided
--agent-space-idand--new-agent-spaceare mutually exclusive.Managed by the LaunchDarkly CLI, and the list marks themmade by ldcli. A space that setup made gets the full setup. Another space only gets the MCP server, unless you pass--auth-flow.--agent-space-namehas no default. With a name, Enter at the list picks the space with that name, or a new space with that name. Without a name, the list has no default, and a new space makes setup ask for a name. Setup does not create a space with a name that a space already uses.--agent-space-name Xuses X, or creates X if no space has that name. Without a name, it reuses the one space that setup made, or stops.Continue? [y/N].--yesskips every question."operatorAppEnabled": false. This needsaidevops:GetOperatorApp.statusshow names and plain states, not ARNs and raw IDs.aws sso loginadvice. Other profiles get the SDK cause, but not the cause from the EC2 metadata service.statusoffer to runaws sso loginwhen the SSO session of a profile expired.us-east-2,ap-northeast-2,eu-west-3,eu-north-1were missing).LD-API-Version: 20240415.Behavior change from
main:--agent-space-idon a space that setup did not make now only connects the MCP server. Onmain, it ran the full setup. No release has the command yet.Describe alternatives you've considered
Commit
3654d6e1(service token creation) is not included on purpose.A tag on new agent spaces would be a stronger ownership marker than the description. Setup does not use one, because it must call
ListTagsForResourceonce for each space to read tags.Additional context
Testing:
go test ./...andgolangci-lintpass. I ran setup against a sandbox AWS account. These cases worked: a new space with a typed name, a new space next to existing spaces, and a secondEnableOperatorAppcall (IAM to IAM) on a space whose app is on.Not tested against real AWS:
DevOpsAgentRole-AgentSpaceandDevOpsAgentRole-WebappAdmin.@Andrewjeska, can you review the space selection parts? They carry the #853 behavior, with the changes above.
🤖 Generated with Claude Code
Note
Overview
ldcli aws-devops-agent setupis reworked for existing AWS accounts: it can list agent spaces, let you pick one (or provision another via--agent-space-id/--new-agent-space), and choose full provisioning only for spaces managed by ldcli (or when--auth-flowis set); other spaces get MCP connect-only. A setup plan prints to stderr before any AWS write, withContinue? [y/N]in interactive mode;--yesand non-TTY/json runs skip prompts. Progress and prompts go to stderr so--output jsonkeeps parseable stdout; missing tokens fail early in non-interactive runs unless an MCP server already exists. Results can reportoperatorAppEnabled: falsewhen the operator app is off (usesGetOperatorApp).statusandsetupshareloadClients, which can offeraws sso loginfor expired SSO profiles. Credential errors are shorter and SSO-aware; four regions are added to the supported list. Token validation sendsLD-API-Version: 20240415. Humanstatusoutput uses plain labels instead of ARNs. README documents the new flows. Extensive tests cover planning, confirmation, space selection, and plan-drift (ErrPlanChanged).Reviewed by Cursor Bugbot for commit 807c8f7. Bugbot is set up for automated code reviews on this repo. Configure here.