fix: remove prompt change, read model from config (#5976)
This commit is contained in:
@@ -72,12 +72,7 @@ goose_preexec() {{
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
add-zsh-hook preexec goose_preexec
|
add-zsh-hook preexec goose_preexec{command_not_found_handler}"#,
|
||||||
|
|
||||||
if [[ -z "$GOOSE_PROMPT_INSTALLED" ]]; then
|
|
||||||
export GOOSE_PROMPT_INSTALLED=1
|
|
||||||
PROMPT='%F{{cyan}}🪿%f '$PROMPT
|
|
||||||
fi{command_not_found_handler}"#,
|
|
||||||
command_not_found: Some(
|
command_not_found: Some(
|
||||||
r#"
|
r#"
|
||||||
|
|
||||||
@@ -268,9 +263,10 @@ pub async fn handle_term_info() -> Result<()> {
|
|||||||
let session = SessionManager::get_session(&session_id, false).await.ok();
|
let session = SessionManager::get_session(&session_id, false).await.ok();
|
||||||
let total_tokens = session.as_ref().and_then(|s| s.total_tokens).unwrap_or(0) as usize;
|
let total_tokens = session.as_ref().and_then(|s| s.total_tokens).unwrap_or(0) as usize;
|
||||||
|
|
||||||
let model_name = session
|
let config = goose::config::Config::global();
|
||||||
.as_ref()
|
let model_name = config
|
||||||
.and_then(|s| s.model_config.as_ref().map(|mc| mc.model_name.clone()))
|
.get_goose_model()
|
||||||
|
.ok()
|
||||||
.map(|name| {
|
.map(|name| {
|
||||||
let short = name.rsplit('/').next().unwrap_or(&name);
|
let short = name.rsplit('/').next().unwrap_or(&name);
|
||||||
if let Some(stripped) = short.strip_prefix("goose-") {
|
if let Some(stripped) = short.strip_prefix("goose-") {
|
||||||
@@ -281,9 +277,11 @@ pub async fn handle_term_info() -> Result<()> {
|
|||||||
})
|
})
|
||||||
.unwrap_or_else(|| "?".to_string());
|
.unwrap_or_else(|| "?".to_string());
|
||||||
|
|
||||||
let context_limit = session
|
let context_limit = config
|
||||||
.as_ref()
|
.get_goose_model()
|
||||||
.and_then(|s| s.model_config.as_ref().map(|mc| mc.context_limit()))
|
.ok()
|
||||||
|
.and_then(|model_name| goose::model::ModelConfig::new(&model_name).ok())
|
||||||
|
.map(|mc| mc.context_limit())
|
||||||
.unwrap_or(128_000);
|
.unwrap_or(128_000);
|
||||||
|
|
||||||
let percentage = if context_limit > 0 {
|
let percentage = if context_limit > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user