Never show which AI model writes the analyses
The model name was in the public config, in every analysis response, in /v1/credits, on the packages page and in the example page data. Admins still see it in the prompt trials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -487,8 +487,8 @@ async fn analyses_spend_units_and_reuse_results(pool: PgPool) {
|
||||
let list = app.get(&uri, Some(&anna)).await.body;
|
||||
let summary = &list["analyses"][0];
|
||||
assert_eq!(
|
||||
(summary["kind"].as_str(), summary["status"].as_str(), summary["model"].as_str(), &summary["credits_charged"]),
|
||||
(Some("summary"), Some("pending"), Some("anthropic/claude-summary"), &json!(0))
|
||||
(summary["kind"].as_str(), summary["status"].as_str(), &summary["credits_charged"]),
|
||||
(Some("summary"), Some("pending"), &json!(0))
|
||||
);
|
||||
let r = app.call("POST", &format!("/v1/charts/{}/summary", chart["id"].as_str().unwrap()), Some(&anna), None).await;
|
||||
assert_eq!((r.status, &r.body["id"]), (StatusCode::OK, &summary["id"]));
|
||||
@@ -504,10 +504,18 @@ async fn analyses_spend_units_and_reuse_results(pool: PgPool) {
|
||||
let r = app.call("POST", &uri, Some(&anna), None).await;
|
||||
assert_eq!(r.status, StatusCode::ACCEPTED, "{}", r.body);
|
||||
assert_eq!(
|
||||
(r.body["status"].as_str(), r.body["language"].as_str(), r.body["model"].as_str(), &r.body["credits_charged"]),
|
||||
(Some("pending"), Some("hu"), Some("anthropic/claude-test"), &json!(1))
|
||||
(r.body["status"].as_str(), r.body["language"].as_str(), &r.body["credits_charged"]),
|
||||
(Some("pending"), Some("hu"), &json!(1))
|
||||
);
|
||||
let first = r.body["id"].as_str().unwrap().to_string();
|
||||
// the model is used but never shown to users
|
||||
assert!(r.body.get("model").is_none() && summary.get("model").is_none());
|
||||
let (model,): (String,) = sqlx::query_as("SELECT model FROM analyses WHERE id = $1::uuid")
|
||||
.bind(&first)
|
||||
.fetch_one(&app.pool)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(model, "anthropic/claude-test");
|
||||
assert_eq!(app.get("/v1/credits", Some(&anna)).await.body["balance"], json!({"natal": 1, "synastry": 0}));
|
||||
|
||||
// same request again: the same analysis, no charge
|
||||
@@ -631,8 +639,7 @@ async fn public_config_and_health(pool: PgPool) {
|
||||
assert_eq!(r.body["google_login"]["enabled"], true);
|
||||
assert_eq!(r.body["google_login"]["client_id"], GOOGLE_CLIENT);
|
||||
assert_eq!(r.body["locales"], json!(["hu", "en"]));
|
||||
assert_eq!(r.body["analysis_model"], "anthropic/claude-test");
|
||||
assert_eq!(r.body["summary_model"], "anthropic/claude-summary");
|
||||
assert!(r.body.get("analysis_model").is_none() && r.body.get("summary_model").is_none());
|
||||
assert_eq!(app.get("/healthz", None).await.status, StatusCode::OK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user