Skip to content

Commit d7f9237

Browse files
committed
Increase token limit and refine deep research prompt handling.
1 parent fbb9104 commit d7f9237

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

refact-agent/engine/src/scratchpads/chat_passthrough.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ fn _adapt_for_reasoning_models(
303303
if supports_boost_reasoning && sampling_parameters.boost_reasoning {
304304
sampling_parameters.reasoning_effort = Some(ReasoningEffort::Medium);
305305
}
306-
sampling_parameters.max_new_tokens = sampling_parameters.max_new_tokens * 2;
306+
if sampling_parameters.max_new_tokens <= 8192 {
307+
sampling_parameters.max_new_tokens = sampling_parameters.max_new_tokens * 2;
308+
}
307309
sampling_parameters.temperature = default_temperature;
308310
messages
309311
},

refact-agent/engine/src/tools/tool_deep_research.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ pub struct ToolDeepResearch {
1414
pub config_path: String,
1515
}
1616

17-
static RESEARCHER_SYSTEM_PROMPT: &str = r#"You are a professional researcher preparing a structured, data-driven report. Your task is to analyze the research question the user poses.
18-
19-
Do:
17+
static RESEARCHER_PROMPT: &str = r#"Do:
2018
- Focus on data-rich insights: include specific figures, trends, statistics, and measurable outcomes.
2119
- When appropriate, summarize data in a way that could be turned into charts or tables, and call this out in the response.
2220
- Prioritize reliable, up-to-date sources: official documentation, peer-reviewed research, reputable technical blogs, and official project repositories.
@@ -25,7 +23,7 @@ Do:
2523
Be analytical, avoid generalities, and ensure that each section supports data-backed reasoning that could inform technical decisions or implementation strategies."#;
2624

2725
static ENTERTAINMENT_MESSAGES: &[&str] = &[
28-
"🔬 Deep research in progress... This may take up to 20 minutes, please be patient!",
26+
"🔬 Deep research in progress... This may take up to 30 minutes, please be patient!",
2927
"🌐 Browsing the web and gathering relevant sources...",
3028
"📚 Reading through documentation and articles...",
3129
"🔍 Cross-referencing information from multiple sources...",
@@ -90,7 +88,7 @@ async fn execute_deep_research(
9088
spawn_entertainment_task(subchat_tx, tool_call_id.clone(), cancel_token.clone());
9189

9290
let messages = vec![
93-
ChatMessage::new("system".to_string(), RESEARCHER_SYSTEM_PROMPT.to_string()),
91+
ChatMessage::new("user".to_string(), RESEARCHER_PROMPT.to_string()),
9492
ChatMessage::new("user".to_string(), research_query.to_string()),
9593
];
9694

refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ subchat_tool_parameters:
337337
deep_research:
338338
subchat_model: "refact/o4-mini-deep-research"
339339
subchat_n_ctx: 200000
340-
subchat_max_new_tokens: 64000
340+
subchat_max_new_tokens: 100000
341341
subchat_reasoning_effort: "medium"
342342
subagent:
343343
subchat_model_type: "light"

0 commit comments

Comments
 (0)