mirror of
https://github.com/instructkr/claw-code.git
synced 2026-06-14 15:26:05 -04:00
Compare commits
1 Commits
fix/resume
...
bee6a63a54
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bee6a63a54 |
@@ -3526,10 +3526,10 @@ fn run_resume_command(
|
|||||||
Ok(ResumeCommandOutcome {
|
Ok(ResumeCommandOutcome {
|
||||||
session: session.clone(),
|
session: session.clone(),
|
||||||
message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?),
|
message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?),
|
||||||
json: Some(
|
json: Some(serde_json::json!({
|
||||||
serde_json::to_value(handle_agents_slash_command_json(args.as_deref(), &cwd)?)
|
"kind": "agents",
|
||||||
.unwrap_or_else(|_| serde_json::json!(null)),
|
"text": handle_agents_slash_command(args.as_deref(), &cwd)?,
|
||||||
),
|
})),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
SlashCommand::Skills { args } => {
|
SlashCommand::Skills { args } => {
|
||||||
|
|||||||
@@ -369,34 +369,6 @@ fn resumed_inventory_commands_emit_structured_json_when_requested() {
|
|||||||
assert_eq!(skills["action"], "list");
|
assert_eq!(skills["action"], "list");
|
||||||
assert!(skills["summary"]["total"].is_number());
|
assert!(skills["summary"]["total"].is_number());
|
||||||
assert!(skills["skills"].is_array());
|
assert!(skills["skills"].is_array());
|
||||||
|
|
||||||
let agents = assert_json_command_with_env(
|
|
||||||
&root,
|
|
||||||
&[
|
|
||||||
"--output-format",
|
|
||||||
"json",
|
|
||||||
"--resume",
|
|
||||||
session_path.to_str().expect("utf8 session path"),
|
|
||||||
"/agents",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
(
|
|
||||||
"CLAW_CONFIG_HOME",
|
|
||||||
config_home.to_str().expect("utf8 config home"),
|
|
||||||
),
|
|
||||||
("HOME", home.to_str().expect("utf8 home")),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
assert_eq!(agents["kind"], "agents");
|
|
||||||
assert_eq!(agents["action"], "list");
|
|
||||||
assert!(
|
|
||||||
agents["agents"].is_array(),
|
|
||||||
"agents field must be a JSON array"
|
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
agents["count"].is_number(),
|
|
||||||
"count must be a number, not a text render"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -227,8 +227,6 @@ fn resumed_status_command_emits_structured_json_when_requested() {
|
|||||||
// given
|
// given
|
||||||
let temp_dir = unique_temp_dir("resume-status-json");
|
let temp_dir = unique_temp_dir("resume-status-json");
|
||||||
fs::create_dir_all(&temp_dir).expect("temp dir should exist");
|
fs::create_dir_all(&temp_dir).expect("temp dir should exist");
|
||||||
let config_home = temp_dir.join("config-home");
|
|
||||||
fs::create_dir_all(&config_home).expect("isolated config home should exist");
|
|
||||||
let session_path = temp_dir.join("session.jsonl");
|
let session_path = temp_dir.join("session.jsonl");
|
||||||
|
|
||||||
let mut session = workspace_session(&temp_dir);
|
let mut session = workspace_session(&temp_dir);
|
||||||
@@ -240,9 +238,7 @@ fn resumed_status_command_emits_structured_json_when_requested() {
|
|||||||
.expect("session should persist");
|
.expect("session should persist");
|
||||||
|
|
||||||
// when
|
// when
|
||||||
// Use an isolated CLAW_CONFIG_HOME so ~/.claw/settings.json is not loaded,
|
let output = run_claw(
|
||||||
// which would cause loaded_config_files to be non-zero (#65).
|
|
||||||
let output = run_claw_with_env(
|
|
||||||
&temp_dir,
|
&temp_dir,
|
||||||
&[
|
&[
|
||||||
"--output-format",
|
"--output-format",
|
||||||
@@ -251,7 +247,6 @@ fn resumed_status_command_emits_structured_json_when_requested() {
|
|||||||
session_path.to_str().expect("utf8 path"),
|
session_path.to_str().expect("utf8 path"),
|
||||||
"/status",
|
"/status",
|
||||||
],
|
],
|
||||||
&[("CLAW_CONFIG_HOME", config_home.to_str().expect("utf8 path"))],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
|
|||||||
Reference in New Issue
Block a user