Stop counting initializing agents as running
This commit is contained in:
@@ -324,7 +324,7 @@ export function AgentList({
|
||||
|
||||
const handleAgentLongPress = useCallback(
|
||||
(agent: AggregatedAgent) => {
|
||||
const isRunning = agent.status === "running" || agent.status === "initializing";
|
||||
const isRunning = agent.status === "running";
|
||||
if (isRunning) {
|
||||
setActionAgent(agent);
|
||||
return;
|
||||
|
||||
@@ -420,7 +420,7 @@ describe("deriveAgentScreenViewState", () => {
|
||||
expect(transitions.join(" -> ")).not.toContain("loading -> idle");
|
||||
});
|
||||
|
||||
it("keeps optimistic running status while authoritative agent is initializing", () => {
|
||||
it("uses authoritative initializing status instead of optimistic running status", () => {
|
||||
const memory = createBaseMemory();
|
||||
const input: AgentScreenMachineInput = {
|
||||
...createBaseInput(),
|
||||
@@ -431,8 +431,8 @@ describe("deriveAgentScreenViewState", () => {
|
||||
const result = deriveAgentScreenViewState({ input, memory });
|
||||
const ready = expectReadyState(result.state);
|
||||
|
||||
expect(ready.source).toBe("optimistic");
|
||||
expect(ready.agent.status).toBe("running");
|
||||
expect(ready.source).toBe("authoritative");
|
||||
expect(ready.agent.status).toBe("initializing");
|
||||
});
|
||||
|
||||
it("hands off to authoritative once agent reaches running", () => {
|
||||
|
||||
@@ -100,8 +100,7 @@ function updateInitialSyncFailureMemory(args: {
|
||||
|
||||
function shouldUseOptimisticCreateFlowAgent(input: AgentScreenMachineInput): boolean {
|
||||
return (
|
||||
input.continuity.kind === "optimistic-create" &&
|
||||
(!input.agent || input.agent.status === "initializing" || input.agent.status === "idle")
|
||||
input.continuity.kind === "optimistic-create" && (!input.agent || input.agent.status === "idle")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2404,7 +2404,7 @@ function WorkspaceScreenContent({
|
||||
const agent =
|
||||
useSessionStore.getState().sessions[normalizedServerId]?.agents?.get(agentId) ?? null;
|
||||
const closePolicy = resolveCloseAgentTabPolicy(agent);
|
||||
const isRunning = agent?.status === "running" || agent?.status === "initializing";
|
||||
const isRunning = agent?.status === "running";
|
||||
|
||||
if (isRunning && closePolicy.kind === "archive-on-close") {
|
||||
const confirmed = await confirmDialog({
|
||||
|
||||
@@ -68,16 +68,15 @@ describe("resolveArchiveSubagentDialog", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("uses running copy for initializing subagents", () => {
|
||||
it("does not use running copy for initializing subagents", () => {
|
||||
expect(
|
||||
resolveArchiveSubagentDialog({
|
||||
title: "Starting child",
|
||||
status: "initializing",
|
||||
}),
|
||||
).toEqual({
|
||||
title: "Archive running subagent?",
|
||||
message:
|
||||
"Starting child is still running. Archiving it will stop the subagent and remove it from the track.",
|
||||
title: "Archive subagent?",
|
||||
message: "Remove Starting child from the track. The subagent will be archived.",
|
||||
confirmLabel: "Archive",
|
||||
cancelLabel: "Cancel",
|
||||
destructive: true,
|
||||
|
||||
@@ -24,7 +24,7 @@ export function resolveArchiveSubagentDialog(
|
||||
input: ResolveArchiveSubagentDialogInput,
|
||||
): ConfirmDialogInput {
|
||||
const subagentLabel = resolveSubagentLabel(input.title) ?? "this subagent";
|
||||
const isRunning = input.status === "running" || input.status === "initializing";
|
||||
const isRunning = input.status === "running";
|
||||
|
||||
return {
|
||||
title: isRunning ? "Archive running subagent?" : "Archive subagent?",
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("deriveSidebarStateBucket", () => {
|
||||
).toBe("attention");
|
||||
});
|
||||
|
||||
it("treats initializing agents as running", () => {
|
||||
it("does not count initializing agents as running", () => {
|
||||
expect(
|
||||
deriveSidebarStateBucket({
|
||||
status: "initializing",
|
||||
@@ -43,6 +43,6 @@ describe("deriveSidebarStateBucket", () => {
|
||||
requiresAttention: false,
|
||||
attentionReason: null,
|
||||
}),
|
||||
).toBe("running");
|
||||
).toBe("done");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user