Skip to content

fix(harness): surface managed-memory heads-up on dev deploy + validate session storage path in TUI#1555

Merged
tejaskash merged 1 commit into
mainfrom
fix/dev-deploy-memory-notice-and-session-storage-validation
Jun 17, 2026
Merged

fix(harness): surface managed-memory heads-up on dev deploy + validate session storage path in TUI#1555
tejaskash merged 1 commit into
mainfrom
fix/dev-deploy-memory-notice-and-session-storage-validation

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Description

Fixes two bugs in the gated managed-memory / harness TUI flows (both gated behind ENABLE_GATED_FEATURES).

1. Managed-memory heads-up missing on agentcore dev deploys

The regular deploy path shows a heads-up when a harness uses managed memory ("this harness automatically provisions a dedicated AgentCore Memory resource… provisioning can take 3-5 minutes…"). The dev deploy path did not: useDevDeploy called handleDeploy without an onNotice callback, so the notice (emitted via onNotice) was dropped.

Fix: thread onNotice through useDevDeploy into a managedMemoryNotice state, and render it in DevScreen's "Deploying project resources…" view as a plain dim Note: (matching the deploy-screen convention). Verified live: the note now appears as the CFN apply starts and stays pinned through memory provisioning.

2. Session-storage mount path not validated in the add-harness wizard

The session-storage step only checked value.startsWith('/'), so a nested path like /mnt/data/workplace/ passed Enter and then failed later at schema-write/deploy. The other mount-path steps (EFS, S3 Files) already validate with validateBYOMountPath.

I confirmed the constraint against the API: the smithy MountPath shape (com.amazonaws.bedrockagentcorecontrol#MountPath) is pattern: ^/mnt/[a-zA-Z0-9._-]+/?$, length 6-200 — exactly one segment under /mnt — and the AWS::BedrockAgentCore::Harness CFN resource schema mirrors it. So nested paths are genuinely invalid at the API; the CLI regex is correct, the TUI step just wasn't using it.

Fix: use validateBYOMountPath in the session-storage step's customValidation. TextInput already blocks Enter and renders a red error/✗ when validation fails. Verified live: /mnt/data/workplace/ now shows a red error and Enter is blocked; /mnt/data shows ✓.

Related Issue

Closes #

Type of Change

  • Bug fix

Testing

How have you tested the change?

  • I ran npm run test:unit (added useDevDeploy tests for the onNoticemanagedMemoryNotice wiring, set + unset; the mount-path validator already has direct coverage incl. nested-path rejection)
  • I ran npm run typecheck
  • I ran npm run lint (no new warnings; the 2 remaining in AddHarnessScreen.tsx are pre-existing and outside the changed lines)
  • If I modified src/assets/ — n/a, no asset changes

Also verified end-to-end live (account 603141041947, ap-southeast-2, preview build) via the TUI harness:

  • agentcore dev on a managed-memory harness now shows the Note: heads-up during the deploy phase (pinned through CREATE_IN_PROGRESS).
  • add harness session-storage step: /mnt/data/workplace/ → red error + Enter blocked; /mnt/data → ✓.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective
  • I have updated the documentation accordingly — n/a (gated/unreleased surface)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

…e session storage path in TUI

Two bugs found in the gated managed-memory / harness TUI flows.

1. Managed-memory heads-up missing on `agentcore dev` deploys. The dev deploy
   hook (useDevDeploy) called handleDeploy without an onNotice callback, so the
   "this harness provisions a dedicated AgentCore Memory resource (3-5 min)..."
   heads-up that the regular deploy path shows never reached the dev UI. Wire
   onNotice through useDevDeploy and render it in DevScreen's deploying view as
   a plain dim "Note:" (matching the deploy-screen convention).

2. Session-storage mount path not validated in the add-harness wizard. The step
   only checked value.startsWith('/'), so a nested path like /mnt/data/workplace/
   passed Enter and failed later at schema-write/deploy. The API constraint is
   exactly one segment under /mnt (smithy MountPath pattern ^/mnt/[a-zA-Z0-9._-]+/?$,
   length 6-200; mirrored in the Harness CFN resource schema). Use the existing
   validateBYOMountPath (already used by the EFS/S3 mount-path steps and matching
   that pattern) so the step shows a red error and blocks Enter on invalid input.

Adds useDevDeploy tests for the onNotice -> managedMemoryNotice wiring (set and
unset cases). The mount-path validator already has direct coverage incl. the
nested-path rejection (/mnt/foo/bar).
@aidandaly24 aidandaly24 requested a review from a team June 17, 2026 18:43
@github-actions github-actions Bot added the size/s PR size: S label Jun 17, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.19.0.tgz

How to install

gh release download pr-1555-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.19.0.tgz

@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to merge.

Both fixes are small, focused, and follow existing patterns:

  • The onNoticemanagedMemoryNotice wiring in useDevDeploy mirrors the deploy flow (useDeployFlow.ts/DeployScreen.tsx) exactly, including the !complete render gate and <Text dimColor>Note: …</Text> styling.
  • The session-storage customValidation now uses validateBYOMountPath matching the existing EFS and S3 mount-path steps in the same file. Confirmed the regex matches the smithy/CFN MountPath constraint as described.
  • Test additions cover both the set and unset paths for the notice; mocking is at the same I/O boundaries (handleDeploy, ConfigIO) the existing tests use — no new excessive mocking.
  • No new telemetry needed: this is a UI-surfacing fix for a notice already emitted by handleDeploy; deploy-level telemetry already exists at the command boundary.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026
@tejaskash tejaskash changed the title fix(harness): managed-memory heads-up on dev deploy + session storage path validation in TUI fix: managed-memory heads-up on dev deploy + session storage path validation in TUI Jun 17, 2026

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 36.77% 13437 / 36537
🔵 Statements 36.07% 14290 / 39613
🔵 Functions 31.21% 2286 / 7323
🔵 Branches 30.52% 8865 / 29040
Generated in workflow #3673 for commit 20067bf by the Vitest Coverage Report Action

@tejaskash tejaskash changed the title fix: managed-memory heads-up on dev deploy + session storage path validation in TUI fix(harness): surface managed-memory heads-up on dev deploy + validate session storage path in TUI Jun 17, 2026
@tejaskash tejaskash merged commit 23d6ef2 into main Jun 17, 2026
44 of 48 checks passed
@tejaskash tejaskash deleted the fix/dev-deploy-memory-notice-and-session-storage-validation branch June 17, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants