huskies: merge 500_story_remove_duplicate_pty_debug_log_lines

This commit is contained in:
dave
2026-04-09 22:11:41 +00:00
parent cbe016d7a2
commit d3ee850f37
+11 -8
View File
@@ -363,7 +363,15 @@ fn run_agent_pty_blocking(
.map(|dt| dt.with_timezone(&chrono::Utc)); .map(|dt| dt.with_timezone(&chrono::Utc));
if is_hard_block { if is_hard_block {
let reset_at = reset_at.unwrap_or_else(|| { let reset_at = match reset_at {
Some(t) => {
slog!(
"[agent:{story_id}:{agent_name}] API rate limit hard block \
(status={status}); resets at {t}"
);
t
}
None => {
let default = chrono::Utc::now() let default = chrono::Utc::now()
+ chrono::Duration::minutes(5); + chrono::Duration::minutes(5);
slog!( slog!(
@@ -372,11 +380,8 @@ fn run_agent_pty_blocking(
defaulting to 5-minute backoff ({default})" defaulting to 5-minute backoff ({default})"
); );
default default
}); }
slog!( };
"[agent:{story_id}:{agent_name}] API rate limit hard block \
(status={status}); resets at {reset_at}"
);
let _ = watcher_tx.send(WatcherEvent::RateLimitHardBlock { let _ = watcher_tx.send(WatcherEvent::RateLimitHardBlock {
story_id: story_id.to_string(), story_id: story_id.to_string(),
agent_name: agent_name.to_string(), agent_name: agent_name.to_string(),
@@ -429,11 +434,9 @@ fn run_agent_pty_blocking(
// Wait for the reader thread to finish so it releases the cloned PTY // Wait for the reader thread to finish so it releases the cloned PTY
// master fd before we return. Without this, the next PTY spawn for the // master fd before we return. Without this, the next PTY spawn for the
// same story can collide with a still-open fd from this session (#453). // same story can collide with a still-open fd from this session (#453).
slog!("[agent:{story_id}:{agent_name}] Waiting for reader thread to exit");
if let Err(e) = reader_handle.join() { if let Err(e) = reader_handle.join() {
slog!("[agent:{story_id}:{agent_name}] Reader thread panicked: {e:?}"); slog!("[agent:{story_id}:{agent_name}] Reader thread panicked: {e:?}");
} }
slog!("[agent:{story_id}:{agent_name}] Reader thread joined");
slog!( slog!(
"[agent:{story_id}:{agent_name}] Done. Session: {:?}", "[agent:{story_id}:{agent_name}] Done. Session: {:?}",