mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* fix(client): wait longer for session responses * fix(client): default RPC waits to sixty seconds * fix(app): preserve detached stream scroll on delayed history Code drift: longer client RPC waits let delayed timeline responses arrive after a user scroll-away, so web stream anchoring must not reattach on transient scroll-top resets. Restore the 15s connect deadline and leave app initialization slack above the default 60s session RPC wait. * fix(client): keep helper waits within caller deadlines Review fix: the 60s default session RPC wait leaked into wait previews and waitForAgentUpsert helper fetches. Bound those helper RPCs to the caller deadline or a short best-effort preview timeout, and allow small scroll ranges to reattach at bottom. * fix(client): respect caller timeout budgets * fix(cli): keep diagnostic probes responsive * Refactor daemon client request options * Preserve daemon client legacy overloads
23 lines
677 B
TypeScript
23 lines
677 B
TypeScript
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
|
|
import type { AgentTimelineItem } from "@getpaseo/protocol/agent-types";
|
|
|
|
export const LIVE_HISTORY_FETCH_TIMEOUT_MS = 2_000;
|
|
|
|
interface FetchProjectedTimelineItemsInput {
|
|
client: DaemonClient;
|
|
agentId: string;
|
|
timeoutMs?: number;
|
|
}
|
|
|
|
export async function fetchProjectedTimelineItems(
|
|
input: FetchProjectedTimelineItemsInput,
|
|
): Promise<AgentTimelineItem[]> {
|
|
const timeline = await input.client.fetchAgentTimeline(input.agentId, {
|
|
direction: "tail",
|
|
limit: 0,
|
|
projection: "projected",
|
|
timeout: input.timeoutMs,
|
|
});
|
|
return timeline.entries.map((entry) => entry.item);
|
|
}
|