Skip to content

feat: expose provider-neutral material progress snapshots - #2765

Open
timigod wants to merge 10 commits into
getpaseo:mainfrom
timigod:repair/material-progress-current-main
Open

feat: expose provider-neutral material progress snapshots#2765
timigod wants to merge 10 commits into
getpaseo:mainfrom
timigod:repair/material-progress-current-main

Conversation

@timigod

@timigod timigod commented Aug 1, 2026

Copy link
Copy Markdown

Summary

  • add an additive, provider-neutral materialProgress snapshot to agent inspection
  • persist an epoch- and sequence-bound incremental checkpoint so restart, replacement, and histories beyond 10,000 rows cannot silently reuse stale evidence
  • distinguish no progress, progressing, warning, and stalled from concrete material events and completed compactions
  • expose the snapshot through agent fetches, agent inspect table/JSON output, archived records, and an explicit server capability

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

  • 225 focused tests across protocol, classifier, manager, storage, projection, CLI, websocket capability, and daemon E2E
  • protocol, server, and CLI package builds
  • repository-wide typecheck
  • repository-wide lint
  • repository-wide format check
  • normal pre-commit hook across all files
  • clean diff and worktree on merge tree e024eb1, based on main 9ddc3e0

@timigod
timigod marked this pull request as ready for review August 1, 2026 20:23
@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds an epoch-bound, provider-neutral material-progress snapshot across daemon persistence and inspection surfaces.

  • Introduces material-event classification and checkpoint restoration/reset behavior.
  • Adds durable file-backed timelines with atomic history replacement.
  • Projects progress through protocol snapshots, archived records, CLI inspection, and server feature advertisement.
  • Expands tests around restart, rewind, hydration, replacement, and concurrent live events.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking protocol maintainability issue around the duplicated payload type.

The material-progress flow is coherently bound to durable timeline epochs and guarded across replacement, rewind, restart, and concurrent hydration; the remaining concern is that its protocol type can drift from runtime validation.

Files Needing Attention: packages/protocol/src/messages.ts

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "fix(agent): preserve progress across suc..." | Re-trigger Greptile

Comment on lines +705 to +721
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;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@timigod

timigod commented Aug 1, 2026

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant