mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 23:32:12 +03:00
fix(providers): copilot-m365-web enterprise turns send disconnectBehavior=continue (#8971)
This commit is contained in:
committed by
GitHub
parent
eaea0347ac
commit
d502f144b9
1
changelog.d/fixes/8971-fix.plan.md
Normal file
1
changelog.d/fixes/8971-fix.plan.md
Normal file
@@ -0,0 +1 @@
|
||||
- fix(providers): copilot-m365-web enterprise turns send disconnectBehavior=continue (#8971)
|
||||
@@ -166,6 +166,13 @@ export interface ChatInvocationOptions {
|
||||
tone?: string;
|
||||
/** Tier-specific allowed message types; defaults to {@link ALLOWED_MESSAGE_TYPES}. */
|
||||
allowedMessageTypes?: readonly string[];
|
||||
/**
|
||||
* Tier-specific disconnect behavior sent in every type:4 chat invocation. The work
|
||||
* Surface rejects any value other than exactly "continue" (#8971). Defaults to ""
|
||||
* for individual/consumer/EDU tiers; {@link resolveChatInvocationOverrides} returns
|
||||
* "continue" for the enterprise tier.
|
||||
*/
|
||||
disconnectBehavior?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,18 +185,21 @@ export function resolveChatInvocationOverrides(tier: string | undefined): {
|
||||
optionsSets: string[];
|
||||
tone: string;
|
||||
allowedMessageTypes: readonly string[];
|
||||
disconnectBehavior: string;
|
||||
} {
|
||||
if (tier === "enterprise") {
|
||||
return {
|
||||
optionsSets: [...M365_ENTERPRISE_OPTION_SETS],
|
||||
tone: "Magic",
|
||||
allowedMessageTypes: [...ALLOWED_MESSAGE_TYPES, ...M365_ENTERPRISE_EXTRA_MESSAGE_TYPES],
|
||||
disconnectBehavior: "continue",
|
||||
};
|
||||
}
|
||||
return {
|
||||
optionsSets: [...M365_DEFAULT_OPTION_SETS],
|
||||
tone: "",
|
||||
allowedMessageTypes: ALLOWED_MESSAGE_TYPES,
|
||||
disconnectBehavior: "",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -253,7 +263,7 @@ export function buildChatInvocation(opts: ChatInvocationOptions): Record<string,
|
||||
isSbsSupported: false,
|
||||
tone: opts.tone ?? "",
|
||||
renderReferencesBehindEOS: true,
|
||||
disconnectBehavior: "",
|
||||
disconnectBehavior: opts.disconnectBehavior ?? "",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -158,3 +158,21 @@ test("#7870: EDU-tier chat invocation payload stays byte-identical to today (una
|
||||
assert.ok(optionsSets.includes("enable_msa_user"));
|
||||
assert.equal(invocationArgs.tone, "");
|
||||
});
|
||||
|
||||
test("#8971: enterprise-tier chat invocation must send disconnectBehavior=continue", async () => {
|
||||
const invocationArgs = await sendChatInvocation("enterprise");
|
||||
assert.equal(
|
||||
invocationArgs.disconnectBehavior,
|
||||
"continue",
|
||||
`enterprise-tier invocation must carry disconnectBehavior="continue"; got ${JSON.stringify(invocationArgs.disconnectBehavior)}`
|
||||
);
|
||||
});
|
||||
|
||||
test("#8971: individual (no tier) chat invocation disconnectBehavior remains empty (byte-identical to #4042)", async () => {
|
||||
const invocationArgs = await sendChatInvocation(undefined);
|
||||
assert.equal(
|
||||
invocationArgs.disconnectBehavior,
|
||||
"",
|
||||
`individual-tier invocation must carry disconnectBehavior=""; got ${JSON.stringify(invocationArgs.disconnectBehavior)}`
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user