huskies: merge 1053
This commit is contained in:
@@ -63,6 +63,19 @@ pub struct RuntimeResult {
|
||||
/// uses this flag to skip acceptance gates and respawn without consuming a
|
||||
/// retry slot. Always `false` for API-based runtimes (Gemini, OpenAI).
|
||||
pub aborted_signal: bool,
|
||||
/// `true` when the Claude Code CLI received a rate-limit hard block event
|
||||
/// before exiting (bug 1053).
|
||||
///
|
||||
/// The completion handler uses this to distinguish a rate-limit-forced exit
|
||||
/// from a genuine no-progress exit, so commit-recovery counters are not
|
||||
/// incremented. Always `false` for API-based runtimes (Gemini, OpenAI).
|
||||
pub rate_limit_exit: bool,
|
||||
/// When the API rate limit is scheduled to reset.
|
||||
///
|
||||
/// Populated from the `reset_at` field of the `rate_limit_event` JSON when
|
||||
/// `rate_limit_exit` is `true`. The completion handler honours this window
|
||||
/// before re-attempting the agent spawn. `None` for API-based runtimes.
|
||||
pub rate_limit_reset_at: Option<chrono::DateTime<chrono::Utc>>,
|
||||
}
|
||||
|
||||
/// Runtime status reported by the backend.
|
||||
@@ -157,6 +170,8 @@ mod tests {
|
||||
total_cost_usd: 0.01,
|
||||
}),
|
||||
aborted_signal: false,
|
||||
rate_limit_exit: false,
|
||||
rate_limit_reset_at: None,
|
||||
};
|
||||
assert_eq!(result.session_id, Some("sess-123".to_string()));
|
||||
assert!(result.token_usage.is_some());
|
||||
@@ -172,6 +187,8 @@ mod tests {
|
||||
session_id: None,
|
||||
token_usage: None,
|
||||
aborted_signal: false,
|
||||
rate_limit_exit: false,
|
||||
rate_limit_reset_at: None,
|
||||
};
|
||||
assert!(result.session_id.is_none());
|
||||
assert!(result.token_usage.is_none());
|
||||
|
||||
Reference in New Issue
Block a user