-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add configurable per-profile context window setting #9352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ use crate::{ | |
|
|
||
| use super::{AIAgentInput, MCPContext, MCPServer, RequestMetadata, Suggestions}; | ||
| use crate::ai::blocklist::{BlocklistAIPermissions, RequestInput}; | ||
| use crate::ai::execution_profiles::profiles::AIExecutionProfilesModel; | ||
| use crate::ai::mcp::templatable_manager::TemplatableMCPServerInfo; | ||
| use crate::ai::mcp::TemplatableMCPServerManager; | ||
| use crate::settings::AISettings; | ||
|
|
@@ -109,6 +110,7 @@ pub struct RequestParams { | |
| pub computer_use_model: LLMId, | ||
| pub is_memory_enabled: bool, | ||
| pub warp_drive_context_enabled: bool, | ||
| pub context_window_limit: Option<u32>, | ||
| pub mcp_context: Option<MCPContext>, | ||
| pub planning_enabled: bool, | ||
| should_redact_secrets: bool, | ||
|
|
@@ -279,13 +281,19 @@ impl RequestParams { | |
| .as_ref() | ||
| .is_none_or(|t| matches!(t, crate::terminal::model::session::SessionType::Local)); | ||
|
|
||
| let context_window_limit = AIExecutionProfilesModel::as_ref(app) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .active_profile(terminal_view_id, app) | ||
| .data() | ||
| .context_window_limit; | ||
|
coolcom200 marked this conversation as resolved.
|
||
|
|
||
| Self { | ||
| input: request_input.all_inputs().cloned().collect(), | ||
| conversation_token: conversation.server_conversation_token, | ||
| forked_from_conversation_token: conversation.forked_from_conversation_token, | ||
| ambient_agent_task_id: conversation.ambient_agent_task_id, | ||
| tasks: conversation.tasks, | ||
| existing_suggestions: conversation.existing_suggestions, | ||
| context_window_limit, | ||
| metadata, | ||
| session_context, | ||
| model: request_input.model_id.clone(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u32 makes sense. this is coming from the server so we need it to explicitly be 32-bit rather than machine-dependent (usize).