( effectiveAgentId: string, effectiveMode: "plan" | "exec" | "compact" )
| 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. |
| 96 | export function getLegacyModeForAgentMetadata( |
| 97 | effectiveAgentId: string, |
| 98 | effectiveMode: "plan" | "exec" | "compact" |
| 99 | ): "plan" | "exec" | "compact" | undefined { |
| 100 | return effectiveAgentId === effectiveMode ? effectiveMode : undefined; |
| 101 | } |
| 102 | |
| 103 | function coerceNonEmptyString(value: unknown): string | undefined { |
| 104 | if (typeof value !== "string") { |
no outgoing calls
no test coverage detected