feat: expose provider-neutral material progress snapshots - #2765
feat: expose provider-neutral material progress snapshots#2765timigod wants to merge 10 commits into
Conversation
…aterial-progress-current-main
…aterial-progress-current-main
…aterial-progress-current-main
|
| Filename | Overview |
|---|---|
| packages/server/src/server/agent/material-progress.ts | Adds the checkpoint reducer, event classifier, restoration validation, and public progress-state projection. |
| packages/server/src/server/agent/agent-manager.ts | Integrates progress tracking and durable, atomic provider-history replacement into agent lifecycle and timeline handling. |
| packages/server/src/server/agent/file-agent-timeline-store.ts | Implements durable epoch-bearing timeline persistence and replacement. |
| packages/protocol/src/messages.ts | Adds the optional material-progress snapshot and server capability, with a duplicated handwritten payload type. |
| packages/cli/src/commands/agent/inspect.ts | Exposes structured progress in JSON inspection data and a concise state/reason table row. |
| packages/server/src/server/session.ts | Makes explicit agent refresh perform an atomic forced provider-history rehydration. |
| packages/server/src/server/websocket-server.ts | Advertises material-progress support as an explicit server feature. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
P[Provider events] --> M[AgentManager]
M --> T[Epoch-bound timeline store]
T --> C[Material-progress checkpoint]
C --> S[Agent snapshot]
S --> W[WebSocket clients]
S --> I[CLI inspect]
C --> A[Agent record persistence]
T --> D[Durable timeline file]
Reviews (1): Last reviewed commit: "fix(agent): preserve progress across suc..." | Re-trigger Greptile
| export interface MaterialProgressPayload { | ||
| state: "none" | "progressing" | "warning" | "stalled"; | ||
| timelineEpoch: string | null; | ||
| continuationBoundarySeq: number | null; | ||
| observedThroughSeq: number | null; | ||
| completedCompactionsSinceMaterialProgress: number; | ||
| lastMaterialProgressAt: string | null; | ||
| lastMaterialProgressKind: | ||
| | "edit" | ||
| | "write" | ||
| | "evidence" | ||
| | "verification" | ||
| | "decision" | ||
| | "assistant_result" | ||
| | null; | ||
| reason: string; | ||
| } |
There was a problem hiding this comment.
Duplicated material-progress wire type
MaterialProgressPayload manually duplicates the adjacent Zod schema, so future field or nullability changes must be synchronized across two definitions and can leave TypeScript consumers out of step with runtime validation. Infer the payload type from MaterialProgressPayloadSchema to keep one canonical representation.
Rule Used: # Code Review Pattern Reference: Slop, Tests, Feat... (source)
Knowledge Base Used: Protocol package (@getpaseo/protocol)
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!
|
Integration note from independent combined review: #2765 remains independently READY for its material-progress contract at 288db91, but it is not a semantic superset of #2763. If #2763 lands first, rebase this PR and preserve #2763 reserved-occurrence reconciliation plus admission-terminal child retention while layering this PR checkpoint logic; run the union hydration/material-progress suite before landing. Do not resolve the overlapping agent-manager conflicts by choosing this branch wholesale. |
Summary
Successor context
This is the narrow current-main successor to #2721. It intentionally leaves #2721 open and excludes its lifecycle manifests, receipts, provider adapters, and lifecycle-control changes. The snapshot is observational only and does not change whether an agent runs, stops, or continues.
Compatibility
Older clients ignore the optional snapshot field. New clients accept legacy snapshots without it and can gate on server_info.features.materialProgress.
Verification