fix(cli): In browser-mode.ts launchBrowserDev(), replace the inline... (#1376)#66
Draft
aidandaly24 wants to merge 1 commit into
Draft
fix(cli): In browser-mode.ts launchBrowserDev(), replace the inline... (#1376)#66aidandaly24 wants to merge 1 commit into
aidandaly24 wants to merge 1 commit into
Conversation
The interactive agentcore menu -> dev path called runCliDeploy() inline for harness-only projects, printing plain console.log lines into normal terminal scrollback instead of the contained alt-screen DevScreen box shown by the direct `agentcore dev` command. launchBrowserDev() now routes through launchTuiDevScreenWithPicker so the deploy renders inside the alt-screen TUI, matching the direct command. Removes the unused runCliDeploy import and inline call. Adds a dedicated unit test that fails on baseline and passes with the fix.
Coverage Report
|
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.
Refs aws#1376
Issues
agentcoremenu and selecting "dev" renders the harness deploy as plain inline spinner/console.log lines in the normal terminal buffer, whereas runningagentcore devdirectly takes over the screen with the full alt-screen DevScreen TUI. Same deploy, two inconsistent looks depending on entry path. Cosmetic only — deployment functions identically either way; preview-gated so GA users are unaffected.Root cause
Two divergent CLI render paths for the same harness deploy: interactive menu (render.ts:70-73 -> launchBrowserDev -> runCliDeploy inline spinner at progress.ts:46-90, no alt screen) vs direct
agentcore dev(command.tsx:514 -> launchTuiDevScreenWithPicker alt-screen DevScreen). Both call the same handleDeploy; only the wrapper differs. Introduced by bed1de0 (aws#1341), confirmed via git blame -L 136,138.The fix
In browser-mode.ts launchBrowserDev(), replace the inline
if (hasHarnesses) { await runCliDeploy(); }(lines 136-138) with launchTuiDevScreenWithPicker(workingDir) — the same alt-screen TUI picker the directagentcore devcommand uses (command.tsx:514) — then route the picker result into runBrowserMode (passing agentName/harnessName, otelEnvVars, collector) or return early if the user cancels (pickerResult == null). No extra isPreviewEnabled() gate is needed inside the block since the surrounding hasHarnesses already includes it (line 129); GA/non-preview behavior is unchanged. This is exactly what OPEN PR aws#1410 (Closes aws#1376, ~22-line change in browser-mode.ts + tests) does on branch fix/dev-tui-consistency-1376-main; the earlier PR aws#1409 was closed/superseded. Track PR aws#1410 to merge — it is not yet an ancestor of v0.20.2.Files touched: src/cli/commands/dev/browser-mode.ts launchBrowserDev() lines 136-138 (the inline
await runCliDeploy()) — replace with launchTuiDevScreenWithPicker() + runBrowserMode routing, per PR aws#1410. Reference paths: src/cli/tui/render.ts:70-73 (interactive-menu entry via exit action 'dev'), src/cli/commands/dev/command.tsx:513-533 (the correct TUI path), src/cli/commands/deploy/progress.ts:46-90 (the inline spinner renderer), src/cli/tui/screens/dev/DevScreen.tsx + src/cli/tui/hooks/useDevDeploy.ts (the structured alt-screen deploy UI).Validation evidence
The fix was verified by reproducing the original symptom and re-running after the change:
Test suite: green.
Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.