Restore archived agents from History (#2316)

* fix(app): restore archived agents from History

History navigation lost the explicit archived-agent intent during tab reconciliation, and workspace recovery stopped after restoring the workspace. Preserve the selected tab and recover its provider session as one action while serializing provider resume with timeline hydration.

* fix(app): preserve archived agent recovery invariants

* fix(server): preserve timeline hydration call shape

* fix(app): retain agent tabs through lookup

* fix(server): upgrade in-flight timeline broadcast
This commit is contained in:
Mohamed Boudra
2026-07-22 15:03:09 +02:00
committed by GitHub
parent 68993b7ab3
commit 42ee5a5949
22 changed files with 629 additions and 61 deletions
@@ -291,11 +291,13 @@ interface WorkspaceScreenProps {
workspaceId: string;
isRouteFocused?: boolean;
recoveryRequested?: boolean;
recoveryAgentId?: string | null;
}
type WorkspaceScreenContentProps = WorkspaceScreenProps & {
isRouteFocused: boolean;
recoveryRequested: boolean;
recoveryAgentId: string | null;
};
function trimNonEmpty(value: string | null | undefined): string | null {
@@ -912,6 +914,7 @@ export const WorkspaceScreen = memo(function WorkspaceScreen({
workspaceId,
isRouteFocused,
recoveryRequested,
recoveryAgentId,
}: WorkspaceScreenProps) {
const navigationFocused = useIsFocused();
return (
@@ -920,6 +923,7 @@ export const WorkspaceScreen = memo(function WorkspaceScreen({
workspaceId={workspaceId}
isRouteFocused={isRouteFocused ?? navigationFocused}
recoveryRequested={recoveryRequested ?? false}
recoveryAgentId={recoveryAgentId ?? null}
/>
);
});
@@ -1715,6 +1719,7 @@ function WorkspaceScreenContent({
workspaceId,
isRouteFocused,
recoveryRequested,
recoveryAgentId,
}: WorkspaceScreenContentProps) {
const { t } = useTranslation();
const _insets = useSafeAreaInsets();
@@ -1791,6 +1796,7 @@ function WorkspaceScreenContent({
const workspaceRecovery = useWorkspaceRecovery({
serverId: normalizedServerId,
workspaceId: normalizedWorkspaceId,
agentId: recoveryAgentId,
enabled: shouldInspectWorkspaceRecovery(
hasHydratedWorkspaces,
workspaceDescriptor,