Skip to content

feat(replay): add ReplayInterceptor for recorded tool replay#183

Merged
dgarson merged 16 commits intodgarson/forkfrom
feat/deterministic-replay
Mar 3, 2026
Merged

feat(replay): add ReplayInterceptor for recorded tool replay#183
dgarson merged 16 commits intodgarson/forkfrom
feat/deterministic-replay

Conversation

@dgarson
Copy link
Copy Markdown
Owner

@dgarson dgarson commented Feb 24, 2026

Summary

  • add ReplayInterceptor with off|capture|replay modes for deterministic tool-call capture/replay
  • record tool.call events (including outcomes/errors) and support optional redaction of captured payloads
  • wire replay interception into createOpenClawCodingTools via optional replayInterceptor
  • add tests for interceptor capture/replay/error flows, redaction behavior, and wrapper arg passthrough for client tools

Validation

  • pnpm vitest run src/replay/interceptor.test.ts src/agents/pi-tools.replay.test.ts
  • pnpm oxlint --type-aware src/replay/interceptor.ts src/replay/interceptor.test.ts src/agents/pi-tools.replay.ts src/agents/pi-tools.replay.test.ts src/agents/pi-tools.ts src/replay/index.ts

…elpers

Add session-level replay manifest types distinct from the replay bundle
format in src/replay/types.ts (Nate's work in PR #92).

- ReplaySessionManifest: session metadata for replay-capable sessions
- ReplaySessionEvent: session-level events in the replay lifecycle
- ReplaySessionEventLog: collection of session events
- Serialization helpers: parse/serialize functions
- Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent
- exportSessionManifest stub: placeholder for future storage integration

Add 43 focused tests covering:
- Schema validation for all types
- Serialization round-trips
- Factory function behavior
- Edge cases and error handling
…elpers (#98)

Add session-level replay manifest types distinct from the replay bundle
format in src/replay/types.ts (Nate's work in PR #92).

- ReplaySessionManifest: session metadata for replay-capable sessions
- ReplaySessionEvent: session-level events in the replay lifecycle
- ReplaySessionEventLog: collection of session events
- Serialization helpers: parse/serialize functions
- Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent
- exportSessionManifest stub: placeholder for future storage integration

Add 43 focused tests covering:
- Schema validation for all types
- Serialization round-trips
- Factory function behavior
- Edge cases and error handling
…elpers

Add session-level replay manifest types distinct from the replay bundle
format in src/replay/types.ts (Nate's work in PR #92).

- ReplaySessionManifest: session metadata for replay-capable sessions
- ReplaySessionEvent: session-level events in the replay lifecycle
- ReplaySessionEventLog: collection of session events
- Serialization helpers: parse/serialize functions
- Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent
- exportSessionManifest stub: placeholder for future storage integration

Add 43 focused tests covering:
- Schema validation for all types
- Serialization round-trips
- Factory function behavior
- Edge cases and error handling
…elpers (#98)

Add session-level replay manifest types distinct from the replay bundle
format in src/replay/types.ts (Nate's work in PR #92).

- ReplaySessionManifest: session metadata for replay-capable sessions
- ReplaySessionEvent: session-level events in the replay lifecycle
- ReplaySessionEventLog: collection of session events
- Serialization helpers: parse/serialize functions
- Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent
- exportSessionManifest stub: placeholder for future storage integration

Add 43 focused tests covering:
- Schema validation for all types
- Serialization round-trips
- Factory function behavior
- Edge cases and error handling
@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Feb 25, 2026

Merged latest dgarson/fork into this branch to clear merge conflicts and resolved the single conflict in src/replay/index.ts by preserving the new ReplayInterceptor exports.

Validation run on branch head b24536a523:

  • pnpm exec vitest run src/replay/*.test.ts --config vitest.unit.config.ts (27 replay tests passed)
  • pnpm exec oxlint --type-aware src/replay/index.ts src/replay/interceptor.ts src/replay/interceptor.test.ts

This PR is now code-mergeable from a branch-content perspective. Remaining gate is CI/check completion on this new head commit.

@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Feb 26, 2026

Follow-up check on head b24536a523:

  • Required checks: none configured on base branch dgarson/fork (branch is unprotected).
  • Review state: no requested reviewers, no approvals required/present.
  • Local validation re-run just now:
    • pnpm vitest run src/replay/interceptor.test.ts src/agents/pi-tools.replay.test.ts (6/6 passed)
    • pnpm oxlint --type-aware src/replay/interceptor.ts src/replay/interceptor.test.ts src/agents/pi-tools.replay.ts src/agents/pi-tools.replay.test.ts src/agents/pi-tools.ts src/replay/index.ts

Blocker: GitHub Actions Labeler workflow jobs (label, label-issues) remain queued and do not start even after manual rerun/watch.

Owner: Repo CI/Actions infrastructure (runner/queue availability for pull_request_target Labeler jobs).

@dgarson dgarson merged commit 742fa53 into dgarson/fork Mar 3, 2026
3 of 9 checks passed
@dgarson dgarson deleted the feat/deterministic-replay branch March 3, 2026 01:21
@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Mar 3, 2026

Merge-readiness follow-up (Deterministic Replay):

  • Current PR state: MERGED (merge commit 742fa53f6ef3e3429be60bdf3e6bd03857f7dffb).
  • Targeted replay tests run locally on PR head b24536a5231f3b92c7daf095f85c42f606a3a8f2:
    • src/replay/interceptor.test.ts
    • src/agents/pi-tools.replay.test.ts
  • No isolated code issues found on the PR head requiring fixes.

Blockers:

  • No merge blockers remain for this change set (already merged).
  • FYI only: a Labeler pull_request_target workflow run is still queued/pending, which is not part of the replay implementation validation.

@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Mar 3, 2026

Final merge-readiness check (Deterministic Replay):

  • PR state: MERGED at 742fa53f6ef3e3429be60bdf3e6bd03857f7dffb from head b24536a5231f3b92c7daf095f85c42f606a3a8f2.
  • Targeted replay validation re-run on PR head:
    • pnpm vitest run src/replay/interceptor.test.ts src/agents/pi-tools.replay.test.ts --config vitest.unit.config.ts ✅ (6/6 tests passed)
    • pnpm exec oxlint --type-aware src/replay/interceptor.ts src/replay/interceptor.test.ts src/agents/pi-tools.replay.ts src/agents/pi-tools.replay.test.ts src/agents/pi-tools.ts src/replay/index.ts
  • Branch protection on dgarson/fork: off (no required status checks / no required approvals).

Conclusion: deterministic replay changes are validated and merged; no remaining code-side blockers. Pending Labeler jobs are non-blocking metadata automation.

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