Skip to content

Commit 5d3628a

Browse files
akhileshbbontalaa
andauthored
Remove /subscribe (#3402)
* Remove /subscribe * Fixing fmt issues --------- Co-authored-by: Akhilesh Bontala <bontalaa@amazon.com>
1 parent d100f64 commit 5d3628a

File tree

6 files changed

+5
-248
lines changed

6 files changed

+5
-248
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub mod persist;
1616
pub mod profile;
1717
pub mod prompts;
1818
pub mod reply;
19-
pub mod subscribe;
19+
2020
pub mod tangent;
2121
pub mod todos;
2222
pub mod tools;
@@ -44,7 +44,6 @@ use tools::ToolsArgs;
4444

4545
use crate::cli::chat::cli::checkpoint::CheckpointSubcommand;
4646
use crate::cli::chat::cli::context::ContextArgs;
47-
use crate::cli::chat::cli::subscribe::SubscribeArgs;
4847
use crate::cli::chat::cli::usage::UsageArgs;
4948
use crate::cli::chat::consts::AGENT_MIGRATION_DOC_URL;
5049
use crate::cli::chat::{
@@ -106,8 +105,7 @@ pub enum SlashCommand {
106105
Model(ModelArgs),
107106
/// Toggle experimental features
108107
Experiment(ExperimentArgs),
109-
/// Upgrade to a Kiro Developer Pro subscription for increased query limits
110-
Subscribe(SubscribeArgs),
108+
111109
/// (Beta) Toggle tangent mode for isolated conversations. Requires "q settings
112110
/// chat.enableTangentMode true"
113111
#[command(hide = true)]
@@ -182,7 +180,7 @@ impl SlashCommand {
182180
Self::Mcp(args) => args.execute(session).await,
183181
Self::Model(args) => args.execute(os, session).await,
184182
Self::Experiment(args) => args.execute(os, session).await,
185-
Self::Subscribe(args) => args.execute(os, session).await,
183+
186184
Self::Tangent(args) => args.execute(os, session).await,
187185
Self::Persist(subcommand) => subcommand.execute(os, session).await,
188186
// Self::Root(subcommand) => {
@@ -221,7 +219,7 @@ impl SlashCommand {
221219
Self::Mcp(_) => "mcp",
222220
Self::Model(_) => "model",
223221
Self::Experiment(_) => "experiment",
224-
Self::Subscribe(_) => "subscribe",
222+
225223
Self::Tangent(_) => "tangent",
226224
Self::Persist(sub) => match sub {
227225
PersistSubcommand::Save { .. } => "save",

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

Lines changed: 0 additions & 150 deletions
This file was deleted.

crates/chat-cli/src/cli/chat/cli/usage/usage_renderer.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ async fn render_available_billing(
5151
style::SetAttribute(style::Attribute::Bold),
5252
style::Print("Usage details\n"),
5353
style::SetAttribute(style::Attribute::Reset),
54-
style::Print("To manage your account, upgrade your plan or configure overages use "),
55-
style::SetForegroundColor(Color::Blue),
56-
style::Print("/subscribe"),
57-
style::SetForegroundColor(Color::Reset),
58-
style::Print(" to open admin hub\n\n"),
54+
style::Print("To manage your account, upgrade your plan or configure overages, visit the admin hub\n\n"),
5955
)?;
6056

6157
// Bonus credits

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

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,40 +3853,6 @@ async fn get_subscription_status(os: &mut Os) -> Result<ActualSubscriptionStatus
38533853
}
38543854
}
38553855

3856-
async fn get_subscription_status_with_spinner(
3857-
os: &mut Os,
3858-
output: &mut (impl Write + Clone + Send + Sync + 'static),
3859-
) -> Result<ActualSubscriptionStatus> {
3860-
return with_spinner(output, "Checking subscription status...", || async {
3861-
get_subscription_status(os).await
3862-
})
3863-
.await;
3864-
}
3865-
3866-
pub async fn with_spinner<T, E, F, Fut, S: std::io::Write + Clone + Send + Sync + 'static>(
3867-
output: &mut S,
3868-
spinner_text: &str,
3869-
f: F,
3870-
) -> Result<T, E>
3871-
where
3872-
F: FnOnce() -> Fut,
3873-
Fut: std::future::Future<Output = Result<T, E>>,
3874-
{
3875-
queue!(output, cursor::Hide,).ok();
3876-
let spinner = Spinner::new(Spinners::Dots, spinner_text.to_owned());
3877-
3878-
let result = f().await;
3879-
3880-
drop(spinner);
3881-
let _ = queue!(
3882-
output,
3883-
terminal::Clear(terminal::ClearType::CurrentLine),
3884-
cursor::MoveToColumn(0),
3885-
);
3886-
3887-
result
3888-
}
3889-
38903856
/// Checks if an input may be referencing a file and should not be handled as a typical slash
38913857
/// command. If true, then return [Option::Some<ChatState>], otherwise [Option::None].
38923858
fn does_input_reference_file(input: &str) -> Option<ChatState> {
@@ -4377,38 +4343,6 @@ mod tests {
43774343
}
43784344
}
43794345

4380-
#[tokio::test]
4381-
#[cfg(unix)]
4382-
async fn test_subscribe_flow() {
4383-
let mut os = Os::new().await.unwrap();
4384-
os.client.set_mock_output(serde_json::Value::Array(vec![]));
4385-
let agents = get_test_agents(&os).await;
4386-
4387-
let tool_manager = ToolManager::default();
4388-
let tool_config = serde_json::from_str::<HashMap<String, ToolSpec>>(include_str!("tools/tool_index.json"))
4389-
.expect("Tools failed to load");
4390-
ChatSession::new(
4391-
&mut os,
4392-
"fake_conv_id",
4393-
agents,
4394-
None,
4395-
InputSource::new_mock(vec!["/subscribe".to_string(), "y".to_string(), "/quit".to_string()]),
4396-
false,
4397-
|| Some(80),
4398-
tool_manager,
4399-
None,
4400-
tool_config,
4401-
true,
4402-
false,
4403-
None,
4404-
)
4405-
.await
4406-
.unwrap()
4407-
.spawn(&mut os)
4408-
.await
4409-
.unwrap();
4410-
}
4411-
44124346
// Integration test for PreToolUse hook functionality.
44134347
//
44144348
// In this integration test we create a preToolUse hook that logs tool info into a file

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ pub const COMMANDS: &[&str] = &[
144144
"/save",
145145
"/load",
146146
"/paste",
147-
"/subscribe",
148147
];
149148

150149
/// Generate dynamic command list including experiment-based commands when enabled

crates/chat-cli/src/constants.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,6 @@ pub mod ui_text {
171171
}
172172
}
173173

174-
/// Subscription-related text constants
175-
pub mod subscription_text {
176-
use super::PRODUCT_NAME;
177-
178-
/// Message for IDC users about subscription management
179-
pub fn idc_subscription_message() -> String {
180-
format!("Your {PRODUCT_NAME} Pro subscription is managed through IAM Identity Center.")
181-
}
182-
183-
/// Message when user doesn't have an active subscription
184-
pub fn no_subscription_message() -> String {
185-
format!("You don't seem to have a {PRODUCT_NAME} Pro subscription.")
186-
}
187-
188-
/// Message when user already has an active subscription
189-
pub fn already_subscribed_message() -> String {
190-
format!("Your Builder ID already has a {PRODUCT_NAME} Pro subscription.")
191-
}
192-
}
193-
194174
/// Context-related text constants
195175
pub mod context_text {
196176
use super::PRODUCT_NAME;

0 commit comments

Comments
 (0)