Skip to content

Commit 463f49b

Browse files
committed
fix: keep default identity headers User-Agent-only for product boundary
Default outbound headers stay User-Agent only. Tests that required X-Msh-* on the default path now assert User-Agent instead.
1 parent ffd84d2 commit 463f49b

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

‎packages/agent-gateway/test/boot.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ describe('server-v2 boot', () => {
131131
});
132132
const defaults = server.core.accessor.get(IHostRequestHeaders);
133133
expect(defaults.headers['User-Agent']).toBe('test-host/0.0.0-test');
134-
expect(defaults.headers['X-Msh-Version']).toBe('0.0.0-test');
135-
expect(defaults.headers['X-Msh-Platform']).toBe('test_platform');
136134

137135
await server.close();
138136
server = undefined;

‎packages/node-sdk/test/sdk-rpc-client-v2.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,8 @@ describe('SDKRpcClientV2 (agent-core-v2 wiring)', () => {
352352
// User-Agent and no X-Msh-* the interactive-v2 path's identity bug.
353353
const headers = client.engineAccessor.get(IHostRequestHeaders).headers;
354354
expect(headers['User-Agent']).toBe(`pythinker-code-cli/${TEST_IDENTITY.version}`);
355-
expect(headers['X-Msh-Platform']).toBe('pythinker_code_cli');
356-
expect(headers['X-Msh-Version']).toBe(TEST_IDENTITY.version);
357-
expect(headers['X-Msh-Device-Id']).toBeTruthy();
355+
expect(headers['User-Agent']).toContain('pythinker');
356+
expect(headers['X-Msh-Device-Id']).toBeTruthy();
358357
} finally {
359358
await client.close();
360359
}

‎packages/oauth/src/identity.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,8 @@ export function replaceUserAgentProduct(userAgent: string, product: string): str
104104
* includes only the product User-Agent.
105105
*/
106106
export function createPythinkerDefaultHeaders(options: PythinkerIdentityOptions): Record<string, string> {
107-
const deviceId =
108-
options.deviceId ??
109-
(options.homeDir !== undefined ? createPythinkerDeviceId(options.homeDir) : undefined);
110107
return {
111108
'User-Agent': createPythinkerUserAgent(options),
112-
'X-Msh-Platform': options.platform,
113-
'X-Msh-Version': options.version,
114-
...(deviceId !== undefined ? { 'X-Msh-Device-Id': deviceId } : {}),
115109
};
116110
}
117111

0 commit comments

Comments
 (0)