WIP: fix archive tab reconciliation (#158)
* WIP: fix archive tab reconciliation * fix: converge archive into AgentManager for cross-session propagation CLI archive left agent tabs visible in passive app clients because Session.archiveAgentState only notified the archiving session's own subscription. LoopService had the same gap via AgentManager.archiveAgent. Converge on AgentManager.archiveAgent as the single canonical archive path: persist updatedAt, call notifyAgentState before closeAgent so all sessions receive the archived snapshot. Delete Session.archiveAgentState and make handleArchiveAgentRequest a thin wrapper.
This commit is contained in:
@@ -102,6 +102,17 @@ describe("workspace agent visibility", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("prunes pinned archived agent tabs because archive state is authoritative", () => {
|
||||
expect(
|
||||
shouldPruneWorkspaceAgentTab({
|
||||
agentId: "archived-agent",
|
||||
agentsHydrated: true,
|
||||
knownAgentIds: new Set(["archived-agent"]),
|
||||
activeAgentIds: new Set<string>(),
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not prune active agent tabs", () => {
|
||||
const knownAgentIds = new Set(["active-agent"]);
|
||||
const activeAgentIds = new Set(["active-agent"]);
|
||||
|
||||
@@ -952,7 +952,6 @@ function WorkspaceScreenContent({ serverId, workspaceId }: WorkspaceScreenProps)
|
||||
if (
|
||||
canPruneAgentTabs &&
|
||||
tab.target.kind === "agent" &&
|
||||
!pinnedAgentIds.has(tab.target.agentId) &&
|
||||
shouldPruneWorkspaceAgentTab({
|
||||
agentId: tab.target.agentId,
|
||||
agentsHydrated: hasHydratedAgents,
|
||||
|
||||
Reference in New Issue
Block a user