fix(run-insights): TUI wizard state, inline name validation, job history#1602
Merged
Conversation
…inline, surface job in history Multiple fixes to the `agentcore run insights` interactive wizard: - **Single-agent flow** (#4): when the project has exactly one agent, the wizard skipped the agent step but never set `config.agent`, so the Confirm screen showed a blank "Agent:" line. Pre-populate the sole agent in the default config so it's threaded through to confirm and the API call. - **Inline name validation** (aws#6): the Name step accepted invalid values (spaces, hyphens, leading digits) and only failed at submit time when the API returned a 400. Validate inline against the service-side `BatchEvaluationName` pattern (`^[a-zA-Z][a-zA-Z0-9_]{0,47}$`). Lookback days now also validate inline (1-90, integer only) instead of silently coercing 0 to 7. - **Preserve config on error** (aws#16): when the launch failed, hitting "Go back" reset the wizard to the Source step and discarded all selections. Now the failed config is stashed in flow state and the wizard re-opens at the Name step with everything pre-populated. - **Post-launch history** (aws#17): the wizard wrote to the job-engine store but `view insights` reads from the legacy `.cli/insights/*.json` store, so the brand-new job rendered as "No insights runs found". Mirror successful starts to the legacy store after launch. Bug bash items #4, aws#6, aws#16, aws#17 (mix of P1/P2).
Contributor
Package TarballHow to installgh release download pr-1602-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.20.2.tgz |
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
agentcore-cli-automation
suggested changes
Jun 22, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Nice, focused fixes for the bug bash items. Two things I'd like addressed before merge:
- The new
forwardRef/useImperativeHandle/jumpToStepsurface onRunInsightsScreenappears to be dead code — nothing in the tree passes a ref, and resume-on-error works entirely through the newinitialConfig/initialStepprops (the screen re-mounts whenRunInsightsFlowtransitions fromerrorback towizard). Either wire it up to a caller or drop it; otherwise it adds an API contract that's unused, untested, and (in React 19) unnecessary. - The two new pure validators are good candidates for a small unit test. There are no tests under
src/cli/tui/screens/run-insights/at all, and three of the four fixes here (single-agent default, inline name validation, resume-on-error) are reachable via the wizard hook + pure helpers without any TUI rendering. A smallvalidateJobName/validateLookbackInput/useRunInsightsWizardtest file would lock these in cheaply.
One smaller suggestion inline about the silent catch in persistToLegacyStore.
jariy17
requested changes
Jun 23, 2026
jariy17
left a comment
Contributor
There was a problem hiding this comment.
I have one blocking comment.
…gine store Addresses review feedback: - Remove unused forwardRef, useImperativeHandle, RunInsightsScreenHandle, and jumpToStep — resume-on-error works through initialConfig/initialStep. - Replace persistToLegacyStore workaround: InsightsJobsScreen now reads directly from the job engine store (listRecords), eliminating the two-source-of-truth problem.
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
jariy17
approved these changes
Jun 29, 2026
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
Four fixes to the
agentcore run insightsinteractive wizard, from the Lens-in-CLI bug bash:Single-agent flow leaves Confirm blank. When the project has exactly one agent, the wizard skipped the agent step but never populated
config.agent, so the Confirm screen showed an emptyAgent:line. The default config now pre-populates the sole agent so it threads through to confirm and the API call.Inline name validation. The Name step accepted spaces / hyphens / leading digits and only blew up after submit with a service 400. We now validate inline using the service-side
BatchEvaluationNameshape (^[a-zA-Z][a-zA-Z0-9_]{0,47}$) fromAgentCoreEvaluationCommonModel. Lookback days also validate inline (1-90, integer only) instead of silently coercing 0 → 7.Preserve config on error. Hitting "Go back" from a launch error reset the entire wizard. The failed config is now stashed in flow state and the wizard re-opens at the Name step with all prior selections intact.
Post-launch "No insights runs found". The wizard wrote to the job-engine store, but the post-launch "View Insights Jobs" screen reads from the legacy
.cli/insights/*.jsonstore. We now mirror successful starts to the legacy store after launch so the new job appears immediately.