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
7 changes: 4 additions & 3 deletions src/controllers/command_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ def create_command(self, name: str, description: str = "") -> Command:
logger.error(f"Failed to create command '{name}': {e}")
raise StorageError(f"Failed to create command: {e}") from e

def load_command(self, name: str) -> Command:
def load_command(self, name: str, source: Optional[str] = None) -> Command:
"""
Load a command by name.

Args:
name: Command name
source: Optional source tier ('proj', 'user', 'fc')

Returns:
The loaded command
Expand All @@ -121,8 +122,8 @@ def load_command(self, name: str) -> Command:
StorageError: If command doesn't exist or load fails
"""
try:
command = self.storage_service.load_command(name)
logger.info(f"Loaded command: {name}")
command = self.storage_service.load_command(name, source=source)
logger.info(f"Loaded command: {name} (source={source})")
return command
except Exception as e:
logger.error(f"Failed to load command '{name}': {e}")
Expand Down
6 changes: 3 additions & 3 deletions src/services/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ def create_session(
from ..controllers.execution_controller import ExecutionController
from ..services import StorageService

# Get storage service instance (shared across sessions)
storage_service = StorageService()
# Get storage service instance with session's working directory
storage_service = StorageService(project_dir=working_directory)

session.execution_controller = ExecutionController(
agent_service=session.agent_service,
Expand Down Expand Up @@ -668,7 +668,7 @@ def load_sessions(self) -> None:
from ..controllers.execution_controller import ExecutionController
from ..services import StorageService

storage_service = StorageService()
storage_service = StorageService(project_dir=session.working_directory)

session.execution_controller = ExecutionController(
agent_service=session.agent_service,
Expand Down
Loading