diff --git a/Cargo.toml b/Cargo.toml index e7470fc..49391f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,7 @@ futures = "0.3" # For tool implementations walkdir = "2" urlencoding = "2" +url = "2" anyhow = "1" async-stream = "0.3" regex = "1" diff --git a/dashboard/src/app/control/control-client.tsx b/dashboard/src/app/control/control-client.tsx index eea8601..e81e91c 100644 --- a/dashboard/src/app/control/control-client.tsx +++ b/dashboard/src/app/control/control-client.tsx @@ -27,6 +27,7 @@ import { getModelDisplayName, filterAndSortModels, getModelCategory, + getHealth, type ControlRunState, type Mission, type MissionStatus, @@ -423,6 +424,9 @@ export default function ControlClient() { // Model selection state const [availableModels, setAvailableModels] = useState([]); + // Server configuration (fetched from health endpoint) + const [maxIterations, setMaxIterations] = useState(50); // Default fallback + // Check if the mission we're viewing is actually running (not just any mission) const viewingMissionIsRunning = useMemo(() => { if (!viewingMissionId) return runState !== "idle"; @@ -706,6 +710,19 @@ export default function ControlClient() { }); }, []); + // Fetch server configuration (max_iterations) from health endpoint + useEffect(() => { + getHealth() + .then((data) => { + if (data.max_iterations) { + setMaxIterations(data.max_iterations); + } + }) + .catch((err) => { + console.error("Failed to fetch health:", err); + }); + }, []); + // Handle cancelling a parallel mission const handleCancelMission = async (missionId: string) => { try { @@ -1520,7 +1537,7 @@ export default function ControlClient() { {currentMission.status === "interrupted" ? ( <>This mission was interrupted (server shutdown or cancellation). Click the Resume button in the mission menu to continue where you left off. ) : currentMission.status === "blocked" ? ( - <>The agent reached its iteration limit (50). You can continue the mission to give it more iterations. + <>The agent reached its iteration limit ({maxIterations}). You can continue the mission to give it more iterations. ) : ( <>This mission was {currentMission.status} without any messages. {currentMission.status === "completed" && " You can reactivate it to continue."} @@ -1831,7 +1848,7 @@ export default function ControlClient() {
Iteration limit reached - — Agent used all 50 iterations + — Agent used all {maxIterations} iterations