mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Mark completed spawn agent logs as complete
This commit is contained in:
parent
a009ae4dfa
commit
a6c2236374
2 changed files with 5 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ export function agentDisplayItem(item: CollabAgentToolCallItem, turnId?: string)
|
|||
model: item.model,
|
||||
reasoningEffort: item.reasoningEffort,
|
||||
agents,
|
||||
state: collabAgentExecutionState(item.status, item.receiverThreadIds, agents),
|
||||
state: collabAgentExecutionState(item.tool, item.status, item.receiverThreadIds, agents),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,8 @@ function agentStatesDisplay(states: CollabAgentToolCallItem["agentsStates"]): Ag
|
|||
.sort((a, b) => a.threadId.localeCompare(b.threadId));
|
||||
}
|
||||
|
||||
function collabAgentExecutionState(status: string, receiverThreadIds: string[], agents: AgentStateDisplay[]): ExecutionState {
|
||||
function collabAgentExecutionState(tool: string, status: string, receiverThreadIds: string[], agents: AgentStateDisplay[]): ExecutionState {
|
||||
if (tool === "spawnAgent") return classifyExecutionState({ status });
|
||||
if (agents.some((agent) => classifyExecutionState({ status: agent.status }) === "failed")) return "failed";
|
||||
if (agents.some((agent) => classifyExecutionState({ status: agent.status }) === "running")) return "running";
|
||||
if (agents.length > 0 && agents.every((agent) => classifyExecutionState({ status: agent.status }) === "completed")) {
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ describe("thread item conversion preserves app-server semantics", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("keeps spawned agents running until child state completes", () => {
|
||||
it("marks completed spawn calls complete even before child state arrives", () => {
|
||||
const item: ThreadItem = {
|
||||
type: "collabAgentToolCall",
|
||||
id: "agent-1",
|
||||
|
|
@ -256,7 +256,7 @@ describe("thread item conversion preserves app-server semantics", () => {
|
|||
expect(displayItemFromThreadItem(item, "t1")).toMatchObject({
|
||||
kind: "agent",
|
||||
status: "completed",
|
||||
state: "running",
|
||||
state: "completed",
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue