mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-12 19:14:51 +08:00
Remove the deprecated Claude subscription login path and restore a green Rust workspace
ROADMAP #37 was still open even though several earlier backlog items were already closed. This change removes the local login/logout surface, stops startup auth resolution from treating saved OAuth credentials as a supported path, and updates diagnostics/help to point users at ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN only. While proving the change with the user-requested workspace gates, clippy surfaced additional pre-existing warning failures across the Rust workspace. Those were cleaned up in-place so the required `cargo fmt`, `cargo clippy --workspace --all-targets -- -D warnings`, and `cargo test --workspace` sequence now passes end to end. Constraint: User explicitly required full-workspace fmt/clippy/test before commit/push Constraint: Existing dirty leader worktree had to be stashed before attempted OMX team worktree launch Rejected: Keep login/logout but hide them from help | left unsupported auth flow and saved OAuth fallback intact Rejected: Stop after ROADMAP #37 targeted tests | did not satisfy required full-workspace verification gate Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Do not reintroduce saved OAuth as a silent Anthropic startup fallback without an explicit supported auth policy Tested: cargo fmt --all --check; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: Remote push effects beyond origin/main update
This commit is contained in:
@@ -257,20 +257,6 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[
|
||||
argument_hint: None,
|
||||
resume_supported: true,
|
||||
},
|
||||
SlashCommandSpec {
|
||||
name: "login",
|
||||
aliases: &[],
|
||||
summary: "Log in to the service",
|
||||
argument_hint: None,
|
||||
resume_supported: false,
|
||||
},
|
||||
SlashCommandSpec {
|
||||
name: "logout",
|
||||
aliases: &[],
|
||||
summary: "Log out of the current session",
|
||||
argument_hint: None,
|
||||
resume_supported: false,
|
||||
},
|
||||
SlashCommandSpec {
|
||||
name: "plan",
|
||||
aliases: &[],
|
||||
@@ -1291,7 +1277,6 @@ impl SlashCommand {
|
||||
Self::Tag { .. } => "/tag",
|
||||
Self::OutputStyle { .. } => "/output-style",
|
||||
Self::AddDir { .. } => "/add-dir",
|
||||
Self::Unknown(_) => "/unknown",
|
||||
Self::Sandbox => "/sandbox",
|
||||
Self::Mcp { .. } => "/mcp",
|
||||
Self::Export { .. } => "/export",
|
||||
@@ -1402,13 +1387,12 @@ pub fn validate_slash_command_input(
|
||||
validate_no_args(command, &args)?;
|
||||
SlashCommand::Doctor
|
||||
}
|
||||
"login" => {
|
||||
validate_no_args(command, &args)?;
|
||||
SlashCommand::Login
|
||||
}
|
||||
"logout" => {
|
||||
validate_no_args(command, &args)?;
|
||||
SlashCommand::Logout
|
||||
"login" | "logout" => {
|
||||
return Err(command_error(
|
||||
"This auth flow was removed. Set ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN instead.",
|
||||
command,
|
||||
"",
|
||||
));
|
||||
}
|
||||
"vim" => {
|
||||
validate_no_args(command, &args)?;
|
||||
@@ -1893,20 +1877,12 @@ pub fn resume_supported_slash_commands() -> Vec<&'static SlashCommandSpec> {
|
||||
|
||||
fn slash_command_category(name: &str) -> &'static str {
|
||||
match name {
|
||||
"help" | "status" | "cost" | "resume" | "session" | "version" | "login" | "logout"
|
||||
| "usage" | "stats" | "rename" | "clear" | "compact" | "history" | "tokens" | "cache"
|
||||
| "exit" | "summary" | "tag" | "thinkback" | "copy" | "share" | "feedback" | "rewind"
|
||||
| "pin" | "unpin" | "bookmarks" | "context" | "files" | "focus" | "unfocus" | "retry"
|
||||
| "stop" | "undo" => "Session",
|
||||
"diff" | "commit" | "pr" | "issue" | "branch" | "blame" | "log" | "git" | "stash"
|
||||
| "init" | "export" | "plan" | "review" | "security-review" | "bughunter" | "ultraplan"
|
||||
| "teleport" | "refactor" | "fix" | "autofix" | "explain" | "docs" | "perf" | "search"
|
||||
| "references" | "definition" | "hover" | "symbols" | "map" | "web" | "image"
|
||||
| "screenshot" | "paste" | "listen" | "speak" | "test" | "lint" | "build" | "run"
|
||||
| "format" | "parallel" | "multi" | "macro" | "alias" | "templates" | "migrate"
|
||||
| "benchmark" | "cron" | "agent" | "subagent" | "agents" | "skills" | "team" | "plugin"
|
||||
| "mcp" | "hooks" | "tasks" | "advisor" | "insights" | "release-notes" | "chat"
|
||||
| "approve" | "deny" | "allowed-tools" | "add-dir" => "Tools",
|
||||
"help" | "status" | "cost" | "resume" | "session" | "version" | "usage" | "stats"
|
||||
| "rename" | "clear" | "compact" | "history" | "tokens" | "cache" | "exit" | "summary"
|
||||
| "tag" | "thinkback" | "copy" | "share" | "feedback" | "rewind" | "pin" | "unpin"
|
||||
| "bookmarks" | "context" | "files" | "focus" | "unfocus" | "retry" | "stop" | "undo" => {
|
||||
"Session"
|
||||
}
|
||||
"model" | "permissions" | "config" | "memory" | "theme" | "vim" | "voice" | "color"
|
||||
| "effort" | "fast" | "brief" | "output-style" | "keybindings" | "privacy-settings"
|
||||
| "stickers" | "language" | "profile" | "max-tokens" | "temperature" | "system-prompt"
|
||||
@@ -2477,7 +2453,8 @@ pub fn resolve_skill_invocation(
|
||||
.map(|s| s.name.clone())
|
||||
.collect();
|
||||
if !names.is_empty() {
|
||||
message.push_str(&format!("\n Available skills: {}", names.join(", ")));
|
||||
message.push_str("\n Available skills: ");
|
||||
message.push_str(&names.join(", "));
|
||||
}
|
||||
}
|
||||
message.push_str("\n Usage: /skills [list|install <path>|help|<skill> [args]]");
|
||||
@@ -2699,7 +2676,7 @@ pub fn render_plugins_report_with_failures(
|
||||
|
||||
// Show warnings for broken plugins
|
||||
if !failures.is_empty() {
|
||||
lines.push("".to_string());
|
||||
lines.push(String::new());
|
||||
lines.push("Warnings:".to_string());
|
||||
for failure in failures {
|
||||
lines.push(format!(
|
||||
@@ -4598,6 +4575,14 @@ mod tests {
|
||||
assert!(action_error.contains(" Usage /mcp [list|show <server>|help]"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn removed_login_and_logout_commands_report_env_auth_guidance() {
|
||||
let login_error = parse_error_message("/login");
|
||||
assert!(login_error.contains("ANTHROPIC_API_KEY"));
|
||||
let logout_error = parse_error_message("/logout");
|
||||
assert!(logout_error.contains("ANTHROPIC_AUTH_TOKEN"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn renders_help_from_shared_specs() {
|
||||
let help = render_slash_command_help();
|
||||
@@ -4639,7 +4624,9 @@ mod tests {
|
||||
assert!(help.contains("/agents [list|help]"));
|
||||
assert!(help.contains("/skills [list|install <path>|help|<skill> [args]]"));
|
||||
assert!(help.contains("aliases: /skill"));
|
||||
assert_eq!(slash_command_specs().len(), 141);
|
||||
assert!(!help.contains("/login"));
|
||||
assert!(!help.contains("/logout"));
|
||||
assert_eq!(slash_command_specs().len(), 139);
|
||||
assert!(resume_supported_slash_commands().len() >= 39);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user