feat(shell): add parallel bash shell subsystem auto-started per workspace

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
tao.chen
2026-07-03 16:36:35 +08:00
co-authored by Claude
parent 75e807c154
commit 0ec3efa812
14 changed files with 730 additions and 12 deletions
+9 -4
View File
@@ -11,6 +11,7 @@ import (
"codespace/internal/process"
"codespace/internal/service"
"codespace/internal/shell"
"codespace/internal/workspace"
"github.com/gin-gonic/gin"
@@ -29,11 +30,13 @@ func TestProcessWS(t *testing.T) {
wsRoot := filepath.Join(tmpDir, "workspaces")
wsMgr := workspace.NewLocalManager(wsRoot)
procMgr := process.NewManager(opencodePath)
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, nil)
shellMgr := shell.NewManager("bash", []string{"-i"})
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, shellMgr, nil)
fileSvc := service.NewFileService(wsMgr, 1<<20)
procSvc := service.NewProcessService(wsMgr, procMgr, nil)
shellSvc := service.NewShellService(wsMgr, shellMgr, nil)
r := NewRouter(wsSvc, fileSvc, procSvc, nil, gin.TestMode)
r := NewRouter(wsSvc, fileSvc, procSvc, shellSvc, nil, gin.TestMode)
srv := httptest.NewServer(r)
defer srv.Close()
@@ -102,11 +105,13 @@ func TestProcessWSMultiSubscriber(t *testing.T) {
wsRoot := filepath.Join(tmpDir, "workspaces")
wsMgr := workspace.NewLocalManager(wsRoot)
procMgr := process.NewManager(opencodePath)
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, nil)
shellMgr := shell.NewManager("bash", []string{"-i"})
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, shellMgr, nil)
fileSvc := service.NewFileService(wsMgr, 1<<20)
procSvc := service.NewProcessService(wsMgr, procMgr, nil)
shellSvc := service.NewShellService(wsMgr, shellMgr, nil)
r := NewRouter(wsSvc, fileSvc, procSvc, nil, gin.TestMode)
r := NewRouter(wsSvc, fileSvc, procSvc, shellSvc, nil, gin.TestMode)
srv := httptest.NewServer(r)
defer srv.Close()