Skip to content

fix(box): Ship only the pinned box, and drop the old box/<name> pack-name stop - #2867

Merged
mquang-amazon merged 14 commits into
box-integrationfrom
box/mq-8
Nov 20, 2026
Merged

mquang-amazon merged 14 commits into
box-integrationfrom
box/mq-8

Conversation

@mquang-amazon

@mquang-amazon mquang-amazon commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Ship only the pinned box, and drop the old box/<name> pack-name stop.

This PR started as the port of the @box/ rename, the preview.7 and preview.9 pins, and the ffi shim removal from box-integration-development. SA-5 (#2866) has since brought all of that to box-integration, so after merging it in, this PR changes only:

  • Exact box pin (review, @vvargu and @leo237). box.version in agentcore.json must be the box boxRelease.json pins (0.1.11-mquang.preview.9). boxReleaseFor refuses any other version before anything downloads: "agentcore.json names box 0.1.11-linux-preview.6 under box.version, but this CLI ships box 0.1.11-mquang.preview.9, the one box it pins. Set box.version to 0.1.11-mquang.preview.9, then retry." Build, deploy and container dev all go through it. The SHA256SUMS.txt lookup for unpinned versions is removed, so every shipped box matches the checksum in boxRelease.json. Before, a project created earlier (with box.version preview.6, which refuses @box/ packs) built and deployed, and the agent failed only on AgentCore Runtime.
  • No old pack-name stop (review, @vvargu). refuseOldShippedNames and its two tests are removed: Box projects are new and create writes @box/<name>, as feat(box): Keep a box profile for each agent in .box/<agent>/{local,aws}, and let add runtime add a box runtime #2859 dropped the hint for the old layout. A profile with an old name still fails at build, with box's own error ("box/base" is not a pack name; the pack that box ships is @box/base). The resolver hint for an old box on PATH stays.
  • README and docs/box-local-testing.md: box.version must be the pinned version; to try an unreleased box, bump boxRelease.json with scripts/bump-box-release.ts.
  • boxDevSecrets.ts / .test.ts: box/bedrock → @box/bedrock (from feat(dev): Hand box run the profile's env:// keys instead of copying them to .env.local #2862).

All of it is new code: box-integration-development still accepts other box versions and still has the old-name stop.

Related Issue

Box integration squash plan, follow-up to MQ-7.

Documentation PR

README and docs/box-local-testing.md updated here.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • bun test: 5789 pass, 1 fail: the box on PATH (real box), which fails locally with the box on this machine's PATH (preview.6 refuses @box/base) and the same way on box-integration-development.
  • bun run typecheck, bun run lint:check, Prettier on changed files, bun run audit, bun run secrets:check, bun run build
  • e2e suite: not run; ran a real deploy instead.
  • Deploy and invoke in a dev account (us-west-2), earlier on this branch with preview.9 and no ffi shim: agent-python-strands-box (CodeZip) and agent-python-strands-box-container both remembered "teal" across two invokes on one session; runtime logs show box: running profile ... and no ERROR, blocked by egress control, AccessDenied, Traceback, InvalidSignature or MemoryError.
  • Exact pin with the built CLI on a copy of that project with box.version preview.6: agentcore build stops with the message above.

Sai Abhishek and others added 6 commits November 19, 2026 19:28
[strands-agents/staging-boxy#570](strands-agents/staging-boxy#570)
gives each pack and plugin that box ships the name @box/<name>. A box
from the staging-boxy main branch rejects the previous box/<name> name,
for example: "box/base" is not a pack name; the pack that box ships is
@box/base. The next box release comes from the main branch. Thus it
rejects each box profile that the CLI writes, and each Runtime profile
that build stages.

With this change, the CLI writes these names:

- box/base is @box/base, and box/bedrock is @box/bedrock, in each box
  profile that create writes and in each Runtime profile.
- box/agentcore is @box/agentcore, and box/agentcore-codezip is
  @box/agentcore-codezip. This is the packs entry and the [pack] name
  of each pack that build writes. The path of each pack does not change.
- box/aws-secrets-manager is @box/aws-secrets-manager in plugins. This
  is the name in the plugin.toml of the AWS Secrets Manager plugin on
  the feature/secret-source-shipped-plugins branch of staging-boxy.

The profile writer and the bedrock.region copy of build use one
BOX_BEDROCK_PACK constant. Thus the copy finds @box/bedrock. Comments in
the code, Dockerfile.template, and start.py use the new names.

Build does not change the profile of a user. If the local profile names
box/<name> in packs or in plugins, build stops before it starts box. The
message gives the file, each previous name, and its @box/ name.

The open routes fixture for a list of destinations is new output of box
profile show, from a box with
[strands-agents/staging-boxy#625](strands-agents/staging-boxy#625).
Only its pack name changed. The fixture of 0.1.11-linux-preview.6 stays
the output of that box, with box/base.

Tests: the tests of boxProfile.test.ts, manager.boxNetwork.test.ts, and
the other tests examine the new names. boxNetworkSource.test.ts examines
the stop and its message, and that box does not start. It also examines
that build starts box for @box/ names and names of the user. The tests
show an error in each of these conditions:

- One of these names goes back to box/.
- The bedrock.region copy finds only box/bedrock.
- Build does not stop.

An agentcore build of a project from create used the box of
[strands-agents/staging-boxy#625](strands-agents/staging-boxy#625),
and its box profile show accepted the @box/ names. That box also
accepted the staged Runtime profile, with @box/agentcore, if the copy
had the text us-west-2 in auth.aws.region. With the placeholder, that
box rejects auth.aws.region. This is not a problem, because the next
release has
[strands-agents/staging-boxy#549](strands-agents/staging-boxy#549).
A build of a project with box/base and box/bedrock stopped with the new
message, and the profile did not change. boxRelease.json does not
change. typecheck, lint:check, format:check, and bun test show no
errors.
The CLI pinned box 0.1.11-linux-preview.6. That box rejects the profiles
that the CLI writes after the @box/ pack names and the key input of the
log group of the runtime. Its error for a @box/ pack is "@box/base" is
not a pack name. The CLI then told the user only to correct what Box
reports. The install hints named the release list, and not a version.

With this change, boxRelease.json pins
[box 0.1.11-linux-preview.7](https://github.com/mquang-amazon/box-releases/releases/tag/v0.1.11-linux-preview.7).
The Linux asset has SHA-256
782290ca3f0f0de3faa6c3943a0b51d521f16b135178ab7e4425986a97ee7622. The
ffi pin stays 0.1.11-linux-preview.2. scripts/bump-box-release.ts wrote
the file from the SHA256SUMS.txt of the release.

BOX_MINIMUM_VERSION is 0.1.11-linux-preview.7, the first box that reads
the profiles of the CLI. BOX_RELEASE_PAGE is the release page of the
pinned box. BOX_INSTALL_HINT and each install hint of the profile
resolver use that page and the pinned version. If a box rejects a @box/
pack name, the resolver says that the box comes before
BOX_MINIMUM_VERSION, and gives the hint.

The open routes fixture for a list of destinations is byte for byte the
output of the published macOS preview.7.

Tests: boxRelease.test.ts makes sure that the pinned box is at least
BOX_MINIMUM_VERSION, that its asset names its version, and that its
SHA-256 has 64 hex digits. boxProfileResolver.test.ts examines each
install hint, and the hint for a box before preview.7. Each test shows
an error in each of these conditions:

- The pin goes back to preview.6.
- The SHA-256 is not 64 hex digits.
- The asset names a different version.
- The resolver gives no hint for a box before preview.7.

A build with the pinned SHA-256 set to 64 f characters stopped with "not
the pinned ffff...". Nothing was installed.

The SHA-256 of the two downloaded assets agreed with SHA256SUMS.txt. The
macOS preview.7 was on PATH for agentcore build of a container project
and of a CodeZip project, and the two builds had no errors. The CodeZip
build downloaded the pinned Linux box and staged it. box profile show on
each staged Runtime profile, with dummy AWS_REGION,
OTEL_EXPORTER_OTLP_LOGS_HEADERS, and AGENTCORE_GATEWAY_BOX_URL, filled
these values:

- the log group and the log stream of the variable
- the region of AWS_REGION in the telemetry target
- the region of AWS_REGION in auth.aws.region of each backend

The macOS box did this with eu-central-1, and the Linux box in finch,
with no network, did this with ap-south-1. The build region was
us-west-2. typecheck, lint:check, format:check, and bun test show no
errors. docs/box-local-testing.md does not change.
Box Core #488 allows executable memory on Linux, so a CodeZip agent's Python runs in a box
without the _ctypes/libffi shim. build and deploy no longer download or stage it, and
boxRelease.json pins box only. box 0.1.11-linux-preview.7 is built on a Box Core with #488.
- The old-box hint test names box-integration's .box/profile.toml, not
  the development branch's .box/agent/local/profile.toml.
- The README's CodeBuild check names box 0.1.11-mquang.preview.9, the
  pinned box, not preview.6.
@mquang-amazon
mquang-amazon requested a review from a team November 20, 2026 03:57
@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.78%. Comparing base (fa21200) to head (7f50e90).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           box-integration    #2867      +/-   ##
===================================================
- Coverage            96.79%   96.78%   -0.01%     
===================================================
  Files                  766      766              
  Lines                66654    66590      -64     
===================================================
- Hits                 64519    64452      -67     
- Misses                2135     2138       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leo237 leo237 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.

Review of #2867 (plan PR MQ-8, phase 16 in the squash plan v2, "removing ffi") at 7543e1ed.

I read the plan; ReadInternalWebsites worked this time (no 401). The MQ-8 row lists no commits, so I checked against the five dev commits that the PR body names.

Commit list against box-integration-development

Here Dev Result
9bb2c0dd 967cc9f1 (@box/ names) Same 20-file scope. It leaves out boxDevSecrets.ts/.test.ts (MQ-6, #2862) and boxTelemetrySecrets.ts (SA-5). It adds boxEnvLocal.test.ts, boxNetworkWriters.test.ts and boxProfileEgress.ts (base-only renames). This matches the PR body.
52c2cf6e 56e9704f (preview.7, BOX_MINIMUM_VERSION) Same 5 files, adapted.
e8069dda 264da50a (no ffi shim) Same 11 files, +53/-283 against +52/-283.
baa1fe09 44779170 README. It is a little larger here because it also fixes the base README.
3934bbed 7de308e8 (preview.9) Identical in size.
6508ade3, 7543e1ed none New port fixes and formatting.
  • Missing: none for this scope. Dev's d4ef79a4 (shared-cache race) belongs to MQ-7 (#2865, a3326d85). Dev's f64fea50 (local-testing guide on preview.7 with @box/ names) belongs to DOCS-2.
  • Already on box-integration, applied twice: none. The branch is based on the current box-integration tip (1405932a, #2859).
  • Must-survive fixes (#2845–#2859): all intact. The only removed lines that touch them are box/ to @box/ renames. The Dockerfile keeps curl --retry 3 and tar --no-same-owner.

Box pin

  • boxRelease.json, the box.version defaults (project.ts, manager.tsx and boxValidation.ts all read BOX_RELEASE.version), the resolver errors, the README and the Dockerfile's box-release.env all move to 0.1.11-mquang.preview.9 together. No preview.6 pin is left. The remaining preview.6 mentions describe fixtures, plus one stale comment (inline).
  • docs/box-local-testing.md names no version, so there is nothing to change here. DOCS-2 (f64fea50) still has to reconcile the pin (now preview.9, not preview.7) and the <runtime>-box-egress gateway name.

ffi shim removal

  • The shim was pinned only for PYTHON_3_14, so CodeZip on 3.10–3.13 (the per-Python e2e cases in #2865) never got it. Removing it changes nothing for those versions.
  • 3.14 now depends on Box Core strands-agents/box#488 in preview.9. The deploy in the PR body covers 3.14 CodeZip and container.
  • A stale .box-dist/ffi/ from an older build is removed (test "replaces what an earlier deploy staged"). "ffi" leaving BOX_DIST_NAMES is correct.

Overlap with other open PRs

  • #2865 (MQ-7): real conflict in boxRelease.ts and boxRelease.test.ts. publishInstall is shared by installBox and installFfi, and installFfi goes away here. Whichever merges second keeps publishInstall for installBox only and drops the ffi half. The e2e file does not mention ffi or the pin, so there is no duplication.

  • #2862 (MQ-6): the PR body says it merges cleanly. It does not. git merge-tree against #2862's head (f9e63f1d, up to date with base) conflicts in 3 files:

    • src/core/dev/boxEnvLocal.test.ts: modify/delete;
    • src/core/project/boxProfileEgress.ts;
    • src/core/project/templates/boxProfile.test.ts.

    All three are small @box/ rename conflicts. #2862 also brings box/bedrock in boxDevSecrets.ts and in a boxDevSecrets.test.ts fixture, which then need the rename too.

  • #2866 (SA-5): conflicts in 9 files. That is expected, since SA-5 shares these files.

  • #2860, #2863, #2864: merge cleanly.

CI

Everything passes: Linux, Windows, macOS, CodeQL and the CodeBuild e2e. e2e is skipped. None of the known flaky base tests (Windows transactionSearch EFAULT, macOS screen 5 s timeouts) showed up.

Findings

Blocking (1). Not covered by a later plan PR.

  1. An existing Box project keeps deploying its old box, and the agent fails only on the Runtime. create wrote "box": { "version": "0.1.11-linux-preview.6" } into every Box project before this PR. boxReleaseFor accepts any published version (boxRelease.ts:253), so build and deploy still stage preview.6 (CodeZip .box-dist/, container box-release.env). They pair it with a Runtime profile that now names @box/base, @box/agentcore and @box/agentcore-codezip, and with no ffi shim. The PR body itself says preview.6 refuses @box/base.
    • Build does not catch this. box profile show runs the box on PATH, not the pinned one, so build passes, deploy passes, and the agent fails to start on AgentCore Runtime.
    • The new old-name stop makes it likely: it tells the user to rename the packs and build again, and following it leads straight to this deploy.
    • Fix: refuse (or at least warn about) a box.version older than BOX_MINIMUM_VERSION, and say "set box.version to {BOX_RELEASE.version}" in that error and in the old-name stop. Add a test for each.
    • Note: semver prerelease ordering cannot express that floor across linux-preview.N and mquang.preview.N (see the inline comment on the test).

Non-blocking.
2. The BOX_BASE_PROJECT_WRITE_TOOLS comment still says the pin is preview.6 (inline).
3. gte(BOX_RELEASE.version, BOX_MINIMUM_VERSION) passes only because "mquang" sorts after "linux-preview" (inline).
4. The PR body's merge-order note is wrong about #2862 (see Overlap above).
5. Known gap, as the PR body says: preview.9 lacks strands-agents/box#537 (SigV4 unsigned headers), which preview.7 has. SA-7 will need a box that has it. The base pin (preview.6) did not have it either, so this is no regression from base.

Coverage, silent failures and types.

  • The new behaviour has tests: the old-name stop and the message (box not run), the pass-through for @box/ names, the old-box hint wrapped over two lines, the stale ffi/ removal, and the pin invariants.
  • No Windows-unsafe patterns in the new tests: they use join(), with no sh, no file modes and no : splitting.
  • refuseOldShippedNames swallows a TOML parse error on purpose, and its comment says why: box reports the bad TOML itself. That is fine.
  • No new exported types. FfiRelease goes away, BoxLinuxBuild loses ffi, and the new constants are BOX_MINIMUM_VERSION, BOX_RELEASE_PAGE, BOX_BASE_PACK and BOX_BEDROCK_PACK. All are fine.

Decision: COMMENT because of finding 1. With that fixed (a version floor or a warning, plus a test), this is ready to approve.

Comment thread src/core/project/backends/boxRelease.ts Resolved
Comment thread src/core/project/boxNetworkSource.ts Resolved
Every Box project created before the @box/ rename names
box 0.1.11-linux-preview.6 under box.version. Build and deploy staged
that box with a Runtime profile that names @box/ packs, which it
refuses. Build could not see it, since box profile show runs the box on
PATH, so the agent failed only when it started on AgentCore Runtime.

- boxReleaseFor refuses a box that boxPredatesPackNames (a
  0.1.11-linux-preview.N below BOX_MINIMUM_VERSION's N, or any box
  before 0.1.11) before it downloads anything, and says to set
  box.version to the pinned box or remove it.
- The old box/<name> stop says the same when the runtime's box.version
  is such a box.
- The pin test checks boxPredatesPackNames, not a semver gte, which
  passed only because "mquang" sorts after "linux-preview".
- The BOX_BASE_PROJECT_WRITE_TOOLS comment names the pinned
  preview.9, whose @box/base still has only [tool.uname].

Review of #2867. New code; box-integration-development has the same gap.
Comment thread src/core/project/backends/boxRelease.ts Resolved
Comment thread src/core/project/boxNetworkSource.ts Resolved
Review of #2867 (vvargu): box.version must be the box that
boxRelease.json pins. Before, boxReleaseFor took any other version and
its checksums from that release's own SHA256SUMS.txt, so a box untested
with this CLI could ship (0.1.11-linux-preview.6 refuses the @box/
packs, and build cannot see that, since it checks the profile with the
box on PATH), and a changed asset matched its own published checksum.

- boxReleaseFor refuses any version but BOX_RELEASE.version, naming
  both and saying to set box.version to the pinned one. Build, deploy
  and container dev all read the release through it.
- The SHA256SUMS.txt lookup and its tests are gone. So are
  boxPredatesPackNames and the box.version sentence in the old
  box/<name> stop from e5ee285: the pin check covers that case.
- README and docs/box-local-testing.md: box.version must be the pinned
  version; trying an unreleased box means bumping boxRelease.json with
  scripts/bump-box-release.ts.

New code; box-integration-development still accepts other versions.
@mquang-amazon

Copy link
Copy Markdown
Contributor Author

@leo237 Finding 4: right, #2862 now conflicts in 3 files; the PR body is corrected. Finding 5 stays listed as a known gap.

# Conflicts:
#	src/core/dev/boxEnvLocal.test.ts
#	src/core/project/boxProfileEgress.ts
#	src/core/project/templates/boxProfile.test.ts

@leo237 leo237 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.

Re-review of #2867 (plan PR MQ-8, squash plan v2) at 602461c3, against our last review at 7543e1ed.

This is not a rebase. Two commits were added on top of 7543e1ed:

  • e5ee285f: the stale comment and the semver test;
  • 602461c3: ship only the pinned box.

Neither is a dev port. box-integration-development's boxReleaseFor still takes env and reads SHA256SUMS.txt for versions it doesn't pin, so both commits exist only on box-integration, as the PR body says. The branch is still based on 1405932a (#2859).

Earlier comments

# Ours at 7543e1ed Status
1 Blocking: a project with box.version: 0.1.11-linux-preview.6 ships preview.6 with @box/ packs Addressed in 602461c3. boxReleaseFor now refuses any version that isn't BOX_RELEASE.version, names both versions and says to set the pinned one. It runs before anything downloads: the CodeZip path calls it before resolveBoxLinuxBuild, and containers call it in stageBoxContainers. This also covers @vvargu's exact-pin request, and the SHA256SUMS.txt path and its tests are gone. A test.each over 0.1.11-linux-preview.6 and 2.0.0 checks the full message.
1b Name the pinned version in the old-name stop as well Addressed by design. After the user renames the packs, the next build stops at the pin check with the version to set. That takes two steps instead of one, but neither step lets the user get it wrong. Fine by me.
2 Stale preview.6 comment above BOX_BASE_PROJECT_WRITE_TOOLS Addressed in e5ee285f. The comment now says preview.9, and the author checked that @box/base in preview.9 still has only uname.
3 gte test passes only by sort order Addressed. The comparison is gone along with the version floor, and the semver import is removed from the test.
4 PR body wrong about #2862 merging cleanly Addressed in the body. It is now overtaken by finding 1 below.
5 preview.9 lacks strands-agents/box#537 Still listed as a known gap. It is non-blocking and no regression from base.

@vvargu's question on boxNetworkSource.ts:166 (is refuseOldShippedNames needed, given #2859 dropped a similar hint) has no reply yet. I'm not adding to it, just noting that it's still open.

The new code

  • Tests. The pin check is the only new logic, and the tests cover it: the pinned or absent version returns BOX_RELEASE, and two other versions are refused with the exact message. None of the new tests are Windows-unsafe: no paths, no sh, no file modes.
  • Silent failures. None. The SHA256SUMS.txt fallback that took checksums from the release itself is gone, so every box that ships matches boxRelease.json.
  • Comments and docs. The boxReleaseFor doc comment is accurate. The README and docs/box-local-testing.md now say the version must be the pinned one, and they point to scripts/bump-box-release.ts --box <version>, which exists and takes that flag. Nit: both say "build and deploy stop", but container agentcore dev stops as well, because ContainerDevRunner calls boxReleaseFor. CodeZip dev uses the box on PATH, so it doesn't stop.
  • Types. boxReleaseFor is now (version) => Promise<BoxRelease>. That matches the releaseFor types in container.ts and boxContainer.ts, so cdk.ts and container.ts pass it directly. No new types. Nit: boxReleaseFor is async but never awaits anything. That is harmless, and it keeps the Promise signature the callers expect.
  • Must-survive fixes. The new commits touch only boxRelease.ts/.test.ts, cdk.ts, container.ts, boxProfile.ts (the comment), the README and the testing guide. None of the listed fixes from #2845 to #2859 are in those lines.

Findings

Blocking (1).

  1. The branch conflicts with box-integration, so CI has not run on 602461c3. #2862 (MQ-6) merged into box-integration as 7252504c. GitHub reports this PR as CONFLICTING/DIRTY, and gh pr checks reports no checks for the head. git merge-tree of the head against box-integration conflicts in the same 3 files as before:

    • src/core/dev/boxEnvLocal.test.ts: modify/delete. #2862 deleted it. Drop it, and move any @box/ rename to wherever #2862 moved those tests.
    • src/core/project/boxProfileEgress.ts
    • src/core/project/templates/boxProfile.test.ts

    Please merge box-integration in (or rebase), then:

    • rename the box/ names that #2862 brought in. These are box/bedrock in the src/core/dev/boxDevSecrets.ts doc comment (line 28) and in the src/core/dev/boxDevSecrets.test.ts fixture (line 51, packs = ["box/bedrock"]). With preview.9, a real box refuses that fixture;
    • check that nothing from #2862 is lost: per-runtime dev secrets, the .venv/bin/python check, box starting in app/<runtime>, start.py reading policies as JSON on 3.10, and EnvLocalFile.upsert.

    container.ts and cdk.ts auto-merge, and on the base boxReleaseFor has no callers outside those two files, so the new signature should typecheck after the merge. CI has to confirm that.

Non-blocking.
2. Docs nit: "build and deploy stop" leaves out container agentcore dev (see "Comments and docs" above).
3. Known gap, unchanged: preview.9 lacks strands-agents/box#537.

Overlap with other open PRs

  • #2865 (MQ-7): still conflicts in boxRelease.ts/boxRelease.test.ts, and it now also conflicts on boxEnvLocal.test.ts (modify/delete), because #2865 already has #2862. The earlier note still applies: keep publishInstall for installBox and drop the ffi half.
  • #2866 (SA-5): it still pins 0.1.11-linux-preview.7 with the ffi shim, and its boxReleaseFor still has the SHA256SUMS.txt path. Whichever merges second must keep this PR's exact-pin boxReleaseFor and the preview.9 pin.

CI

No checks have run on 602461c3. GitHub doesn't run the pull_request workflows while the branch conflicts with its base. Nothing is pending; the checks will start once the conflict is resolved. The known flaky base tests (Windows transactionSearch EFAULT, macOS screen 5 s timeouts) are non-blocking if they show up. If verify / Linux fails with Script not found "test:package", the branch is still behind box-integration.

Decision: COMMENT because of finding 1. Once box-integration is merged in, the two #2862 box/bedrock names are renamed and CI is green, this is ready to approve. The earlier blocker is fixed.

@leo237 leo237 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.

Re-review of #2867 (plan PR MQ-8, squash plan v2) at b0f330a, against our last review at 602461c3.

What changed: one commit, b0f330a, which merges box-integration at 7252504c (the #2862 merge) into the branch. It is not a rebase. The ten earlier commits are the same, so there are no new dev ports and no new commits that exist only on box-integration. The branch now merges cleanly and CI runs.

How I checked the merge: I diffed the PR's net change before the merge (1405932a..602461c3) with its net change after (box-integration..b0f330a), ignoring hunk headers and context. Two hunks differ, and both are the ones we asked for:

  • The boxEnvLocal.test.ts hunk is gone, because #2862 deleted that file. The boxProfileEgress.ts hunk is also gone, because #2862 rewrote that comment and it no longer names a pack.
  • The two box/bedrock names that #2862 added are now @box/bedrock: the boxDevSecrets.ts comment at L28 and the boxDevSecrets.test.ts fixture at L51.

Every other hunk is identical. The merge keeps all of box-integration, and its net diff touches only the files and lines this PR meant to change. So all of #2862's fixes survive as box-integration has them:

  • per-runtime dev secrets;
  • the .venv/bin/python check;
  • boxStartFolder;
  • the start.py JSON policies on Python 3.10;
  • OTEL off for box templates;
  • the A2A card URL;
  • EnvLocalFile.upsert;
  • the key-rotation refresh.

The fixes from #2845 to #2859 also survive. In src, docs, README.md and scripts, the only box/<name> left are deliberate:

  • the refuseOldShippedNames tests in boxNetworkSource.test.ts;
  • the preview.6 fixture box-profile-show-open-routes.json;
  • the resolver test that describes the old name.

CI at b0f330a: everything passed: verify on Linux, Windows and macOS, Analyze, CodeQL and the CodeBuild e2e. The GitHub e2e job was skipped. The known flaky tests on the base did not fail this time: the Windows transactionSearch EFAULT test and the 5 s timeouts in the macOS screen tests.

Addressed since our last review:

  • Finding 1, which was blocking (the conflict, the two @box/ renames, and checking that nothing #2862 brought was lost), is fixed by b0f330a.

Still open, all non-blocking (not repeated in full; see our review at 602461c3):

  • README L231 and docs/box-local-testing.md L34 still say "build and deploy stop" on another box.version, but container agentcore dev stops too (container.ts calls boxReleaseFor).
  • boxReleaseFor is still async but awaits nothing.
  • preview.9 lacks box#537. The author lists this as a known gap.
  • @vvargu's question on boxNetworkSource.ts about whether refuseOldShippedNames is needed still has no reply.
  • Coordination: whichever of #2865 and #2867 merges second must keep publishInstall in installBox. #2866 (open) still pins 0.1.11-linux-preview.7 and keeps the SHA256SUMS.txt path, so whichever of #2866 and #2867 merges second must keep this PR's exact pin and preview.9.
  • e5ee285f (the preview.9 comment and test) and 602461c3 (the exact pin) are still not on box-integration-development. On dev, boxReleaseFor still reads SHA256SUMS.txt for other versions. Please port both to dev.

New findings: none. The merge adds no code, comments or types beyond the two renames, and the test fixture covers the rename.

Approving: no blocking issues remain.

mquang-amazon added a commit that referenced this pull request Nov 20, 2026
The Box deploy cases waited a fixed 30 s after 'running profile' and
then checked that no error line was logged, so a line CloudWatch
delivered later passed unseen. They now wait for the agent server's
access line for the invoke's POST first. Also: a README note that the
Python 3.10-3.13 box cases pass only with #2867, a test of
publishInstall's lost rename race, and two comment fixes.
Review of #2867 (vvargu): refuseOldShippedNames only gave a fix hint
for profiles an earlier CLI wrote. Box projects are new, and create
writes @box/<name>, as #2859 dropped the hint for the old
.box/profile.toml layout. A profile with an old name still fails at
build: box refuses it ("box/base" is not a pack name; the pack that box
ships is @box/base). The resolver's hint for a box on PATH older than
preview.7 stays.

The README and the testing guide also say that container dev, not only
build and deploy, stops on a box.version other than the pinned one
(review, leo237).
@mquang-amazon

Copy link
Copy Markdown
Contributor Author

@leo237 Thanks. f40ebce fixes the doc nit: the README and testing guide now say container dev stops too. boxReleaseFor stays async because its callers take a promise. I left box-integration-development alone; porting there is a separate step.

@leo237 leo237 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.

Re-review of #2867 (plan PR MQ-8, squash plan v2) at f40ebce7, against our last review at b0f330a.

What changed: one commit on top of b0f330a, f40ebce7 (refactor(box): Drop the old box/ pack-name stop). It is not a rebase, and it merges nothing new: box-integration is still at 7252504c, so the branch is not behind. The commit exists only on this branch. box-integration-development still has refuseOldShippedNames (boxNetworkSource.ts:131), and the plan's MQ-8 row lists no later commit that covers it.

The commit does three things:

  • It removes refuseOldShippedNames, OLD_SHIPPED_NAME, the call in readResolvedPolicy, the two tests for them, and the now-unused ProjectStateError import in the test. parseToml and ProjectStateError are still used in boxNetworkSource.ts, so no import is left dangling. Across the whole PR, boxNetworkSource.ts now changes only BOX_BEDROCK_PACK and a comment.
  • The README says "build, deploy and container dev stop on any other version".
  • docs/box-local-testing.md says the same.

Earlier comments addressed

  • vvargu's question on refuseOldShippedNames (boxNetworkSource.ts): it is now removed, with its two tests, as vvargu asked. The resolver hint for a box on PATH older than preview.7 stays (boxProfileResolver.ts:51, :189, and its test). A profile that still names box/base now fails at build with box's own refusal, so nothing fails silently. The author's reply is 4638870552.
  • Our doc nit (README and testing guide): both now include container dev.
  • boxReleaseFor being async with nothing to await: the author keeps it because its callers take a promise. That's fine, and I'm closing this item.

Review of the new commit

  1. Test coverage: the two removed tests covered only the removed function. No logic that is left lost coverage.
  2. Silent failures: none. An old box/<name> name is still refused, now by box at build instead of by the CLI before box runs.
  3. Comment accuracy: the README and testing-guide wording matches the code. The commit message is accurate.
  4. New types: none.
  5. General: the commit is small and clean. It does not touch boxRelease.ts, so it does not conflict with or undo #2865's publishInstall.

Must-survive fixes: none is affected. The commit touches only the old-name stop that this PR added. The @box/ names that create writes (#2862) and policies / tomlKey in boxNetworkSource.ts (#2848/#2849) are untouched.

CI at f40ebce7: all green. That covers verify on Linux, Windows and macOS, Analyze, CodeQL and the CodeBuild e2e; GitHub's e2e job was skipped. The known flaky base tests (the Windows transactionSearch EFAULT test and the 5 s timeouts in the macOS screen tests) did not fire.

Non-blocking, still open

  • preview.9 lacks box#537 (SigV4 unsigned headers). The author lists this as a known gap.
  • Back-port to box-integration-development: e5ee285f, 602461c3, and now also f40ebce7, because dev still has refuseOldShippedNames and its tests. The author says porting is a separate step.
  • Coordination with #2866 (SA-5): #2866 carries its own copy of refuseOldShippedNames (from 04f6bccb, at boxNetworkSource.ts:203/:265) and its test. Whichever of the two merges second must keep it removed, as well as keeping this PR's exact pin and preview.9.
  • Coordination with #2865 (MQ-7): unchanged. Whichever merges second must keep publishInstall and its tests, and drop the ffi half. #2865 also changes readResolvedPolicy next to the removed call; that's an easy textual conflict at most.
  • Nit: the changed line in docs/box-local-testing.md now runs past 100 columns. Prettier keeps prose as it is, so CI doesn't fail; it would just be nice to rewrap.

Approving.

SaiAbhishek98 pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 20, 2026
… and of each leaf

On a CodeZip Runtime, the dependencies are in the code folder, and not
in a venv. When the local profile set its own PYTHONPATH, for example
"${{ workspace }}/app/agent/lib", the derived PYTHONPATH had the ffi
shim and that entry, but not the code folder, so `import strands`
failed when the agent started. Quang found this in the review of
[aws#2866](aws#2866).

With this change, the paths rule, after it moves the paths, gives the
PYTHONPATH of [agent], and of each stdio server or tool that runs the
Runtime Python, each entry one time, in its order, and adds
${{ inputs.code.dir }} at the end when the PYTHONPATH does not name it.
For a leaf, the ffi shim comes first; the additions rule puts it first
for [agent]. Two local entries that move to one Runtime path, as the
code folder and its venv do, become one entry.

aws#2867 removes the ffi shim from these lines. The PR
that merges second keeps the code folder.

Tests: paths.test.ts "keeps the code folder in the PYTHONPATH of
[agent] and of a leaf on the Runtime Python, one time".
vvargu pushed a commit that referenced this pull request Nov 20, 2026
* test(e2e): Deploy and invoke every Strands Box template

Adds a box tag and a test for each box template: create, deploy, invoke, then check the
Runtime's logs show box running the agent, and tear the stack down. They skip agentcore dev,
which runs box on a fixed ingress port.

* test(e2e): Cover the two box templates outside CI

Add agent-python-strands-box and agent-python-strands-box-container to the
runtime template cases. CI deploys with the released @aws/agentcore-cdk,
which has no Box support yet, and has no box on PATH for CodeZip dev, so
the cases skip in CI. A CodeZip box agent's dev serves on the profile's
ingress port, so that case pins dev to 8080.

* test(e2e): Skip dev for the box template cases

The box cases test create, deploy and invoke on AgentCore Runtime, not
agentcore dev, so they no longer start dev or invoke locally.

* test(e2e): Run the CodeZip box template on each Runtime Python

Add a py_strands_box case for PYTHON_3_10 through PYTHON_3_13, beside
the template's default PYTHON_3_14, by setting runtimeVersion in
agentcore.json after create. The remote invoke now also needs a 2xx
status and a body, as the local invoke does, so an agent that failed to
start in its box fails the case.

* test(e2e): Address the review of #2865

- Skip the Box template describe in CI, which deploys with the released
  CDK and has no box on PATH.
- Look for the README's error lines with their own logs query, as
  --query returns only the events it matches.
- Require a 2xx status and a body from a Box agent's remote invoke.
- Check that box ran for the per-Python cases too, through the box field.
- Drop py_strands_box and py_strands_box_container, which deployed the
  same templates as the Box describe.
- Say that ALL_TEMPLATES sets only the project name.

* test(e2e): Wait before the Box error check, and say what box runs

- Wait 30 s after 'running profile' before looking for error lines, so
  lines from the invoke have reached CloudWatch.
- Say in e2eTest/README.md that --tagsFilter='box' leaves out the
  per-Python box cases, and that the Box describe's skipIf is the only
  skip for BOX_TEMPLATES.
- Name the root README.md as the source of the error lines.

* fix(box): keep a box another process installed into the shared cache

Concurrent build and deploy commands each download box into their own work folder, then
moved it into ~/.agentcore/box/<version>-<target>/ by removing what was there first. A command
that finished second removed the folder the first had just installed, while that command was
copying out of it (ENOTEMPTY, EEXIST, or ENOENT on strands-box-contain-trampoline). An install
now keeps a complete folder another process renamed in, and drops its own copy.

* test(e2e): Run agentcore dev for every Strands Box template

The Box tests deployed each Strands Box template but skipped agentcore dev,
because box listens on the protocol's fixed ingress port and the tests run
concurrently. A sequential group now creates each template, runs dev on
that port, invokes it locally and checks that box started the agent.

A box-egress test runs the minimal box template with an agent that fetches
two hosts. Its local profile allows checkip.amazonaws.com with no
credential, so that call returns 200 and box blocks example.com with a 403.
It reaches public hosts, so it retries twice and has its own tag, which
keeps it out of --tagsFilter='box'.

* test(e2e): Skip the Strands Box tests when no box runs from PATH

Create, build and deploy of a Box template run box, and box ships only
arm64 builds, so on the x86_64 Linux CI runner every Box test failed at
create. The Box groups now skip there and run wherever a box does.

* test(e2e): Gate the Box deploy cases on a Box-capable CDK

Address the review of #2865.

- The Box cases that deploy run only with AGENTCORE_E2E_BOX_CDK, an
  @aws/agentcore-cdk version or file: tarball that deploys Box projects;
  createTemplateProject installs it in each Box project's agentcore/cdk.
  The pinned release still rejects boundRuntime, so the CI-only skip hid
  that a laptop run fails at synth the same way. CI sets no opt-in.
- The per-Python Box cases take the same gate, so they also skip without
  box on PATH.
- The README says which steps need box: create for a CodeZip box
  template, build and deploy (box profile show) for every Box template.
- The egress test throws at collection when its template case is gone,
  instead of skipping silently.
- publishInstall renames first and removes the cache folder only when
  the rename fails and the folder is not a complete install, and its
  comment names the window that remains and EPERM on Windows. A test
  covers replacing an interrupted install.

* fix(box): Start box from agentcore.json's code folder, not a comment

Address leo237's last comments on #2862:

- boxStartFolder read the folder box starts in from the local profile's
  header comment, so a user who edited or removed it moved box back to
  the project root, with its project-wide grant, and the agent's
  ${{ workspace }}/.venv went missing. It now takes a CodeZip runtime's
  codeLocation from agentcore.json; the project root stays for a
  container and for a profile written before, whose paths name the
  code folder under the project root.
- A comment in serve() still said box starts the agent in the project
  folder.
- EnvLocalFile.upsert replaced only the first line of a key, so a later
  one, which the parser keeps, left the old key in force while build
  said it updated it. It replaces every line of the key, and keeps an
  export line an export line.

* fix(box): Start every CodeZip box in its code folder, with no fallback

boxStartFolder kept the project root for a profile whose text named
${{ workspace }}/app/, as a profile from before box started in the code
folder does. A current profile that grants ${{ workspace }}/app/<x>
matched it too, and box quietly started at the project root again, with
its project-wide grant. Box projects are new, so there is no older
profile to run: a CodeZip runtime's box starts in its codeLocation, and
a container's in the project root. The dev runner's comment says so.

* fix(box): Stop start.py on a policies line it cannot read on 3.10

On Python 3.10, with no tomllib, start.py reads the staged profile's
policies with a regex, and a line in any other form gave no policy
files and no message, so box failed later with an unclear error.
start.py now stops with an error that names the line. A test runs
staged_policies with no tomllib on the profiles deploy renders.

* fix(box): Keep upsert's first snapshot, and say which GITHUB_TOKEN build reads

EnvLocalFile.upsert snapshotted the file before its in-place write,
then insertIfNew snapshotted the half-updated file, and the first one
came back only if insertIfNew succeeded. It now keeps the earliest
snapshot, as removeKeys does, so rollback restores the original file.

The local testing guide said a build with GITHUB_TOKEN unset keeps the
stored key. Build reads GITHUB_TOKEN from .env.local too, so a line
there replaces the stored key, even with an older one.

* test(e2e): Wait for the invoke's own log line before the error check

The Box deploy cases waited a fixed 30 s after 'running profile' and
then checked that no error line was logged, so a line CloudWatch
delivered later passed unseen. They now wait for the agent server's
access line for the invoke's POST first. Also: a README note that the
Python 3.10-3.13 box cases pass only with #2867, a test of
publishInstall's lost rename race, and two comment fixes.

* docs(box): Drop the troubleshooting item for earlier branch builds

Box is only for new projects, so the guide gives no cleanup hints for
.env.local lines that earlier box-integration builds wrote.

* test(box): find Python on Windows without throwing

Bun.spawnSync throws on Windows when the executable is not on PATH,
so the python3 probe failed the file before any test ran.
# Conflicts:
#	src/core/project/backends/boxRelease.test.ts
#	src/core/project/backends/boxRelease.ts
SaiAbhishek98 pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 20, 2026
…n an earlier box refuses one

The profile resolver told the user to install "box <pin> or a later
release". It gave no hint when a box before 0.1.11-linux-preview.7
refused an `@box/<name>` pack with `"@box/base" is not a pack name`.
The user then got only "Fix what Box reports".

This commit takes the same change from
[aws#2867](aws#2867),
so that the PR that merges second has a small conflict:
[52c2cf6](aws@52c2cf6),
with the test changes of
[6508ade](aws@6508ade) and
[7543e1e](aws@7543e1e). The
boxRelease.json part of 52c2cf6 was in this branch before.

- `BOX_MINIMUM_VERSION` is 0.1.11-linux-preview.7, the first box that
  reads the `@box/` packs and the `key` of a list input.
- `BOX_RELEASE_PAGE` is the release page of the pinned box.
- `BOX_INSTALL_HINT` and the install hints of the resolver use them.
- When a box refuses an `@box/` pack, the resolver says that the box is
  earlier than `BOX_MINIMUM_VERSION`, and gives the hint.

Tests: boxRelease.test.ts examines that the pin is at least
`BOX_MINIMUM_VERSION` with semver, and the asset, the SHA-256, and the
page of the pin. boxProfileResolver.test.ts examines each hint, and
"says to install the pinned box when a box older than preview.7 refuses
an @box/ pack".
SaiAbhishek98 pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 20, 2026
## Problem

Build downloaded the ffi shim (box-ffi-python3.14, release
0.1.11-linux-preview.2), staged it in `.box-dist/ffi`, and put it first
in the Runtime `PYTHONPATH` of the agent and of each leaf on the Runtime
Python. The shim was necessary because Box Core refused executable
memory on Linux. box 0.1.11-mquang.preview.9 has Box Core 78e752b0, with
[strands-agents/box#488](strands-agents/box#488),
so the Python of the Runtime runs in a box with no shim.

## Solution

This commit has the shim removal of
[aws#2867](aws#2867)
([e8069dd](aws@e8069dd)
and [baa1fe0](aws@baa1fe0)),
so that the PR that merges second has a small conflict:

- `boxRelease.json` pins only `box`. `FFI_RELEASE`, its cache, and its
  download go. `bump-box-release.ts` accepts only `--box`.
- `stageBoxCodeZip` stages no `ffi` folder, and `.box-dist` names no
  `ffi` folder.
- The README says what the zip contains with no shim.

The part of e8069dd in `runtimeCodeZipRunner` is not necessary here,
because the derivation gives the Runtime `PYTHONPATH`. The derivation
changes as follows:

- The additions rule adds no shim. An `[agent]` with no `PYTHONPATH`
  gets the code folder on CodeZip.
- The paths rule adds no shim at the start for a leaf. It keeps each entry one
  time, and keeps the code folder at the end of the `PYTHONPATH` of
  `[agent]` and of each leaf on the Runtime Python.

The template tables of `old-renderer-tables.json` are recorded again
from the renderer of aws#2867 at f40ebce. Only the 102
`PYTHONPATH` values change, to `${{ inputs.code.dir }}`.

## Tests

- additions.test.ts: "keeps a PYTHONPATH of the user as it is, on
  CodeZip and on a container", "gives an [agent] with no PYTHONPATH the
  code folder on CodeZip, and none on a container", and the tests on
  the recorded tables.
- paths.test.ts: "keeps the code folder in the PYTHONPATH of [agent]
  and of a leaf on the Runtime Python, one time", and "ends a leaf's own
  PYTHONPATH with the code folder, and adds none to [agent] or a leaf
  with no Python".
- boxCodeZip.test.ts and boxRelease.test.ts, as in aws#2867.
SaiAbhishek98 pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 20, 2026
…hine that it has no build for

## Problem

The CLI pinned box 0.1.11-linux-preview.7. Its Box Core refused
executable memory on Linux, so the ffi shim was necessary for a CodeZip agent. The
previous commit removes the shim. The user selected
[box 0.1.11-mquang.preview.9](https://github.com/mquang-amazon/box-releases/releases/tag/v0.1.11-mquang.preview.9):
staging-boxy b0846169 with
[strands-agents/staging-boxy#549](https://github.com/strands-agents/staging-boxy/pull/549),
on Box Core 78e752b0 with
[strands-agents/box#488](strands-agents/box#488).
It does not have strands-agents/box#537.

That release has only the Linux arm64 build. Each install hint named
only the release page of the pin, so on macOS the hint gave a page with
no build for the machine.

## Solution

- `bun scripts/bump-box-release.ts --box 0.1.11-mquang.preview.9` wrote
  `boxRelease.json` from the SHA256SUMS.txt of the release. The file is
  the same as in
  [3934bbe](aws@3934bbe) of
  [aws#2867](aws#2867).
- `BOX_MINIMUM_RELEASE_PAGE` is the release page of
  `BOX_MINIMUM_VERSION` (0.1.11-linux-preview.7), which has a macOS build.
- `BOX_OTHER_MACHINE_HINT` says to use that box, or a subsequent
  release with a build for the machine, when the pinned release has none.
  `BOX_INSTALL_HINT` and each install hint of the profile resolver end
  with it.
- The local box is not compared to the pin. A macOS box
  0.1.11-linux-preview.7 on PATH stays correct for `agentcore dev` and
  for the profile checks of build.
- The README, the guide, and the comment on the tools of `@box/base`
  name the new pin. The packs of preview.9 are the same as the packs of
  preview.7, so `@box/base` has one tool, `uname`.

## Tests

- boxRelease.test.ts: "box is at least the first release that reads the
  profiles the CLI writes" (semver sorts 0.1.11-mquang.preview.9 after
  0.1.11-linux-preview.7), and "the install hint names the pinned
  release, and the first release for a machine it has no build for".
- boxProfileResolver.test.ts: each install hint of the resolver.
- The SHA-256 of the archive that curl downloaded into a new empty
  folder agreed with SHA256SUMS.txt
  (5b0f8802fb1c5cbc22db4bfcefc9061e048e931c972584350ebce6c1b15da884).
  A `diff -r` of the resources of preview.7 and preview.9 found no
  difference.

@leo237 leo237 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.

Re-review of #2867 (plan PR MQ-8, squash plan v2) at c6cd3f4, against our last review at f40ebce7.

What changed: one merge commit, c6cd3f4. It merges origin/box-integration (now b8055125, which includes #2865 / MQ-7) into the branch. It is not a rebase: f40ebce7 and the commits before it are unchanged. It adds no new work commit, so there is nothing new to port from or to box-integration-development. The merge resolved conflicts in boxRelease.ts and boxRelease.test.ts.

I compared the PR's net diff against its base before and after the merge (git diff <old merge-base> f40ebce7 against git diff box-integration c6cd3f4). The two diffs are the same except in the two files that conflicted, where the change is what the agreed rule asks for.

Conflict resolution (#2865's rule: keep publishInstall and its tests, drop the ffi half)

  • installBox still ends with publishInstall(payload, root, () => installedBox(release.version, root)). publishInstall itself is byte-for-byte the same as on box-integration, including the comment.
  • The only publishInstall call that is gone is the one in installFfi, which this PR deletes. existsSync is still imported because publishInstall uses it.
  • All three describe("publishInstall") tests are still there: the race after the first check, the incomplete folder, and the plain rename. #2865's two resolveBoxLinuxBuild cache tests are also still there, rewritten without ffi: "keeps the release another process installed…" and the partial-folder test.
  • None of the ffi pieces is left in src/: FfiRelease, FFI_RELEASE, installFfi, ffiCache, ffiCachePath, FFI_CACHE_MARKER, build.ffi, the cpSync of ffi/, the ffi entry in BOX_DIST_NAMES, and the ${code}/.box-dist/ffi PYTHONPATH prefix. The CodeZip runner sets PYTHONPATH: code. The only remaining ffi in src/ is the boxCodeZip.test.ts case that checks a stale .box-dist/ffi/ gets cleaned out, which is correct.
  • The exact pin and the removal of SHA256SUMS.txt are intact. boxReleaseFor(version) returns BOX_RELEASE for no version or the pinned one, and throws InvalidEnvironmentError for anything else. releaseChecksums is gone, and the test.each over preview.6 and 2.0.0 is still there. boxRelease.json has only box at 0.1.11-mquang.preview.9.
  • Nothing else from #2865 was lost. Outside the two conflicted files, the merge only brought in #2865 unchanged: boxStartFolder (11 references, the same as base), boxStartPy.test.ts, the envLocal upsert fixes, e2eTest/ and the box.ts change. The PR's net diff touches none of them.

Earlier comments: every inline thread from us and from vvargu was already addressed at f40ebce7, and the merge didn't reopen any of them. The exact pin, the stale preview.6 comment, the semver test, refuseOldShippedNames and the doc wording all still hold at c6cd3f4.

Review of the merge

  1. Test coverage: no coverage was lost. The ffi tests that were dropped covered only code that is gone, and every publishInstall and cache-race test survives.
  2. Silent failures: none. publishInstall still rethrows when the rename fails and no complete install is there. Any box.version other than the pin still fails loudly before a download.
  3. Comment accuracy: the boxRelease.ts comments match the code. The one stale text is below.
  4. New types: none. The merge only removes FfiRelease and BoxLinuxBuild.ffi, as before.
  5. General: the resolution is clean and minimal.

Must-survive fixes: these are intact, and the reference counts are the same as on box-integration:

  • writesBedrockRoute, tomlKey, assertBoxRuntimesHaveBoxVersion, ENV_LOCAL_RELATIVE_PATH and runtimeRunsInBox
  • ${{ inputs.gateway.url }} and ${{ inputs.aws.region }}, the xray grants and selectTemplate
  • the Dockerfile's curl --retry 3 and tar --no-same-owner, and the box-egress docs
  • #2865's publishInstall and boxStartFolder

README claim for 3.10–3.13 (from #2865): the code now supports it. No ffi shim is pinned or staged, so a CodeZip runtime on any Python gets the same .box-dist/ and the same PYTHONPATH. The CodeBuild e2e passed, but the Box cases need the AGENTCORE_E2E_BOX_CDK opt-in and CI doesn't set it, so py_strands_box_3_10…3_13 have not been run. The author's deploy covered PYTHON_3_14 only.

Non-blocking

  • New: e2eTest/README.md:47-51 (from #2865) still says the four 3.10–3.13 cases "pass only once box runs CodeZip agents without the ffi shim (#2867): until then boxRelease.json pins a shim for PYTHON_3_14 only, so they fail on any machine." Once this PR merges, that sentence is out of date. Please change it to say they run, or drop it. Ideally, also run one of them with the opt-in. The file isn't in this PR's diff, so I can't comment on it inline. No later plan PR covers it, and dev's e2eTest/README.md doesn't have the sentence.
  • Still open: preview.9 lacks box#537 (SigV4 unsigned headers). The author lists this as a known gap.
  • Still open: the changed line in docs/box-local-testing.md (`src/core/project/backends/boxRelease.json`; build, deploy and container `dev` stop on any other version. To try an) still runs past 100 columns.
  • Still open: e5ee285f, 602461c3 and f40ebce7 exist only on box-integration and need back-porting to box-integration-development. Dev's boxRelease.json is at preview.9 with no ffi, but dev still accepts other versions through SHA256SUMS.txt and still has refuseOldShippedNames.
  • Coordination with #2866 (SA-5): this still applies, with less to do. At d6330f6d, #2866 now pins preview.9 and carries no ffi PYTHONPATH prefix. It still has the SHA256SUMS.txt lookup in boxReleaseFor/releaseChecksums and refuseOldShippedNames in boxNetworkSource.ts. Whichever of the two merges second must keep this PR's exact pin, with no SHA256SUMS.txt lookup, and delete refuseOldShippedNames and its tests by hand.
  • Coordination with #2865 (MQ-7): resolved. #2865 merged first, and this merge kept publishInstall and dropped the ffi half as agreed.

CI at c6cd3f4: all green. That covers verify on Linux, Windows and macOS, Analyze, CodeQL and the CodeBuild e2e; GitHub's e2e job was skipped. The branch is up to date with box-integration, so there's no test:package failure. The known flaky base tests (the Windows transactionSearch EFAULT test and the 5 s timeouts in the macOS screen tests) did not fire.

Approving.

# Conflicts:
#	README.md
#	src/assets/templates/agent-python-strands-box/Dockerfile.template
#	src/core/project/backends/boxCodeZip.test.ts
#	src/core/project/backends/boxRelease.test.ts
#	src/core/project/backends/boxRelease.ts
#	src/core/project/boxNetworkWriters.test.ts
#	src/core/project/boxProfileResolver.test.ts
#	src/core/project/boxProfileResolver.ts
#	src/core/project/templates/boxProfile.test.ts
#	src/core/project/templates/boxProfile.ts

@leo237 leo237 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.

Re-review of #2867 (plan PR MQ-8, squash plan v2) at c2e1e8d, against our last review at c6cd3f4.

What changed: one merge commit, c2e1e8d. It merges origin/box-integration at fa212009, which includes #2866 (SA-5), into the branch. It is not a rebase: c6cd3f4 and the commits before it are unchanged. It adds no new work commit, so there is nothing new to identify as a dev port or a box-integration-only commit. The merge resolved the 10 expected conflicts. The branch is up to date: the merge-base is box-integration's head.

What the PR still adds over box-integration: 10 files, +37/−183. #2866 already brought in the ffi removal and the preview.9 pin, so the PR is now just these changes:

  • The exact pin. boxReleaseFor(version) takes only the version. It returns BOX_RELEASE for no version or the pinned one, and throws InvalidEnvironmentError for any other. releaseChecksums and the SHA256SUMS.txt lookup are gone. cdk.ts and container.ts call the new signature. The README and docs/box-local-testing.md describe the rule.
  • refuseOldShippedNames is removed: the function, OLD_SHIPPED_NAME, its call in readResolvedPolicy, and both of its boxNetworkSource.test.ts tests.
  • Two box/bedrock → @box/bedrock text fixes in boxDevSecrets.

Conflict resolution

  • The exact pin is kept. Nothing in src/ mentions SHA256SUMS.txt except the BOX_RELEASE doc comment, which correctly says the checksums are not read from it. scripts/bump-box-release.ts and the README's bump-script sentence still read it, as intended.
  • refuseOldShippedNames is gone everywhere in src/, including from boxNetworkSource.ts (which had merged silently), together with its call and its tests. parseToml and ProjectStateError are still used in that file. boxProfileResolver.ts's hint about an old box on PATH, which uses BOX_MINIMUM_VERSION, stays.
  • publishInstall (#2865) is still called at the end of installBox. Its three tests are still there.
  • No ffi is left in src/, docs/ or the README.
  • Nothing #2866 brought in is lost or reverted. The PR's net diff against box-integration touches only the 10 files above, and only in the hunks listed. So BOX_OTHER_MACHINE_HINT and its BOX_INSTALL_HINT test, the runtimeProfile/ derivation, RUNTIME_TELEMETRY_REFUSED, routeKey, withoutUnsentRoutes and boxStartFolder are all the same as on base.

Blocking: verify / Linux fails at lint:check

src/core/project/backends/boxRelease.test.ts:10:10: Identifier 'gte' is imported but never used.
Found 0 warnings and 1 error.

#2866 added import { gte } from "semver"; together with the assertion expect(gte(BOX_RELEASE.version, BOX_MINIMUM_VERSION)).toBe(true) in "the pinned releases". The merge correctly dropped the assertion, as this PR agreed with vvargu's semver comment, but it kept the import. .oxlintrc.json sets correctness to error, so the unused import fails the lint step. That step runs before typecheck and the tests on Linux, so none of those ran on Linux either. The fix is to delete line 10 of boxRelease.test.ts. There's an inline comment below. No later plan PR covers it: this is a merge artifact that exists only on this branch.

Review of the merge

  1. Test coverage: boxReleaseFor still has both cases: the pinned version or none, and the test.each refusing 0.1.11-linux-preview.6 and 2.0.0 with the exact message. The two refuseOldShippedNames tests went with the code they covered. #2866's tests are all unchanged.
  2. Silent failures: none. Any other box.version fails loudly before a download, in build, deploy and container dev.
  3. Comment accuracy: the new boxReleaseFor doc comment and the BOX_RELEASE comment match the code. BOX_MINIMUM_VERSION now only describes the local box on PATH, as its comment and BOX_OTHER_MACHINE_HINT say. Minor: the test title "pins one box, with the asset of its own version and a SHA-256" also checks BOX_MINIMUM_VERSION. That's fine.
  4. New types: none.
  5. General: apart from the stray import, the resolution is clean and minimal.

Must-survive fixes: these are intact, because the PR's net diff touches none of them. That covers #2845's boxProfileCredentials.ts checks and ENV_LOCAL_RELATIVE_PATH; writesBedrockRoute, tomlKey and the duplicate-host check; the Dockerfile's curl --retry 3 and tar --no-same-owner; the xray grants; runtimeRunsInBox, assertBoxRuntimesHaveBoxVersion and selectTemplate; ${{ inputs.gateway.url }} and ${{ inputs.aws.region }}; #2865's publishInstall; and everything #2866 brought in.

Earlier comments: every inline thread from us and from vvargu was addressed by f40ebce7, and this merge didn't reopen any of them. The exact pin, the preview.6 comment, the semver test, refuseOldShippedNames and the container-dev doc wording all still hold.

Non-blocking (still open, not repeated in detail)

  • e2eTest/README.md:47-51 still says the 3.10–3.13 cases fail until the ffi shim is removed (#2867). That's out of date now that #2866 has removed the shim on box-integration.
  • preview.9 lacks box#537 (SigV4 unsigned headers). This is a known gap.
  • The changed docs/box-local-testing.md line 36 (`src/core/project/backends/boxRelease.json`; build, deploy and container `dev` stop on any other version. To try an) is 115 columns.
  • e5ee285f, 602461c3 and f40ebce7 still need back-porting to box-integration-development. Dev (da8df856) still has releaseChecksums and refuseOldShippedNames.

CI at c2e1e8d: verify / Linux fails (the lint error above). verify / Windows, verify / macOS, Analyze, CodeQL and the CodeBuild e2e pass. GitHub's e2e job is skipped. There's no test:package failure, and the known flaky base tests (the Windows transactionSearch EFAULT test and the macOS screen-test 5 s timeouts) did not fire.

Commenting rather than approving only because of the failing lint. Once the unused import is removed and CI is green, this is ready to approve.

@mquang-amazon mquang-amazon changed the title feat(box): Pin box 0.1.11-mquang.preview.9 and run CodeZip agents without the ffi shim fix(box): Ship only the pinned box, and drop the old box/<name> pack-name stop Nov 20, 2026

@leo237 leo237 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.

Re-review of 7f50e90 (last review 5988980916 on c2e1e8d).

What changed. There is one new commit, 7f50e901, which removes import { gte } from "semver"; from boxRelease.test.ts. It is not a rebase: git range-diff shows commits 1-10 unchanged, and the base is still fa212009 (#2866), which c2e1e8d already contained. 7f50e901 exists only on box-integration. It cleans up after the merge that dropped #2866's gte() assertion, and dev's test still uses gte (line 251). When e5ee285f/602461c3/f40ebce7 are back-ported, the assertion and its import should go together.

Earlier comments

  • Addressed: the blocking lint:check failure (unused gte import). verify / Linux now passes lint:check, typecheck and tests (5788 pass, 0 fail).
  • Still open, all non-blocking and unchanged since the last review: e2eTest/README.md:47-51 still says the 3.10-3.13 cases fail until the ffi shim is removed; preview.9 lacks box#537; docs/box-local-testing.md:36 is 115 columns; e5ee285f, 602461c3 and f40ebce7 still need back-porting to dev (da8df856).

Checks

  • Net diff against box-integration: the same 10 files, now +37/-184.
  • Nothing from #2865 or #2866 is lost (publishInstall, BOX_OTHER_MACHINE_HINT, RUNTIME_TELEMETRY_REFUSED, routeKey, withoutUnsentRoutes, boxStartFolder). The fixes from #2845, #2848/#2849, #2850, #2851, #2853 and #2857 that must survive are all still present, with the same occurrence counts as the base.
  • No ffi or SHA256SUMS.txt lookup has come back. The only SHA256SUMS.txt references left are the bump script's (README:219, boxRelease.ts:40), which are accurate.

CI

  • verify / Linux and verify / Windows pass, as do CodeQL, Analyze and the CodeBuild e2e.
  • verify / macOS failed one test, TUI launch > a v0 project shows compatibility mode and repeats migration guidance after exit (a waitFor timeout in src/tui/tui.test.tsx:304). The PR doesn't touch that file. This is the known flaky macOS screen-test timeout: the base run on fa212009 also failed macOS, on a different screen test. Non-blocking.

The one-line change needs no new tests and adds no types or error-handling paths. Approving.

@mquang-amazon
mquang-amazon merged commit 76261f6 into box-integration Nov 20, 2026
10 of 11 checks passed
@mquang-amazon
mquang-amazon deleted the box/mq-8 branch November 20, 2026 07:39
SaiAbhishek98 pushed a commit that referenced this pull request Nov 20, 2026
… and of each leaf

On a CodeZip Runtime, the dependencies are in the code folder, and not
in a venv. When the local profile set its own PYTHONPATH, for example
"${{ workspace }}/app/agent/lib", the derived PYTHONPATH had the ffi
shim and that entry, but not the code folder, so `import strands`
failed when the agent started. Quang found this in the review of
[#2866](#2866).

With this change, the paths rule, after it moves the paths, gives the
PYTHONPATH of [agent], and of each stdio server or tool that runs the
Runtime Python, each entry one time, in its order, and adds
${{ inputs.code.dir }} at the end when the PYTHONPATH does not name it.
For a leaf, the ffi shim comes first; the additions rule puts it first
for [agent]. Two local entries that move to one Runtime path, as the
code folder and its venv do, become one entry.

#2867 removes the ffi shim from these lines. The PR
that merges second keeps the code folder.

Tests: paths.test.ts "keeps the code folder in the PYTHONPATH of
[agent] and of a leaf on the Runtime Python, one time".

(cherry picked from commit fa622c8)
SaiAbhishek98 pushed a commit that referenced this pull request Nov 20, 2026
## Problem

Build downloaded the ffi shim (box-ffi-python3.14, release
0.1.11-linux-preview.2), staged it in `.box-dist/ffi`, and put it first
in the Runtime `PYTHONPATH` of the agent and of each leaf on the Runtime
Python. The shim was necessary because Box Core refused executable
memory on Linux. box 0.1.11-mquang.preview.9 has Box Core 78e752b0, with
[strands-agents/box#488](strands-agents/box#488),
so the Python of the Runtime runs in a box with no shim.

## Solution

This commit has the shim removal of
[#2867](#2867)
([e8069dd](e8069dd)
and [baa1fe0](baa1fe0)),
so that the PR that merges second has a small conflict:

- `boxRelease.json` pins only `box`. `FFI_RELEASE`, its cache, and its
  download go. `bump-box-release.ts` accepts only `--box`.
- `stageBoxCodeZip` stages no `ffi` folder, and `.box-dist` names no
  `ffi` folder.
- The README says what the zip contains with no shim.

The part of e8069dd in `runtimeCodeZipRunner` is not necessary here,
because the derivation gives the Runtime `PYTHONPATH`. The derivation
changes as follows:

- The additions rule adds no shim. An `[agent]` with no `PYTHONPATH`
  gets the code folder on CodeZip.
- The paths rule adds no shim at the start for a leaf. It keeps each entry one
  time, and keeps the code folder at the end of the `PYTHONPATH` of
  `[agent]` and of each leaf on the Runtime Python.

The template tables of `old-renderer-tables.json` are recorded again
from the renderer of #2867 at f40ebce. Only the 102
`PYTHONPATH` values change, to `${{ inputs.code.dir }}`.

## Tests

- additions.test.ts: "keeps a PYTHONPATH of the user as it is, on
  CodeZip and on a container", "gives an [agent] with no PYTHONPATH the
  code folder on CodeZip, and none on a container", and the tests on
  the recorded tables.
- paths.test.ts: "keeps the code folder in the PYTHONPATH of [agent]
  and of a leaf on the Runtime Python, one time", and "ends a leaf's own
  PYTHONPATH with the code folder, and adds none to [agent] or a leaf
  with no Python".
- boxCodeZip.test.ts and boxRelease.test.ts, as in #2867.

Dev port: dev removed the shim in 264da50, so this port keeps the dev
boxRelease.json, boxRelease.ts, boxCodeZip.ts, README, and their tests.
It takes only the change of the rules: no shim, and the code folder at
the end of each Runtime PYTHONPATH. The fixture of this branch has no
shim already.

(cherry picked from commit 6ce7363)
SaiAbhishek98 pushed a commit that referenced this pull request Nov 20, 2026
…hine that it has no build for

## Problem

The CLI pinned box 0.1.11-linux-preview.7. Its Box Core refused
executable memory on Linux, so the ffi shim was necessary for a CodeZip agent. The
previous commit removes the shim. The user selected
[box 0.1.11-mquang.preview.9](https://github.com/mquang-amazon/box-releases/releases/tag/v0.1.11-mquang.preview.9):
staging-boxy b0846169 with
[strands-agents/staging-boxy#549](https://github.com/strands-agents/staging-boxy/pull/549),
on Box Core 78e752b0 with
[strands-agents/box#488](strands-agents/box#488).
It does not have strands-agents/box#537.

That release has only the Linux arm64 build. Each install hint named
only the release page of the pin, so on macOS the hint gave a page with
no build for the machine.

## Solution

- `bun scripts/bump-box-release.ts --box 0.1.11-mquang.preview.9` wrote
  `boxRelease.json` from the SHA256SUMS.txt of the release. The file is
  the same as in
  [3934bbe](3934bbe) of
  [#2867](#2867).
- `BOX_MINIMUM_RELEASE_PAGE` is the release page of
  `BOX_MINIMUM_VERSION` (0.1.11-linux-preview.7), which has a macOS build.
- `BOX_OTHER_MACHINE_HINT` says to use that box, or a subsequent
  release with a build for the machine, when the pinned release has none.
  `BOX_INSTALL_HINT` and each install hint of the profile resolver end
  with it.
- The local box is not compared to the pin. A macOS box
  0.1.11-linux-preview.7 on PATH stays correct for `agentcore dev` and
  for the profile checks of build.
- The README, the guide, and the comment on the tools of `@box/base`
  name the new pin. The packs of preview.9 are the same as the packs of
  preview.7, so `@box/base` has one tool, `uname`.

## Tests

- boxRelease.test.ts: "box is at least the first release that reads the
  profiles the CLI writes" (semver sorts 0.1.11-mquang.preview.9 after
  0.1.11-linux-preview.7), and "the install hint names the pinned
  release, and the first release for a machine it has no build for".
- boxProfileResolver.test.ts: each install hint of the resolver.
- The SHA-256 of the archive that curl downloaded into a new empty
  folder agreed with SHA256SUMS.txt
  (5b0f8802fb1c5cbc22db4bfcefc9061e048e931c972584350ebce6c1b15da884).
  A `diff -r` of the resources of preview.7 and preview.9 found no
  difference.

Dev port: dev pins 0.1.11-mquang.preview.9 already (7de308e), so this
port keeps the dev boxRelease.json and the dev text of the pin. It takes
BOX_MINIMUM_RELEASE_PAGE, BOX_OTHER_MACHINE_HINT, the hints that end
with it, their tests, and the README sentence on the macOS box.

(cherry picked from commit 853a8a5)
SaiAbhishek98 pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 20, 2026
`box-integration` has three new changes: PR 5
([aws#2866](aws#2866)),
the pin of box 0.1.11-mquang.preview.9
([aws#2867](aws#2867)),
and `--containment`
([aws#2854](aws#2854)).
Two files had a merge conflict.

In `create` in `manager.tsx`, `box-integration` gives
`defaultLogTargetNotices`, and this branch gives `boxGatewayLogsWarnings`.
The merge keeps the two.

In the imports of `manager.boxNetwork.test.ts`, `box-integration` removes
`renderRuntimeBoxProfile`, and this branch adds `boxGatewayLogsNotice`.
The merge keeps only `boxGatewayLogsNotice`.

A test of `box-integration` makes sure that `add runtime` gives no
`warning` before the write of agentcore.json. The name of the test is "a
failed write of agentcore.json gives no notice of the default log
target". `addBoxRuntime` gave the logs `warning` before that write, thus
that test showed an error after the merge. The merge moves the logs
`warning` of `add runtime` to after the write, with the
`defaultLogTargetNotices` of `box-integration`. `create` also gives each
`warning` after the write.
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.

5 participants