MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / compaction

Method compaction

crates/opencode-agent/src/agent.rs:341–365  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

339 }
340
341 pub fn compaction() -> Self {
342 Self {
343 name: "compaction".to_string(),
344 description: Some("Compacts conversation history while preserving context.".to_string()),
345 mode: AgentMode::Subagent,
346 model: None,
347 model_preference: None,
348 system_prompt: Some("You are a context compaction assistant. Summarize the conversation while preserving all important context for future interactions.".to_string()),
349 temperature: Some(0.3),
350 top_p: None,
351 max_tokens: Some(1024),
352 max_steps: Some(1),
353 allowed_tools: Vec::new(),
354 options: HashMap::new(),
355 permission: vec![PermissionRule {
356 permission: "*".to_string(),
357 pattern: "*".to_string(),
358 action: PermissionAction::Deny,
359 }],
360 hidden: true,
361 native: true,
362 variant: None,
363 color: None,
364 }
365 }
366
367 pub fn custom(name: impl Into<String>) -> Self {
368 let name = name.into();

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected