Skip to content

Commit 9732962

Browse files
committed
fix: keep denied preflight test off the per-message tiktoken rebuild
The test's loop token accounting rebuilt the o200k_base encoder for every counted message, which can exceed the 10s loop timeout on CI runners (ubuntu failed on 4 consecutive commits). Use an Anthropic-family model so counting takes the cheap character heuristic, and give the test its own session id so the per-session tokenizer cache cannot pin another family.
1 parent 216370a commit 9732962

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src-tauri/src/agent/events.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ mod tests {
170170
cancel_map: cancel_map.clone(),
171171
blocked: Mutex::new(None),
172172
};
173-
let settings = json!({"baseUrl":format!("http://{address}"),"model":"gpt-4o-mini","apiKey":"synthetic","proxyMode":"none","tools":[{"type":"function","function":{"name":"sqlkit__execute_ddl","parameters":{"type":"object"}}}],"maxIterations":3});
173+
// An Anthropic-family model keeps token accounting on the cheap
174+
// character heuristic; the OpenAI tiktoken encoders are rebuilt per
175+
// message and can blow the loop timeout on CI runners.
176+
let settings = json!({"baseUrl":format!("http://{address}"),"model":"claude-3-5-haiku","apiKey":"synthetic","proxyMode":"none","tools":[{"type":"function","function":{"name":"sqlkit__execute_ddl","parameters":{"type":"object"}}}],"maxIterations":3});
174177
let result = tokio::time::timeout(
175178
std::time::Duration::from_secs(10),
176179
data_studio_agent::loop_runner::run_agent_loop(

0 commit comments

Comments
 (0)