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
+5 -2
View File
@@ -9,6 +9,7 @@ import (
"codespace/internal/process"
"codespace/internal/service"
"codespace/internal/shell"
"codespace/internal/workspace"
"github.com/gin-gonic/gin"
@@ -24,10 +25,12 @@ func setupTestRouterWithMaxWriteBytes(t *testing.T, maxWriteBytes int64) http.Ha
root := t.TempDir()
wsMgr := workspace.NewLocalManager(root)
procMgr := process.NewManager("")
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, nil)
shellMgr := shell.NewManager("bash", []string{"-i"})
wsSvc := service.NewWorkspaceService(wsMgr, procMgr, shellMgr, nil)
fileSvc := service.NewFileService(wsMgr, maxWriteBytes)
procSvc := service.NewProcessService(wsMgr, procMgr, nil)
return NewRouter(wsSvc, fileSvc, procSvc, nil, gin.TestMode)
shellSvc := service.NewShellService(wsMgr, shellMgr, nil)
return NewRouter(wsSvc, fileSvc, procSvc, shellSvc, nil, gin.TestMode)
}
func createWorkspaceForTest(t *testing.T, router http.Handler, id string) {