{"record":{"id":"7c9ba9398751f382","repo":"Hmbown/CodeWhale","slug":"client-with-secret-sentinels","errorCode":null,"errorMessage":"client with secret sentinels","messagePattern":"client with secret sentinels","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/client.rs","lineNumber":8346,"sourceCode":"                    ..ProviderConfig::default()\n                },\n                xiaomi_mimo: ProviderConfig {\n                    api_key: Some(CONFIG_SECRET_SENTINELS[5].to_string()),\n                    ..ProviderConfig::default()\n                },\n                zai: ProviderConfig {\n                    api_key: Some(CONFIG_SECRET_SENTINELS[6].to_string()),\n                    ..ProviderConfig::default()\n                },\n                sakana: ProviderConfig {\n                    api_key: Some(CONFIG_SECRET_SENTINELS[7].to_string()),\n                    ..ProviderConfig::default()\n                },\n                ..ProvidersConfig::default()\n            }),\n            ..Config::default()\n        })\n        .expect(\"client with secret sentinels\")\n    }\n\n    fn request_with_tool_result(content: impl Into<String>) -> MessageRequest {\n        MessageRequest {\n            model: \"glm-5.2\".to_string(),\n            messages: vec![\n                Message {\n                    role: Role::Assistant,\n                    content: vec![ContentBlock::ToolUse {\n                        id: \"call-secret-test\".to_string(),\n                        name: \"read_file\".to_string(),\n                        input: json!({\"path\": \"config.toml\"}),\n                        caller: None,\n                        thought_signature: None,\n                    }],\n                },\n                Message {\n                    role: Role::User,","sourceCodeStart":8328,"sourceCodeEnd":8364,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L8328-L8364","documentation":"A panic from `CodewhaleClient::new(Config{...}).expect(\"client with secret sentinels\")` in the helper `client_with_config_secret_sentinels` (crates/tui/src/client.rs). This helper builds a client from an inline Config carrying secret sentinel values (no auth file), so failure means the in-config credential path itself was rejected — invalid provider config, missing fields, or TLS/crypto setup failure.","triggerScenarios":"Calling `client_with_config_secret_sentinels()` from tests like model_bound_request_repairs_dangling_tool_call_before_adapter_projection when Config{provider, providers...} fails validation inside CodewhaleClient::new, or when the rustls ring provider cannot be installed.","commonSituations":"Changes to Config/ProvidersConfig/ProviderConfig required fields after a refactor leave the helper's literal incomplete; rustls provider install racing across parallel tests; API-key validation tightened upstream.","solutions":["Compare the helper's Config literal against the current Config/ProvidersConfig defaults after any struct field changes and fill new required fields.","Confirm the rustls crypto provider install line is present and tolerant of double-install (let _ = ...install_default()).","Read the Err payload by temporarily replacing expect with unwrap_or_else(|e| panic!(\"{e:?}\")) to see which field was rejected.","Run the consuming test singly (--test-threads=1) to rule out provider/env contention."],"exampleFix":"// before\nCodewhaleClient::new(Config { providers: ..., ..Config::default() }).expect(\"client with secret sentinels\")\n// after\nCodewhaleClient::new(Config { providers: ..., ..Config::default() })\n    .unwrap_or_else(|e| panic!(\"client with secret sentinels: {e:?}\"))","handlingStrategy":"validation","validationCode":"// rust: sanity-check the sentinel config before construction\nassert!(!config.provider.as_deref().unwrap_or_default().is_empty(), \"provider unset\");\nlet _ = rustls::crypto::ring::default_provider().install_default();","typeGuard":null,"tryCatchPattern":"CodewhaleClient::new(config).unwrap_or_else(|e| panic!(\"sentinel client: {e:?}\"))","preventionTips":["Build test Configs from ..Config::default()/..ProvidersConfig::default() spread so new required fields surface at compile time.","Re-audit test-helper Config literals after any Config struct refactor.","Install the rustls provider once with an idempotent `let _ =` install.","Surface the construction Err payload for fast diagnosis."],"tags":["rust","client-init","config","test-helper"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T11:17:16.035Z"}