fix: show current session ID in /status (#12607)

Co-authored-by: Douwe Osinga <douwe.osinga@gmail.com>
This commit is contained in:
Placidoe
2026-10-30 19:20:19 +00:00
committed by GitHub
parent 090dedb762
commit c447a5f1f5
5 changed files with 23 additions and 3 deletions
+1 -1
View File
@@ -432,7 +432,7 @@ fn help_text() -> String {
/model [name] - Show the current model, or switch models for this session while keeping the same provider
/model --provider <name> [model] - Switch to a different provider (optionally specifying a model)
/compact - Compact the current conversation to reduce context length while preserving key information.
{additional_builtin_help}/status - Show session status: model, provider, mode, and token usage.
{additional_builtin_help}/status - Show session status: session ID, model, provider, mode, and token usage.
/edit [text] - Open your prompt editor to compose a message. Optionally pre-fill with text.
Uses $GOOSE_PROMPT_EDITOR, $VISUAL, or $EDITOR (in that order).
/skills - List available skills or enable skills by name (usage: /skills [<name>...])
+1 -1
View File
@@ -50,7 +50,7 @@ static COMMANDS: &[CommandDef] = &[
},
CommandDef {
name: "status",
description: "Show session status: model, provider, mode, and token usage",
description: "Show session status: session ID, model, provider, mode, and token usage",
},
];
@@ -60,7 +60,25 @@ impl Operation<Session, GooseEffect> for StatusOperation {
} else {
"N/A".to_string()
};
let response = Message::assistant().with_text(format!("**Session status**\n\n- Model: {}\n- Provider: {}\n- Mode: {}\n- Tokens (lifetime): {}\n- Context: {} / {} tokens ({})", self.model_config.model_name, self.provider.get_name(), session.goose_mode, lifetime_tokens, context_tokens, context_limit, context_pct)).with_visibility(true, false);
let response = Message::assistant()
.with_text(format!(
"**Session status**\n\n\
- Session ID: `{}`\n\
- Model: {}\n\
- Provider: {}\n\
- Mode: {}\n\
- Tokens (lifetime): {}\n\
- Context: {} / {} tokens ({})",
session.id,
self.model_config.model_name,
self.provider.get_name(),
session.goose_mode,
lifetime_tokens,
context_tokens,
context_limit,
context_pct,
))
.with_visibility(true, false);
let command_message = messages_since_kickoff(conversation)?
.first()
.cloned()
@@ -514,6 +514,7 @@ async fn slash_commands_yield_or_fall_through_to_inference() -> Result<()> {
let status = pipeline.run(["/status"]).await?;
assert_eq!(api.call_count(), 0);
status.assert_message(-1, Agent, &format!("Session ID: `{}`", pipeline.session_id));
status.assert_message(-1, Agent, "Provider:");
assert!(status
.conversation()
@@ -828,6 +828,7 @@ Once you're in an interactive session (via `goose session` or `goose run --inter
- **`/compact`** - Compact and summarize the current conversation to reduce context length while preserving key information
- **`/r`** - Toggle full tool output display (show complete tool parameters without truncation)
- **`/skills [<name>...]`** - List available skills, or load one or more skills by name
- **`/status`** - Show the current session ID, model, provider, mode, and token usage. Use the ID to resume the same session in another client, or with `goose session --resume --session-id <session_id>` in the CLI.
- **`/t`** - Toggle between `light`, `dark`, and `ansi` themes. [More info](#themes).
- **`/t <name>`** - Set theme directly (light, dark, ansi)