@masyv/relay 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/src/agents/codex.rs +22 -10
- package/package.json +1 -1
package/core/src/agents/codex.rs
CHANGED
|
@@ -65,26 +65,38 @@ impl Agent for CodexAgent {
|
|
|
65
65
|
fn execute(&self, handoff_prompt: &str, project_dir: &str) -> Result<HandoffResult> {
|
|
66
66
|
let binary = self.find_binary().unwrap_or(self.binary.clone());
|
|
67
67
|
|
|
68
|
-
// Write handoff to a temp file
|
|
68
|
+
// Write handoff to a temp file for reference
|
|
69
69
|
let tmp = std::env::temp_dir().join("relay_handoff.md");
|
|
70
70
|
std::fs::write(&tmp, handoff_prompt)?;
|
|
71
71
|
|
|
72
|
-
//
|
|
73
|
-
let
|
|
72
|
+
// Use `codex exec --full-auto` for non-interactive auto-approval
|
|
73
|
+
let output = Command::new(&binary)
|
|
74
74
|
.current_dir(project_dir)
|
|
75
|
-
.arg("
|
|
75
|
+
.arg("exec")
|
|
76
|
+
.arg("--full-auto")
|
|
77
|
+
.arg("-m")
|
|
76
78
|
.arg(&self.model)
|
|
77
|
-
.arg("--quiet")
|
|
78
79
|
.arg(handoff_prompt)
|
|
79
|
-
.
|
|
80
|
+
.output()?;
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
let
|
|
82
|
+
let stdout = String::from_utf8_lossy(&output.stdout);
|
|
83
|
+
let stderr = String::from_utf8_lossy(&output.stderr);
|
|
84
|
+
|
|
85
|
+
if !stdout.is_empty() {
|
|
86
|
+
println!("{stdout}");
|
|
87
|
+
}
|
|
88
|
+
if !stderr.is_empty() {
|
|
89
|
+
eprintln!("{stderr}");
|
|
90
|
+
}
|
|
83
91
|
|
|
84
92
|
Ok(HandoffResult {
|
|
85
93
|
agent: "codex".into(),
|
|
86
|
-
success:
|
|
87
|
-
message:
|
|
94
|
+
success: output.status.success(),
|
|
95
|
+
message: if output.status.success() {
|
|
96
|
+
format!("Codex ({}) completed handoff task", self.model)
|
|
97
|
+
} else {
|
|
98
|
+
format!("Codex exited with code {:?}", output.status.code())
|
|
99
|
+
},
|
|
88
100
|
handoff_file: Some(tmp.to_string_lossy().to_string()),
|
|
89
101
|
})
|
|
90
102
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masyv/relay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Relay — When Claude's rate limit hits, another agent picks up exactly where you left off. Captures session state and hands off to Codex, Gemini, Ollama, or GPT-4.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "./scripts/build.sh",
|