Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bt-daemon/tests/support/agents/claude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ impl ClaudeAgent {
])
.arg(plugin)
.current_dir(world.workspace())
.env("ANTHROPIC_MAX_RETRIES", "0")
.env("CLAUDE_CODE_MAX_RETRIES", "0")
.env("ENABLE_TOOL_SEARCH", "false")
.env("DISABLE_AUTOUPDATER", "1")
.env("DISABLE_TELEMETRY", "1")
.env("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "1");
Expand Down
6 changes: 3 additions & 3 deletions bt-daemon/tests/support/inference/anthropic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{decode_json_body, json_response, raw_response, sse, MockReply, RequestContext};
use super::{decode_json_body, error_response, raw_response, sse, MockReply, RequestContext};
use axum::body::Bytes;
use axum::extract::State;
use axum::http::{HeaderMap, StatusCode};
Expand Down Expand Up @@ -228,7 +228,7 @@ async fn messages(
) -> axum::response::Response {
let body = match decode_json_body(&headers, &body) {
Ok(body) => body,
Err(error) => return json_response(StatusCode::BAD_REQUEST, json!({"error": error})),
Err(error) => return error_response(StatusCode::BAD_REQUEST, json!({"error": error})),
};
let request = AnthropicRequest { body };
state
Expand All @@ -248,7 +248,7 @@ async fn messages(
"text/event-stream",
sse(&turn.events(index)),
),
MockReply::HttpError { status, body } => json_response(status, body),
MockReply::HttpError { status, body } => error_response(status, body),
MockReply::Raw {
status,
content_type,
Expand Down
5 changes: 5 additions & 0 deletions bt-daemon/tests/support/inference/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ fn json_response(status: StatusCode, body: Value) -> axum::response::Response {
(status, axum::Json(body)).into_response()
}

fn error_response(status: StatusCode, body: Value) -> axum::response::Response {
use axum::response::IntoResponse;
(status, [("x-should-retry", "false")], axum::Json(body)).into_response()
}

fn raw_response(
status: StatusCode,
content_type: &'static str,
Expand Down
Loading