fix(424): add throttled field to all StoryAgent ctors and handle HardBlock in ws.rs
The initial commit added the `throttled` field to `StoryAgent` but missed several construction sites in lifecycle.rs, test_helpers.rs, and scan.rs. Also adds the `HardBlock` match arm in the WebSocket event conversion and minor CSS/import ordering fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,7 @@ mod tests {
|
||||
project_root: None,
|
||||
log_session_id: None,
|
||||
merge_failure_reported: false,
|
||||
throttled: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -552,6 +552,7 @@ impl AgentPool {
|
||||
base_branch: None,
|
||||
completion: None,
|
||||
log_session_id: Some(log_session_id),
|
||||
throttled: false,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -676,6 +677,7 @@ impl AgentPool {
|
||||
base_branch: None,
|
||||
completion: None,
|
||||
log_session_id: None,
|
||||
throttled: false,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ impl AgentPool {
|
||||
_ => continue,
|
||||
};
|
||||
let key = composite_key(&story_id, &agent_name);
|
||||
if let Ok(mut agents) = agents_clone.lock() {
|
||||
if let Some(agent) = agents.get_mut(&key) {
|
||||
agent.throttled = true;
|
||||
}
|
||||
if let Ok(mut agents) = agents_clone.lock()
|
||||
&& let Some(agent) = agents.get_mut(&key)
|
||||
{
|
||||
agent.throttled = true;
|
||||
}
|
||||
let _ = watcher_tx_clone.send(WatcherEvent::AgentStateChanged);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ impl AgentPool {
|
||||
project_root: None,
|
||||
log_session_id: None,
|
||||
merge_failure_reported: false,
|
||||
throttled: false,
|
||||
},
|
||||
);
|
||||
tx
|
||||
@@ -68,6 +69,7 @@ impl AgentPool {
|
||||
project_root: None,
|
||||
log_session_id: None,
|
||||
merge_failure_reported: false,
|
||||
throttled: false,
|
||||
},
|
||||
);
|
||||
tx
|
||||
@@ -100,6 +102,7 @@ impl AgentPool {
|
||||
project_root: Some(project_root),
|
||||
log_session_id: None,
|
||||
merge_failure_reported: false,
|
||||
throttled: false,
|
||||
},
|
||||
);
|
||||
tx
|
||||
@@ -131,6 +134,7 @@ impl AgentPool {
|
||||
project_root: None,
|
||||
log_session_id: None,
|
||||
merge_failure_reported: false,
|
||||
throttled: false,
|
||||
},
|
||||
);
|
||||
tx
|
||||
|
||||
@@ -158,8 +158,8 @@ impl From<WatcherEvent> for Option<WsResponse> {
|
||||
}),
|
||||
WatcherEvent::ConfigChanged => Some(WsResponse::AgentConfigChanged),
|
||||
WatcherEvent::AgentStateChanged => Some(WsResponse::AgentStateChanged),
|
||||
// MergeFailure, RateLimitWarning, and StoryBlocked are handled by the
|
||||
// chat notification listener only; no WebSocket message is needed for the frontend.
|
||||
// MergeFailure, RateLimitWarning, StoryBlocked, and RateLimitHardBlock are handled
|
||||
// by the chat notification listener only; no WebSocket message is needed for the frontend.
|
||||
WatcherEvent::MergeFailure { .. } => None,
|
||||
WatcherEvent::RateLimitWarning { .. } => None,
|
||||
WatcherEvent::StoryBlocked { .. } => None,
|
||||
|
||||
Reference in New Issue
Block a user