mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 15:44:28 +00:00
feat(runner): replace server-side bash sandbox with remote runner (#530)
* feat(runner): replace server-side bash sandbox with remote runner * fix(runner): address review findings for output bounds, key rotation, defaults, and generated uploads * chore(docker): remove sandbox privileges and env vars from remaining compose files * feat(cli): add runner start with bundled SRT sandboxing (#535) * refactor(agent): expose runner bash without skill gating * feat(cli): add runner start with optional SRT sandboxing * refactor(cli): remove runner Python dependency * feat(cli): bundle SRT and use platform-native runner shells * refactor(cli): delegate runner processes to Execa * chore(cli): upgrade @anthropic-ai/sandbox-runtime to 0.0.83 * feat(cli): discover Bash for Windows runners Use Pi-style Bash discovery and launch behavior, exercise the packaged CLI shell, and wait for pending ZIP metadata reads before closing cancelled downloads. * fix(runner): enforce ownership and safe reconnects Gate dispatch on reconciliation, retain cancellations across disconnects, and stop replaced clients. Guard the single-server runner topology with a database lease. Restage missing generated inputs, report signal exits, and bound generated-file cleanup. * feat(webui): add Korean translations for agent runners * feat(cli): add runner event logging and --verbose flag (#536) * feat(cli): add runner event logging and --verbose flag * fix(cli): log runner capacity rejections accurately and use monotonic duration
This commit is contained in:
@@ -481,65 +481,6 @@ describe('TeamService', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should create sandbox when team is created', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: `test-sandbox-${Date.now()}@example.com`, password: 'pw' },
|
||||
})
|
||||
|
||||
const team = await teamService.createTeam(user, {
|
||||
name: 'Sandbox Team',
|
||||
})
|
||||
|
||||
const sandbox = await prisma.sandbox.findUnique({
|
||||
where: { teamId: team.id },
|
||||
})
|
||||
|
||||
expect(sandbox).toBeDefined()
|
||||
expect(sandbox?.allowedDomains).toContain('github.com')
|
||||
})
|
||||
|
||||
it('should get and update sandbox settings', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: `test-settings-${Date.now()}@example.com`, password: 'pw' },
|
||||
})
|
||||
const team = await teamService.createTeam(user, {
|
||||
name: 'Settings Team',
|
||||
})
|
||||
|
||||
// Should have default settings (networkSandboxEnabled is false by default for new teams)
|
||||
const settings = await teamService.getSandboxSettings(team.id)
|
||||
expect(settings.networkSandboxEnabled).toBe(false)
|
||||
expect(settings.allowedDomains).toContain('github.com')
|
||||
expect(settings.pendingDomains).toEqual([])
|
||||
|
||||
// Should update settings
|
||||
const updated = await teamService.updateSandboxSettings(team.id, {
|
||||
networkSandboxEnabled: true,
|
||||
allowedDomains: ['example.com'],
|
||||
pendingDomains: ['pending.com'],
|
||||
})
|
||||
expect(updated.networkSandboxEnabled).toBe(true)
|
||||
expect(updated.allowedDomains).toEqual(['example.com'])
|
||||
expect(updated.pendingDomains).toEqual(['pending.com'])
|
||||
|
||||
// Should persist to DB
|
||||
const persisted = await teamService.getSandboxSettings(team.id)
|
||||
expect(persisted.networkSandboxEnabled).toBe(true)
|
||||
expect(persisted.allowedDomains).toEqual(['example.com'])
|
||||
expect(persisted.pendingDomains).toEqual(['pending.com'])
|
||||
})
|
||||
|
||||
it('should return default settings if sandbox is missing for old team', async () => {
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Old Team' },
|
||||
})
|
||||
|
||||
const settings = await teamService.getSandboxSettings(team.id)
|
||||
expect(settings.networkSandboxEnabled).toBe(false)
|
||||
expect(settings.allowedDomains).toEqual([])
|
||||
expect(settings.pendingDomains).toEqual([])
|
||||
})
|
||||
|
||||
describe('hasWritableRoleInAnyTeam', () => {
|
||||
it('should return true for user with owner role', async () => {
|
||||
const user = await prisma.user.create({
|
||||
|
||||
Reference in New Issue
Block a user