MCPcopy
hub / github.com/coder/mux / getLegacyModeForAgentMetadata

Function getLegacyModeForAgentMetadata

src/node/services/agentResolution.ts:96–101  ·  view source on GitHub ↗
(
  effectiveAgentId: string,
  effectiveMode: "plan" | "exec" | "compact"
)

Source from the content-addressed store, hash-verified

94// Derived agents (for example Explore, which uses Exec as its tool-policy base) should not
95// be labeled as their base mode in persisted/public metadata; `agentId` is the source of truth.
96export function getLegacyModeForAgentMetadata(
97 effectiveAgentId: string,
98 effectiveMode: "plan" | "exec" | "compact"
99): "plan" | "exec" | "compact" | undefined {
100 return effectiveAgentId === effectiveMode ? effectiveMode : undefined;
101}
102
103function coerceNonEmptyString(value: unknown): string | undefined {
104 if (typeof value !== "string") {

Callers 2

streamMessageMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected