mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-03 14:10:43 +00:00
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:
parent
e968483a8a
commit
d4cfb18f79
39 changed files with 2951 additions and 502 deletions
|
|
@ -10,7 +10,7 @@ import { Box, Text } from 'ink';
|
|||
import {
|
||||
type ArenaManager,
|
||||
type ArenaAgentState,
|
||||
ArenaAgentStatus,
|
||||
isTerminalStatus,
|
||||
ArenaSessionStatus,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
|
|
@ -42,11 +42,7 @@ function pad(
|
|||
}
|
||||
|
||||
function getElapsedMs(agent: ArenaAgentState): number {
|
||||
if (
|
||||
agent.status === ArenaAgentStatus.COMPLETED ||
|
||||
agent.status === ArenaAgentStatus.TERMINATED ||
|
||||
agent.status === ArenaAgentStatus.CANCELLED
|
||||
) {
|
||||
if (isTerminalStatus(agent.status)) {
|
||||
return agent.stats.durationMs;
|
||||
}
|
||||
return Date.now() - agent.startedAt;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue