fix: /tasks returns structured JSON in resume mode (#341)

/tasks was marked resume_supported but rejected in resume mode.
Now returns a structured JSON response with kind:'tasks' and note
that background tasks are only available in the interactive REPL.

Generated with https://github.com/Yeachan-Heo/gajae-code
Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
bellman
2026-06-05 07:15:36 +09:00
parent e3ffaefba1
commit 6c3d7be370
2 changed files with 18 additions and 2 deletions

View File

@@ -6760,6 +6760,23 @@ fn run_resume_command(
SlashCommand::Session { action, target } => {
run_resumed_session_command(session_path, session, action.as_deref(), target.as_deref())
}
// #341: /tasks is resume-supported — return a no-op with structured JSON
SlashCommand::Tasks { args } => {
let args_str = args.as_deref().unwrap_or_default();
Ok(ResumeCommandOutcome {
session: session.clone(),
message: Some(format!(
"Tasks\n Note Background tasks are only available in the interactive REPL.\n Command /tasks {args_str}"
)),
json: Some(serde_json::json!({
"kind": "tasks",
"action": "list",
"status": "ok",
"note": "Background tasks are only available in the interactive REPL.",
"args": args_str,
})),
})
}
SlashCommand::Bughunter { .. }
| SlashCommand::Commit { .. }
| SlashCommand::Pr { .. }
@@ -6792,7 +6809,6 @@ fn run_resume_command(
| SlashCommand::PrivacySettings
| SlashCommand::Plan { .. }
| SlashCommand::Review { .. }
| SlashCommand::Tasks { .. }
| SlashCommand::Theme { .. }
| SlashCommand::Voice { .. }
| SlashCommand::Usage { .. }