aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-15 15:37:56 +0100
committersalmonik <salmonik@tuta.io>2026-11-15 15:37:56 +0100
commit714534475818e6e5dced91ecad100ca9e286ccce (patch)
treedd36ffe02376e06bd92d9e3650bcd4ddb21d0768 /src/main.rs
parent0.4.0: grep takes a regular expression, fixed=true for literals (diff)
downloadagent686-714534475818e6e5dced91ecad100ca9e286ccce.tar.gz
agent686-714534475818e6e5dced91ecad100ca9e286ccce.zip
0.4.1 + 0.4.2: abort integrity, stream completeness, tool-call indexing
- an aborted multi-call step now answers every announced tool call - sessions with unanswered calls are repaired by appending results - a stream without [DONE]/finish_reason is an error, not an answer - tool call deltas keyed by index can no longer vanish or invent empty calls - one-shot exit codes: 130 aborted, 3 denied
Diffstat (limited to '')
-rw-r--r--src/main.rs22
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 {}{}",