feat(04-02): use user context for project selection in generic commands

- Generic commands now use project from user context first
- Fall back to context param or default if no user context
- Add users_root parameter to Orchestrator for test isolation
- Update integration tests to use tmp_users_root fixture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 18:51:50 +08:00
parent 3047605d14
commit 87068339df
2 changed files with 19 additions and 7 deletions
+3 -2
View File
@@ -345,7 +345,7 @@ class TestIntegrationFlows:
"""Integration-style tests for complete flows."""
@pytest.fixture
def orchestrator_with_real_components(self):
def orchestrator_with_real_components(self, tmp_users_root):
"""Create orchestrator with real components (mock only tmux)."""
from gsd_openclaw.orchestrator import Orchestrator
from gsd_openclaw.response_formatter import FeishuResponseFormatter
@@ -359,7 +359,8 @@ class TestIntegrationFlows:
orchestrator = Orchestrator(
tmux_manager=mock_tmux_manager,
formatter=formatter
formatter=formatter,
users_root=tmp_users_root
)
orchestrator.approval_handler = approval_handler
orchestrator.executor = MagicMock()