Repository navigation
fix(box): Show the cause and the correct step when build stops for a third-party telemetry target that it does not carry - #2919
Conversation
… the Runtime This commit holds five commits of box-integration-development, resolved against box-integration: 7ad00c3, 212d17f, 96cc734, 3ad5f5c, and 71801df. Deploy writes the key of each third-party telemetry target (otlp, langfuse, langsmith) into one AWS Secrets Manager secret for each runtime, agentcore/<project>/<runtime>/box, outside the stack. The Runtime profile gets plugins = ["@box/aws-secrets-manager"] and an aws-secretsmanager:// reference for each target. The execution role gets secretsmanager:GetSecretValue on that secret only. The container image installs the AWS CLI after a signature check, because the plugin runs aws.
…er, and remove the AGENTCORE_BOX_SECRETS_MANAGER switch
…arn that its VPC has no path to the host, and ask the L3 for an AWS Secrets Manager endpoint
… box under agentcore dev
…n OTLP endpoint on AgentCore Runtime
…emetry build test The step message names ENV_LOCAL_RELATIVE_PATH, which has a backslash on Windows. The test now expects that constant, as the other tests in this file do.
…me kind have different secret fields and Runtime profile refs
…third-party telemetry target that it does not carry
## Problem
For a CodeZip runtime, `agentcore build` stops for a `langfuse`, `langsmith`, or `otlp` telemetry
target. The stop message tells the customer to read the warning for that target. Build does not
show that warning. Thus, the customer cannot find the cause, or the change that removes the stop.
## Solution
The Box network model gives each telemetry target that build does not put in the Runtime profile,
with its cause and its correct step. The check that stops build (`notCloudWatch` in
`refusals.ts`) shows this cause and this step in the stop message. For a CodeZip runtime, the
message is:
[telemetry.langfuse] kind is "langfuse", and build cannot carry it to AgentCore Runtime: Box
reads its key on AgentCore Runtime with the AWS CLI, which a CodeZip runtime does not have. Use
a container runtime, remove [telemetry.langfuse], or change its kind to "cloudwatch_logs" or
"cloudwatch_traces".
The four other causes also show their own text: a value that build cannot move to the Runtime
profile, a `secret.ref` that is not `env://` or `secret://`, a target name that cannot be the
name of an environment variable, and a deploy variable that a different target reads.
## Tests
- `network.test.ts`, "stops build with the reason the model leaves a target out, as the stop
prints it": the CodeZip cause, the Secrets Manager cause, and a value that build cannot move.
"no stop for a target that the model carries" makes sure that build does not stop for a target
in the Runtime profile.
- `refusals.test.ts`, "states the reason and the step the Box network model gives when it leaves
the target out", and "names no warning when the model gives no reason".
- `manager.boxNetwork.test.ts`: the warning text that this change rewrites.
- Typecheck, lint, format, and the full `bun test` suite have no errors.
No deploy test: build stops before deploy for these targets.
leo237
left a comment
There was a problem hiding this comment.
Reviewed cf42b55 only, as the description asks. Apart from the commit message, its patch is the same as 52e61a1, which I reviewed and approved on #2917. There I checked that every left-out target reaches the stop with its cause, that the fixes for the CodeZip, ref, name, and collision causes are correct, and that mutations of the cause-plumbing fail tests. Those 599 touched tests passed, along with typecheck and oxlint.
The same two nits from that review apply here, inline. Neither blocks.
| if (uncopied.length > 0) { | ||
| leftOut.push({ | ||
| name, | ||
| reason: `Box resolves its \`${uncopied[0]}\` to a value build cannot copy`, |
There was a problem hiding this comment.
nit: this is the only cause with no fix, but there is a step: give the key a string, a list of strings, or a table of strings (what copiedValue accepts). Something like fix: `Give \`${uncopied[0]}\` a string, a list of strings, or a table of strings` would do. Then the test title at network.test.ts:1718 ("has no step but to remove it") and the fix doc comment ("absent means no such step") should change too.
| ]); | ||
| }); | ||
|
|
||
| test("a target with a value build cannot copy, which has no step but to remove it", () => { |
There was a problem hiding this comment.
nit: the PR comment says each case goes through buildBoxNetwork, but this block covers 3 of the 5 causes. The bad target name (telemetry.ts) and the variable collision (network.ts) are checked only through their warnings. Two more stopOf cases would also pin their "Rename the target, remove ..." text.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## box-integration #2919 +/- ##
=================================================
Coverage 96.89% 96.90%
=================================================
Files 776 778 +2
Lines 69346 69954 +608
=================================================
+ Hits 67194 67788 +594
- Misses 2152 2166 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
This pull request is on top of aws/agentcore-cli#2917. Review only the last commit, cf42b555. The other commits are the commits of #2917. After #2917 merges, I rebase this branch onto
box-integration, and then the diff shows only this change.Problem. For a CodeZip runtime,
agentcore buildstops for alangfuse,langsmith, orotlptelemetry target. The stop message tells the customer to read the warning for that target. Build does not show that warning. Thus, the customer cannot find the cause, or the change that removes the stop.Before:
After:
Solution. The Box network model gives each telemetry target that build does not put in the Runtime profile, with its cause and its correct step. The check that stops build (
notCloudWatchinrefusals.ts) shows this cause and this step in the stop message. The four other causes also show their own text: a value that build cannot move to the Runtime profile, asecret.refthat is notenv://orsecret://, a target name that cannot be the name of an environment variable, and a deploy variable that a different target reads.The behaviour does not change. Build stops for the same targets as before. Only the text changes.
Related Issue
No issue. This change is part of the Box on AgentCore integration.
Documentation PR
Not applicable. The change is in the text of a stop message only.
Type of Change
Testing
bun testbun run test:e2e: not applicable, because build stops before deploy for these targetsbun run typecheckbun run lint:checkbun run format:checkbun run buildThe tests that check the text:
network.test.ts, "stops build with the reason the model leaves a target out, as the stop prints it": the CodeZip cause, the Secrets Manager cause, and a value that build cannot move.refusals.test.ts, "states the reason and the step the Box network model gives when it leaves the target out", and "names no warning when the model gives no reason".manager.boxNetwork.test.ts: the warning text that this change rewrites.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.