fix(server): bound agent timeline history - #4153
Conversation
ec154d1 to
0f59314
Compare
|
| Filename | Overview |
|---|---|
| packages/server/src/server/agent/bounded-agent-timeline-runtime.ts | Coordinates bounded hot storage with ordered durable persistence and generation-aware lifecycle operations. |
| packages/server/src/server/agent/segmented-file-agent-timeline-store.ts | Implements segmented disk-backed timeline persistence and paged committed-row retrieval. |
| packages/server/src/server/agent/agent-manager.ts | Integrates bounded timeline storage, paging, lifecycle fencing, and provider-history behavior into agent management. |
| packages/server/src/server/bootstrap.ts | Wires disposable timeline cache initialization and fail-closed startup invalidation into daemon bootstrap. |
| packages/server/src/server/agent/agent-manager.test.ts | Adds regression coverage for bounded timeline integration, reload behavior, failure recovery, and lifecycle cleanup. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
P[Provider history] --> N[Bound and normalize timeline items]
N --> B[Ordered durable buffer]
B --> D[Segmented disk store]
N --> H[Bounded hot tail]
D --> R[Paged historical reads]
H --> R
R --> C[Projected client timeline]
Reviews (2): Last reviewed commit: "fix(server): preserve current timeline c..." | Re-trigger Greptile
| const internals = manager as unknown as { | ||
| persistSnapshot: (...args: unknown[]) => Promise<void>; | ||
| registerSession: ( | ||
| session: AgentSession, | ||
| config: AgentSessionConfig, | ||
| agentId: string, | ||
| options: { timelineRows: AgentTimelineRow[] }, | ||
| ) => Promise<ManagedAgent>; | ||
| boundedTimeline: { has(agentId: string): boolean }; | ||
| timelineStore: InMemoryAgentTimelineStore; |
There was a problem hiding this comment.
Tests depend on private internals
These tests cast AgentManager to expose private state, replace persistSnapshot, and use setTimeout(0) to infer reload settlement. That makes behavior-preserving refactors break the suite and makes the reload assertion sensitive to event-loop scheduling; exercise the manager through its public interface and deterministic gates instead.
Rule Used: # Code Review Pattern Reference: Slop, Tests, Feat... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
0f59314 to
be7101c
Compare
|
Closing for now: this needs before/after daemon heap and RSS measurements under long-running Codex root/subagent activity, with older-history paging and reload verified. Please reopen with that evidence. |
|
Please disregard the earlier invitation to reopen with evidence. This PR remains closed unless I explicitly follow up. You don't need to resubmit this PR or provide further QA evidence. Please read the updated PR policy. For now, I'm automatically closing feature PRs so I can focus more time on bug fixes and core improvements. Focused bug-fix PRs with a clear reproduction and QA are still welcome. The previous guide already asked contributors to submit only if they were comfortable with closure, and explained that unsolicited PRs could be closed without a detailed review. For feature ideas, please start in GitHub Discussions and share your workflow: what you're trying to do, how you do it today, and where Paseo gets in the way. If there's already a discussion about it, join in and share your use case. I'll periodically review discussions for highly requested workflows and use that feedback to shape the roadmap. I'll periodically look through closed PRs and choose which contributions to take forward, whether solicited or unsolicited. I may reopen a PR, including one closed by mistake, or use it as a reference for my own implementation, with attribution either way. There are hundreds of PRs alongside ongoing development. I can't commit to reviewing every submission, providing individual feedback or giving timelines. |
Refs #2300
Bounds daemon memory used by long-running root and Codex provider-subagent histories.
Provider history remains authoritative, and daemon startup clears the disposable cache fail-closed.