diff options
Diffstat (limited to '')
| -rw-r--r-- | src/main.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index ccd4e37..9a5012f 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -114,7 +114,7 @@ fn main() { | |||
| 114 | 114 | ||
| 115 | if !prompt_words.is_empty() { | 115 | if !prompt_words.is_empty() { |
| 116 | let prompt = prompt_words.join(" "); | 116 | let prompt = prompt_words.join(" "); |
| 117 | if let Err(error) = agent::run_turn( | 117 | match agent::run_turn( |
| 118 | &cfg, | 118 | &cfg, |
| 119 | &mut session, | 119 | &mut session, |
| 120 | &mut history, | 120 | &mut history, |
| @@ -122,14 +122,30 @@ fn main() { | |||
| 122 | &signal::CANCEL, | 122 | &signal::CANCEL, |
| 123 | &mut approver, | 123 | &mut approver, |
| 124 | ) { | 124 | ) { |
| 125 | eprintln!("agent686: {error}"); | 125 | Ok(report) => { |
| 126 | std::process::exit(1); | 126 | if report.aborted { |
| 127 | std::process::exit(130); | ||
| 128 | } | ||
| 129 | if report.denied > 0 { | ||
| 130 | std::process::exit(3); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | Err(error) => { | ||
| 134 | eprintln!("agent686: {error}"); | ||
| 135 | std::process::exit(1); | ||
| 136 | } | ||
| 127 | } | 137 | } |
| 128 | return; | 138 | return; |
| 129 | } | 139 | } |
| 130 | 140 | ||
| 131 | let mut editor = Editor::new(); | 141 | let mut editor = Editor::new(); |
| 132 | let interactive = editor.is_interactive(); | 142 | let interactive = editor.is_interactive(); |
| 143 | if !interactive && !cfg.yolo { | ||
| 144 | eprintln!( | ||
| 145 | "agent686: stdin is not a terminal, so write/edit/bash will be denied; \ | ||
| 146 | pass --yolo to allow them" | ||
| 147 | ); | ||
| 148 | } | ||
| 133 | if interactive { | 149 | if interactive { |
| 134 | eprintln!( | 150 | eprintln!( |
| 135 | "agent686 · {} · session {}{}", | 151 | "agent686 · {} · session {}{}", |
