feat(core,cli)!: Implement in-process agent backend for arenas

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Add InProcessBackend to run subagents in-process rather than via subprocess,

enabling faster initialization and better resource management for agent

collaboration arenas.

Key changes:

- Add InProcessBackend with sandboxed in-process agent execution

- Refactor agent runtime into headless vs interactive modes

- Add AsyncMessageQueue utility for agent message passing

- Update ArenaManager with backend selection (in-process vs subprocess)

- Refactor subagent types/exports; consolidate in subagents/types

- Remove deprecated agent-hooks.ts (functionality merged into runtime)

- Update task tool to support new agent lifecycle

Breaking: Subagent type exports restructured; import from subagents/types
This commit is contained in:
tanzhenxin 2026-02-21 21:08:20 +08:00
parent e968483a8a
commit d4cfb18f79
39 changed files with 2951 additions and 502 deletions

View file

@ -1231,6 +1231,26 @@ const SETTINGS_SCHEMA = {
'When enabled, Arena worktrees and session state files are preserved after the session ends or the main agent exits.',
showInDialog: true,
},
maxRoundsPerAgent: {
type: 'number',
label: 'Max Rounds Per Agent',
category: 'Advanced',
requiresRestart: false,
default: undefined as number | undefined,
description:
'Maximum number of rounds (turns) each agent can execute. No limit if unset.',
showInDialog: false,
},
timeoutSeconds: {
type: 'number',
label: 'Timeout (seconds)',
category: 'Advanced',
requiresRestart: false,
default: undefined as number | undefined,
description:
'Total timeout in seconds for the Arena session. No limit if unset.',
showInDialog: false,
},
},
},
team: {