test(config): cover getOutboundCorrelationPropagateTraceContext defaults

R4 (commit 9bdd3bd6f) added the getter but the test file didn't grow a
corresponding describe block — sibling telemetry getters all have unit
tests but this new one was missed.

Add 4 cases covering the security-relevant default-to-false invariant
and explicit-set behavior:
- omitted outboundCorrelation → false
- empty outboundCorrelation: {} → false (the `?? false` collapse on the
  getter, complementing the same on the constructor)
- explicit true → true
- explicit false → false

PR #4390 review (wenshao).

🤖 Generated with [Qwen Code](https://github.com/QwenLM/qwen-code)
This commit is contained in:
doudouOUC 2026-05-25 14:53:07 +08:00
parent 0be0df270e
commit c0352fd5b5

View file

@ -1655,6 +1655,43 @@ describe('Server Config (config.ts)', () => {
});
});
describe('OutboundCorrelation Configuration', () => {
// Default-to-false is security-relevant — controls whether
// `traceparent` is written onto outbound LLM/fetch request streams.
// PR #4390 R4: keep wire-level toggle out of telemetry namespace.
it('defaults outboundCorrelation.propagateTraceContext to false when outboundCorrelation is omitted', () => {
const config = new Config(baseParams);
expect(config.getOutboundCorrelationPropagateTraceContext()).toBe(false);
});
it('defaults to false when outboundCorrelation is provided as empty object', () => {
const params: ConfigParameters = {
...baseParams,
outboundCorrelation: {},
};
const config = new Config(params);
expect(config.getOutboundCorrelationPropagateTraceContext()).toBe(false);
});
it('honors outboundCorrelation.propagateTraceContext when explicitly set to true', () => {
const params: ConfigParameters = {
...baseParams,
outboundCorrelation: { propagateTraceContext: true },
};
const config = new Config(params);
expect(config.getOutboundCorrelationPropagateTraceContext()).toBe(true);
});
it('honors outboundCorrelation.propagateTraceContext when explicitly set to false', () => {
const params: ConfigParameters = {
...baseParams,
outboundCorrelation: { propagateTraceContext: false },
};
const config = new Config(params);
expect(config.getOutboundCorrelationPropagateTraceContext()).toBe(false);
});
});
describe('UseRipgrep Configuration', () => {
it('should default useRipgrep to true when not provided', () => {
const config = new Config(baseParams);