Compare commits

..

3 Commits

Author SHA1 Message Date
YeonGyu-Kim 11a6e081a2 fix(#458): add status field to export and diff JSON envelopes 2026-05-25 16:07:16 +09:00
Bellman 16604a111b fix(#458): add status assertions to skills/agents JSON envelope tests
Adds test coverage asserting status:ok in skills list, agents list, skills install, skills help, and agents help JSON envelopes. Status fields themselves were already landed in 0581894b and cc1462a7; this PR adds the regression test assertions that were missing. Duplicate status keys in json! macros are benign (serde_json takes last value) but harmless given all tests pass.
2026-05-25 15:35:40 +09:00
YeonGyu-Kim cc1462a7f8 fix(#458): add status:ok to skills install JSON envelope (missed in previous sweep) 2026-05-25 15:30:22 +09:00
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -3745,6 +3745,7 @@ fn render_skill_install_report(skill: &InstalledSkill) -> String {
fn render_skill_install_report_json(skill: &InstalledSkill) -> Value {
json!({
"kind": "skills",
"status": "ok",
"action": "install",
"status": "ok",
"result": "installed",
+5
View File
@@ -4113,6 +4113,7 @@ fn run_resume_command(
)),
json: Some(serde_json::json!({
"kind": "export",
"status": "ok",
"file": export_path.display().to_string(),
"message_count": msg_count,
})),
@@ -7560,6 +7561,7 @@ fn render_diff_json_for(cwd: &Path) -> Result<serde_json::Value, Box<dyn std::er
if !in_git_repo {
return Ok(serde_json::json!({
"kind": "diff",
"status": "error",
"result": "no_git_repo",
"detail": format!("{} is not inside a git project", cwd.display()),
}));
@@ -7568,6 +7570,7 @@ fn render_diff_json_for(cwd: &Path) -> Result<serde_json::Value, Box<dyn std::er
let unstaged = run_git_diff_command_in(cwd, &["diff"])?;
Ok(serde_json::json!({
"kind": "diff",
"status": "ok",
"result": if staged.trim().is_empty() && unstaged.trim().is_empty() { "clean" } else { "changes" },
"staged": staged.trim(),
"unstaged": unstaged.trim(),
@@ -8090,6 +8093,7 @@ fn run_export(
"{}",
serde_json::to_string_pretty(&json!({
"kind": "export",
"status": "ok",
"message": report,
"session_id": handle.id,
"file": path.display().to_string(),
@@ -8111,6 +8115,7 @@ fn run_export(
"{}",
serde_json::to_string_pretty(&json!({
"kind": "export",
"status": "ok",
"session_id": handle.id,
"file": handle.path.display().to_string(),
"messages": session.messages.len(),