Skip to content

Commit f385e49

Browse files
authored
fix: added summary to tangent and showed correct display label for introspect (#2725)
1 parent 7f79ba3 commit f385e49

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

crates/chat-cli/src/cli/agent/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ impl Agents {
814814
"execute_cmd" => "trust read-only commands".dark_grey(),
815815
"use_aws" => "trust read-only commands".dark_grey(),
816816
"report_issue" => "trusted".dark_green().bold(),
817+
"introspect" => "trusted".dark_green().bold(),
817818
"thinking" => "trusted (prerelease)".dark_green().bold(),
818819
"todo_list" => "trusted".dark_green().bold(),
819820
_ if self.trust_all_tools => "trusted".dark_grey().bold(),

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ struct ConversationCheckpoint {
147147
main_next_message: Option<UserMessage>,
148148
/// Main conversation transcript
149149
main_transcript: VecDeque<String>,
150+
/// Main conversation summary
151+
main_latest_summary: Option<(String, RequestMetadata)>,
150152
/// Timestamp when tangent mode was entered (milliseconds since epoch)
151153
#[serde(default = "time::OffsetDateTime::now_utc")]
152154
tangent_start_time: time::OffsetDateTime,
@@ -240,6 +242,7 @@ impl ConversationState {
240242
main_history: self.history.clone(),
241243
main_next_message: self.next_message.clone(),
242244
main_transcript: self.transcript.clone(),
245+
main_latest_summary: self.latest_summary.clone(),
243246
tangent_start_time: time::OffsetDateTime::now_utc(),
244247
}
245248
}
@@ -249,6 +252,7 @@ impl ConversationState {
249252
self.history = checkpoint.main_history;
250253
self.next_message = checkpoint.main_next_message;
251254
self.transcript = checkpoint.main_transcript;
255+
self.latest_summary = checkpoint.main_latest_summary;
252256
self.valid_history_range = (0, self.history.len());
253257
}
254258

crates/chat-cli/src/cli/chat/tools/introspect.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ impl Introspect {
8181
"\nNOTE: Settings are managed via `q settings` command from terminal, not slash commands in chat.\n",
8282
);
8383

84-
documentation.push_str("\n\n--- GitHub References ---\n");
84+
documentation.push_str("\n\n--- CRITICAL INSTRUCTION ---\n");
85+
documentation.push_str("YOU MUST ONLY provide information that is explicitly documented in the sections above. If specific details about any tool, feature, or command are not documented, you MUST clearly state that the information is not available in the documentation. DO NOT generate plausible-sounding information or make assumptions about undocumented features.\n\n");
86+
87+
documentation.push_str("--- GitHub References ---\n");
8588
documentation.push_str("INSTRUCTION: When your response uses information from any of these documentation files, include the relevant GitHub link(s) at the end:\n");
8689
documentation.push_str("• README.md: https://github.com/aws/amazon-q-developer-cli/blob/main/README.md\n");
8790
documentation.push_str(

crates/chat-cli/src/cli/chat/tools/tool_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"introspect": {
1212
"name": "introspect",
13-
"description": "ALWAYS use this tool when users ask ANY question about Q CLI itself, its capabilities, features, commands, or functionality. This includes questions like 'Can you...', 'Do you have...', 'How do I...', 'What can you do...', or any question about Q's abilities. When mentioning commands in your response, always prefix them with '/' (e.g., '/save', '/load', '/context').",
13+
"description": "ALWAYS use this tool when users ask ANY question about Q CLI itself, its capabilities, features, commands, or functionality. This includes questions like 'Can you...', 'Do you have...', 'How do I...', 'What can you do...', or any question about Q's abilities. When mentioning commands in your response, always prefix them with '/' (e.g., '/save', '/load', '/context'). CRITICAL: Only provide information explicitly documented in Q CLI documentation. If details about any tool, feature, or command are not documented, clearly state the information is not available rather than generating assumptions.",
1414
"input_schema": {
1515
"type": "object",
1616
"properties": {

0 commit comments

Comments
 (0)