Co-authored-by: Antoine <33425718+anth2o@users.noreply.github.com>
Co-authored-by: Bastien <bastien.baret@gmail.com>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Robin Gullo <robin.gullo@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Drouin 2026-04-28 17:44:07 +02:00 committed by GitHub
parent a83c81ecf5
commit 632ea8c032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
253 changed files with 13965 additions and 2525 deletions

View file

@ -1,6 +1,7 @@
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime
from typing import Literal
from vibe.core.config import VibeConfig
@ -20,10 +21,11 @@ def short_session_id(session_id: str, source: ResumeSessionSource = "local") ->
return session_id[:SHORT_SESSION_ID_LEN]
_ACTIVE_STATUSES = {
_ACTIVE_STATUSES = [
WorkflowExecutionStatus.RUNNING,
WorkflowExecutionStatus.RETRYING_AFTER_ERROR,
}
WorkflowExecutionStatus.CONTINUED_AS_NEW,
]
@dataclass(frozen=True)
@ -56,38 +58,42 @@ def list_local_resume_sessions(
async def list_remote_resume_sessions(config: VibeConfig) -> list[ResumeSessionInfo]:
if not config.nuage_enabled or not config.nuage_api_key:
logger.debug("Remote resume listing skipped: missing Nuage configuration")
if not config.vibe_code_enabled or not config.vibe_code_api_key:
logger.debug("Remote resume listing skipped: missing Vibe Code configuration")
return []
async with WorkflowsClient(
base_url=config.nuage_base_url,
api_key=config.nuage_api_key,
base_url=config.vibe_code_base_url,
api_key=config.vibe_code_api_key,
timeout=config.api_timeout,
) as client:
response = await client.get_workflow_runs(
workflow_identifier=config.nuage_workflow_id, page_size=50
workflow_identifier=config.vibe_code_workflow_id,
page_size=50,
status=_ACTIVE_STATUSES,
)
sessions: list[ResumeSessionInfo] = []
seen: dict[str, ResumeSessionInfo] = {}
latest_start: dict[str, datetime] = {}
for execution in response.executions:
if execution.status not in _ACTIVE_STATUSES:
continue
sessions.append(
ResumeSessionInfo(
session_id=execution.execution_id,
source="remote",
cwd="",
title="Vibe Nuage",
end_time=(
execution.end_time.isoformat()
if execution.end_time
else execution.start_time.isoformat()
),
status=execution.status,
)
session = ResumeSessionInfo(
session_id=execution.execution_id,
source="remote",
cwd="",
title="Vibe Code",
end_time=(
execution.end_time.isoformat()
if execution.end_time
else execution.start_time.isoformat()
),
status=execution.status,
)
prev_start = latest_start.get(execution.execution_id)
if prev_start is None or execution.start_time > prev_start:
seen[execution.execution_id] = session
latest_start[execution.execution_id] = execution.start_time
sessions = list(seen.values())
logger.debug("Remote resume listing filtered sessions: %d", len(sessions))
return sessions