mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +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
|
|
@ -9,7 +9,7 @@ import { useCallback, useMemo } from 'react';
|
|||
import { Box, Text } from 'ink';
|
||||
import {
|
||||
type ArenaManager,
|
||||
ArenaAgentStatus,
|
||||
AgentStatus,
|
||||
type Config,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
|
|
@ -138,7 +138,7 @@ export function ArenaSelectDialog({
|
|||
// Build diff summary from cached result if available
|
||||
let diffAdditions = 0;
|
||||
let diffDeletions = 0;
|
||||
if (agent.status === ArenaAgentStatus.COMPLETED && result) {
|
||||
if (agent.status === AgentStatus.COMPLETED && result) {
|
||||
const agentResult = result.agents.find(
|
||||
(a) => a.agentId === agent.agentId,
|
||||
);
|
||||
|
|
@ -182,7 +182,7 @@ export function ArenaSelectDialog({
|
|||
value: agent.agentId,
|
||||
title,
|
||||
description,
|
||||
disabled: agent.status !== ArenaAgentStatus.COMPLETED,
|
||||
disabled: agent.status !== AgentStatus.COMPLETED,
|
||||
};
|
||||
}),
|
||||
[agents, result],
|
||||
|
|
|
|||
|
|
@ -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