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
+19 -16
View File
@@ -363,20 +363,25 @@ fn run_agent_pty_blocking(
.map(|dt| dt.with_timezone(&chrono::Utc));
if is_hard_block {
let reset_at = reset_at.unwrap_or_else(|| {
let default = chrono::Utc::now()
+ chrono::Duration::minutes(5);
slog!(
"[agent:{story_id}:{agent_name}] API rate limit hard block \
(status={status}); no reset_at in rate_limit_info, \
defaulting to 5-minute backoff ({default})"
);
default
});
slog!(
"[agent:{story_id}:{agent_name}] API rate limit hard block \
(status={status}); resets at {reset_at}"
);
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()
+ chrono::Duration::minutes(5);
slog!(
"[agent:{story_id}:{agent_name}] API rate limit hard block \
(status={status}); no reset_at in rate_limit_info, \
defaulting to 5-minute backoff ({default})"
);
default
}
};
let _ = watcher_tx.send(WatcherEvent::RateLimitHardBlock {
story_id: story_id.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
// 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).
slog!("[agent:{story_id}:{agent_name}] Waiting for reader thread to exit");
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 joined");
slog!(
"[agent:{story_id}:{agent_name}] Done. Session: {:?}",