File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,6 +322,11 @@ function isRecoverableNestedProviderConfig(value) {
322322
323323function collectNestedProviderConfigs ( node , pathPrefix , collector ) {
324324 if ( ! isPlainObject ( node ) ) return ;
325+ const segments = String ( pathPrefix || '' ) . split ( '.' ) ;
326+ const lastSegment = segments . length > 0 ? segments [ segments . length - 1 ] : '' ;
327+ if ( lastSegment === 'metadata' ) {
328+ return ;
329+ }
325330 if ( isRecoverableNestedProviderConfig ( node ) ) {
326331 collector . push ( [ pathPrefix , node ] ) ;
327332 return ;
Original file line number Diff line number Diff line change @@ -562,6 +562,9 @@ module.exports = async function testConfig(ctx) {
562562 assert ( exportProviderNew . payload . baseUrl === updatedUrl , 'export-provider(e2e-api) baseUrl mismatch' ) ;
563563 assert ( exportProviderNew . payload . apiKey === 'sk-e2e-api-upd' , 'export-provider(e2e-api) apiKey mismatch' ) ;
564564
565+ // quotedApiKey is the runtime value used for API update/export round-trip.
566+ // configPath/configAfterQuotedUpdate validates the persisted TOML line where
567+ // quotes/backslashes are escaped for TOML syntax.
565568 const quotedApiKey = 'sk-e2e-"quoted"-\\\\path' ;
566569 const updateProviderQuoted = await api ( 'update-provider' , { name : 'e2e-api' , key : quotedApiKey } ) ;
567570 assert ( updateProviderQuoted . success === true , 'update-provider should handle quoted API key' ) ;
@@ -570,6 +573,8 @@ module.exports = async function testConfig(ctx) {
570573 assert ( exportProviderQuoted . payload . apiKey === quotedApiKey , 'quoted API key should round-trip' ) ;
571574 const configPath = path . join ( tmpHome , '.codex' , 'config.toml' ) ;
572575 const configAfterQuotedUpdate = fs . readFileSync ( configPath , 'utf-8' ) ;
576+ // Expected TOML fragment:
577+ // preferred_auth_method = "sk-e2e-\\\"quoted\\\"-\\\\\\\\path"
573578 assert (
574579 configAfterQuotedUpdate . includes ( 'preferred_auth_method = "sk-e2e-\\"quoted\\"-\\\\\\\\path"' ) ,
575580 'quoted API key should be escaped in config.toml'
You can’t perform that action at this time.
0 commit comments