Skip to content

Commit 92599fc

Browse files
chore: bump version to 1.12.5 (#425)
* chore: bump version to 1.12.5 * fix: /editor and /compact arg parsing * fix: don't include multiline prompts in the chat hint
1 parent b35d642 commit 92599fc

File tree

6 files changed

+89
-83
lines changed

6 files changed

+89
-83
lines changed

Cargo.lock

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ authors = [
1919
edition = "2024"
2020
homepage = "https://aws.amazon.com/q/"
2121
publish = false
22-
version = "1.12.4"
22+
version = "1.12.5"
2323
license = "MIT OR Apache-2.0"
2424

2525
[workspace.dependencies]

crates/chat-cli/src/cli/chat/cli/compact.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To disable this behavior, run: `q settings chat.disableAutoCompaction true`"
3333
)]
3434
pub struct CompactArgs {
3535
/// The prompt to use when generating the summary
36-
prompt: Option<String>,
36+
prompt: Vec<String>,
3737
#[arg(long)]
3838
show_summary: bool,
3939
/// The number of user and assistant message pairs to exclude from the summarization.
@@ -51,8 +51,14 @@ pub struct CompactArgs {
5151
impl CompactArgs {
5252
pub async fn execute(self, os: &Os, session: &mut ChatSession) -> Result<ChatState, ChatError> {
5353
let default = CompactStrategy::default();
54+
let prompt = if self.prompt.is_empty() {
55+
None
56+
} else {
57+
Some(self.prompt.join(" "))
58+
};
59+
5460
session
55-
.compact_history(os, self.prompt, self.show_summary, CompactStrategy {
61+
.compact_history(os, prompt, self.show_summary, CompactStrategy {
5662
messages_to_exclude: self.messages_to_exclude.unwrap_or(default.messages_to_exclude),
5763
truncate_large_messages: self.truncate_large_messages.unwrap_or(default.truncate_large_messages),
5864
max_message_length: self.max_message_length.map_or(default.max_message_length, |v| {

crates/chat-cli/src/cli/chat/cli/editor.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ use crate::cli::chat::{
1616
#[deny(missing_docs)]
1717
#[derive(Debug, PartialEq, Args)]
1818
pub struct EditorArgs {
19-
pub initial_text: Option<String>,
19+
pub initial_text: Vec<String>,
2020
}
2121

2222
impl EditorArgs {
2323
pub async fn execute(self, session: &mut ChatSession) -> Result<ChatState, ChatError> {
24-
let content = match open_editor(self.initial_text) {
24+
let initial_text = if self.initial_text.is_empty() {
25+
None
26+
} else {
27+
Some(self.initial_text.join(" "))
28+
};
29+
30+
let content = match open_editor(initial_text) {
2531
Ok(content) => content,
2632
Err(err) => {
2733
execute!(

0 commit comments

Comments
 (0)