Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions agentwatch/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,3 +1557,30 @@ def main() -> None:

if __name__ == "__main__":
main()


@app.command(name="replay-session")
@session_app.command(name="replay-session")
def replay_session(
session_id: str = typer.Argument(..., help="ID of the session to replay"),
step: int = typer.Option(0, help="Step to resume from"),
) -> None:
"""[bold]Replay[/bold]: Rewind and resume failed agent sessions."""

async def _run():
from agentwatch.rollback.engine import RollbackEngine, RollbackStatus

engine = RollbackEngine()
res = await engine.rollback_session(session_id, to_step=step)
if res.status == RollbackStatus.COMPLETED:
console.print(
Panel(
f"Session [cyan]{session_id}[/cyan] rewound to step [yellow]{step}[/yellow] and is ready to resume.",
title="[blue]Replay-Session[/blue]",
border_style="blue",
)
)
else:
console.print(f"[red]Failed to rewind: {res.error}[/red]")

asyncio.run(_run())
1 change: 1 addition & 0 deletions agentwatch/orchestration/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from agentwatch.orchestration.bft_consensus import *

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Import fails—module does not exist.

The pipeline failures confirm that agentwatch.orchestration.bft_consensus raises ModuleNotFoundError. This breaks the entire package initializer, causing all imports from agentwatch.orchestration to fail.

Either add the missing bft_consensus.py module or remove this import until the module is implemented.

🧰 Tools
🪛 GitHub Actions: PR Tests / 0_Test & lint.txt

[error] 1-1: Import error in package initialization: from 'agentwatch.orchestration.bft_consensus' import * failed with ModuleNotFoundError.

🪛 GitHub Actions: PR Tests / Test & lint

[error] 1-1: Import failure in package initializer: 'from agentwatch.orchestration.bft_consensus import *' raises ModuleNotFoundError for 'agentwatch.orchestration.bft_consensus'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agentwatch/orchestration/__init__.py` at line 1, The import statement `from
agentwatch.orchestration.bft_consensus import *` in the __init__.py file
references a module that does not exist, causing the entire orchestration
package initialization to fail. Either create the missing bft_consensus.py
module in the agentwatch/orchestration directory with appropriate
implementation, or remove the import statement from the __init__.py file until
the bft_consensus module is ready to be implemented. Choose whichever approach
aligns with your development timeline and module architecture.

Source: Pipeline failures

from agentwatch.orchestration.engine import *
1 change: 1 addition & 0 deletions tests/test_multiagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest

from agentwatch.core.event_bus import EventBus
from agentwatch.orchestration.bft_consensus import BFTConsensusEngine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Import will fail—module does not exist.

This import of BFTConsensusEngine from agentwatch.orchestration.bft_consensus will fail with ModuleNotFoundError since the module does not exist (as confirmed by pipeline failures on the package initializer). The entire test file will fail to collect.

This is blocked until the bft_consensus module is added or this import is removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_multiagent.py` at line 8, The import statement importing
BFTConsensusEngine from agentwatch.orchestration.bft_consensus will fail because
this module does not exist yet, causing the entire test file to fail during
collection. Either remove or comment out the import line that imports
BFTConsensusEngine from agentwatch.orchestration.bft_consensus until the
bft_consensus module is created and available, or add the missing bft_consensus
module with the BFTConsensusEngine class to the agentwatch.orchestration
package.

Source: Pipeline failures

from agentwatch.orchestration.consensus import AgentVote, detect_consensus
from agentwatch.orchestration.crew_context import CrewContext
from agentwatch.orchestration.dag import InterAgentDAG
Expand Down
1 change: 1 addition & 0 deletions tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def test_mcp_server_unknown_tool():

@pytest.mark.asyncio
async def test_mcp_server_build_fastmcp():
pytest.importorskip("mcp")
srv = AgentWatchMCPServer()
fastmcp = srv.build_fastmcp()

Expand Down
Loading