Skip to content

Commit 1f387d7

Browse files
committed
fix(feedback): drop metadata keys not registered on Aperture form template
Bug bash test 2.2 surfaced an HTTP 400 from Aperture: "There is a mismatch between the Form's metadata and the Form-Template's metadata" Root cause: a previous review-fix push added `node-version` and `cli-mode` keys to metadataList, but the published Aperture form template only registers `cli-version` and `os`. Aperture rejects any submission with unrecognized metadata keys. Fix: drop the two unrecognized keys from metadataList. Encode the same context (node version, cli/tui mode) into the `location` field, which is free-form text on Aperture's side. Verified end-to-end through the CLI against prod: agentcore feedback "post-fix CLI submission verification" --json → {"success":true,"id":"211f3041-...","reference":"agentcore-cli"}
1 parent 884a194 commit 1f387d7

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/cli/operations/feedback/__tests__/build-payload.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ describe('buildFeedbackPayload', () => {
77
message: 'CLI ate my homework',
88
cliVersion: '0.1.0-alpha.42',
99
osDescriptor: 'darwin 25.3.0',
10-
nodeVersion: 'v20.20.0',
1110
mode: 'cli',
1211
});
1312

@@ -17,17 +16,19 @@ describe('buildFeedbackPayload', () => {
1716
expect(payload.locale).toBe('en_US');
1817
expect(payload.reference).toBe('agentcore-cli');
1918
expect(payload.location).toContain('agentcore-cli@0.1.0-alpha.42');
19+
expect(payload.location).toContain('cli');
2020
expect(payload.customerResponses).toHaveLength(1);
2121
expect(payload.customerResponses[0]).toMatchObject({
2222
question: 'What feedback do you have for the AgentCore CLI',
2323
pii: false,
2424
response: { responseType: 'textArea', responseValue: 'CLI ate my homework' },
2525
});
26+
// Aperture form template only registers `cli-version` and `os`. Other
27+
// context (node version, mode) lives in `location` until the template
28+
// adds those keys; sending unknown metadata keys is a hard 400.
2629
expect(payload.metadataList).toEqual([
2730
{ key: 'cli-version', value: '0.1.0-alpha.42' },
2831
{ key: 'os', value: 'darwin 25.3.0' },
29-
{ key: 'node-version', value: 'v20.20.0' },
30-
{ key: 'cli-mode', value: 'cli' },
3132
]);
3233
});
3334

src/cli/operations/feedback/build-payload.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import {
77
FEEDBACK_ATTACHMENT_QUESTION,
88
FEEDBACK_MESSAGE_QUESTION,
99
FEEDBACK_REFERENCE,
10-
METADATA_KEY_CLI_MODE,
1110
METADATA_KEY_CLI_VERSION,
12-
METADATA_KEY_NODE_VERSION,
1311
METADATA_KEY_OS,
1412
} from './constants';
1513
import type { ApertureCustomerResponse, ApertureFormPayload, ApertureMetadata, FeedbackMode } from './types';
@@ -21,15 +19,14 @@ interface BuildPayloadInput {
2119
mode?: FeedbackMode;
2220
cliVersion?: string;
2321
osDescriptor?: string;
24-
nodeVersion?: string;
2522
}
2623

2724
export function buildOsDescriptor(): string {
2825
return `${process.platform} ${os.release()}`;
2926
}
3027

3128
export function buildLocationDescriptor(cliVersion: string, mode: FeedbackMode): string {
32-
return `agentcore-cli@${cliVersion} (${process.platform}; ${mode})`;
29+
return `agentcore-cli@${cliVersion} (${process.platform}; node ${process.version}; ${mode})`;
3330
}
3431

3532
export function buildUserAgent(cliVersion: string): string {
@@ -39,7 +36,6 @@ export function buildUserAgent(cliVersion: string): string {
3936
export function buildFeedbackPayload(input: BuildPayloadInput): ApertureFormPayload {
4037
const cliVersion = input.cliVersion ?? PACKAGE_VERSION;
4138
const osDescriptor = input.osDescriptor ?? buildOsDescriptor();
42-
const nodeVersion = input.nodeVersion ?? process.version;
4339
const mode: FeedbackMode = input.mode ?? 'cli';
4440

4541
const customerResponses: ApertureCustomerResponse[] = [
@@ -64,11 +60,12 @@ export function buildFeedbackPayload(input: BuildPayloadInput): ApertureFormPayl
6460
});
6561
}
6662

63+
// Aperture validates metadata keys against the published form template; sending unknown
64+
// keys is rejected with HTTP 400. Only `cli-version` and `os` are registered today.
65+
// node-version and cli-mode are encoded into `location` until the template is updated.
6766
const metadataList: ApertureMetadata[] = [
6867
{ key: METADATA_KEY_CLI_VERSION, value: cliVersion },
6968
{ key: METADATA_KEY_OS, value: osDescriptor },
70-
{ key: METADATA_KEY_NODE_VERSION, value: nodeVersion },
71-
{ key: METADATA_KEY_CLI_MODE, value: mode },
7269
];
7370

7471
return {

src/cli/operations/feedback/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export const FEEDBACK_MESSAGE_QUESTION = 'What feedback do you have for the Agen
1414
export const FEEDBACK_ATTACHMENT_QUESTION = 'Attachments';
1515
export const METADATA_KEY_CLI_VERSION = 'cli-version';
1616
export const METADATA_KEY_OS = 'os';
17-
export const METADATA_KEY_NODE_VERSION = 'node-version';
18-
export const METADATA_KEY_CLI_MODE = 'cli-mode';
1917

2018
export const FEEDBACK_REFERENCE = 'agentcore-cli';
2119

0 commit comments

Comments
 (0)