Skip to content

docs: document replay history normalization contract#89585

Merged
steipete merged 1 commit into
mainfrom
codex/replay-history-comments
Jul 5, 2026
Merged

docs: document replay history normalization contract#89585
steipete merged 1 commit into
mainfrom
codex/replay-history-comments

Conversation

@steipete

@steipete steipete commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document replay-history normalization, tool-result char estimation, usage accumulator, tool-name allowlist, embedded resource-loader, compaction successor transcript, and post-compaction loop guard contracts.
  • Document compaction runtime context and embedded sandbox-info contracts for successor runs, prompt-visible sandbox summaries, and full-access policy state.
  • Keep the change scoped to declaration/inline documentation; no runtime behavior change intended.

Linked context

Related #88554

Requested by maintainer in chat after confirming #88554 should be the only landing target before the next PR.

Real behavior proof

Behavior addressed: comment-only maintainability for embedded-agent replay-history normalization, tool-result char estimation, usage accumulation, compaction runtime context assembly, sandbox info prompt summaries, tool-name allowlist generation, embedded resource loading, compaction successor transcript rotation, and post-compaction loop guarding; no runtime behavior intended.
Real environment tested: local source checkout.
Exact steps or command run after this patch: git diff --check; git diff --check origin/main..HEAD; pnpm test src/agents/embedded-agent-runner/replay-history.test.ts; pnpm test src/agents/embedded-agent-runner/tool-result-char-estimator.test.ts; pnpm test src/agents/embedded-agent-runner/usage-accumulator.test.ts; pnpm test src/agents/embedded-agent-runner/compaction-runtime-context.test.ts; pnpm test src/agents/embedded-agent-runner.buildembeddedsandboxinfo.test.ts; pnpm test src/agents/embedded-agent-runner/tool-name-allowlist.test.ts src/agents/embedded-agent-runner.splitsdktools.test.ts; pnpm test src/agents/embedded-agent-runner/resource-loader.test.ts; pnpm test src/agents/embedded-agent-runner/compaction-successor-transcript.test.ts; pnpm test src/agents/embedded-agent-runner/post-compaction-loop-guard.test.ts.
Evidence after fix: latest pushed commit 41d4901 documents post-compaction loop guard contracts; whitespace checks passed; focused tests passed: replay-history 25, tool-result-char-estimator 4, usage-accumulator 12, compaction-runtime-context 18, buildembeddedsandboxinfo 11, tool-name-allowlist/splitsdktools 11, resource-loader 1, compaction-successor-transcript 10, post-compaction-loop-guard 12.
Observed result after fix: branch codex/replay-history-comments pushed with scoped documentation changes for replay-history, tool-result estimator, usage accumulator, compaction runtime context, sandbox info, tool-name allowlists, resource loader, compaction successor transcript rotation, and post-compaction loop guard.
What was not tested: broader agent suites and live runtime behavior because this PR only adds comments and does not change runtime behavior.
Proof limitations or environment constraints: no live behavior proof collected for comment-only documentation.
Before evidence: the touched exported helpers/types lacked declaration-level contract comments before this PR.

Tests and validation

Commands run:

  • git diff --check
  • git diff --check origin/main..HEAD
  • pnpm test src/agents/embedded-agent-runner/replay-history.test.ts
  • pnpm test src/agents/embedded-agent-runner/tool-result-char-estimator.test.ts
  • pnpm test src/agents/embedded-agent-runner/usage-accumulator.test.ts
  • pnpm test src/agents/embedded-agent-runner/compaction-runtime-context.test.ts
  • pnpm test src/agents/embedded-agent-runner.buildembeddedsandboxinfo.test.ts
  • pnpm test src/agents/embedded-agent-runner/tool-name-allowlist.test.ts src/agents/embedded-agent-runner.splitsdktools.test.ts
  • pnpm test src/agents/embedded-agent-runner/resource-loader.test.ts
  • pnpm test src/agents/embedded-agent-runner/compaction-successor-transcript.test.ts
  • pnpm test src/agents/embedded-agent-runner/post-compaction-loop-guard.test.ts

Regression coverage added or updated: none; existing focused tests cover the runtime behavior for the touched files.

What failed before this fix, if known: no runtime failure; this is a maintainability/documentation slice.

If no test was added, why not? Runtime behavior was unchanged.

Risk checklist

Did user-visible behavior change? (Yes/No)

No.

Did config, environment, or migration behavior change? (Yes/No)

No.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

No.

What is the highest-risk area?

Low documentation-only risk in embedded agent runtime helper code.

How is that risk mitigated?

The PR changes comments only and focused tests passed.

Current review state

What is the next action?

Maintainer review and CI on the latest pushed head.

What is still waiting on author, maintainer, CI, or external proof?

CI after the latest push.

Which bot or reviewer comments were addressed?

None yet.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Jun 2, 2026
@steipete
steipete force-pushed the codex/replay-history-comments branch from 6515710 to 513f9ea Compare June 2, 2026 19:06
@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 69c07653e863c0cf35646a6617ebcd065b97dc5c, but the PR head is now b6e194518298d1e74cefc69df94b34af59620c02. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (3 earlier review cycles)
  • reviewed 2026-06-22T00:14:11.065Z sha b1cbe9c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T11:36:35.469Z sha 999ad0b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T12:22:10.904Z sha 69c0765 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/replay-history-comments branch 3 times, most recently from 5596d9d to 3bd721c Compare June 2, 2026 19:19
@steipete
steipete force-pushed the codex/replay-history-comments branch 5 times, most recently from 4281412 to 20ca6bd Compare June 2, 2026 19:54
@steipete
steipete requested a review from a team as a code owner June 2, 2026 19:57
@steipete
steipete force-pushed the codex/replay-history-comments branch from 09165c2 to dce8eae Compare June 2, 2026 20:00
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 2, 2026
@steipete
steipete force-pushed the codex/replay-history-comments branch 4 times, most recently from 198ad15 to 3541bca Compare June 2, 2026 20:27
@steipete
steipete force-pushed the codex/replay-history-comments branch from 1130777 to 32bfe03 Compare June 2, 2026 20:48
@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling channel: qqbot size: XL and removed size: XS labels Jul 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91500e00ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| `channels.bluebubbles.allowFrom` | `channels.imessage.allowFrom` | Same handle formats (`+15555550123`, `[email protected]`). Pairing-store approvals do not transfer — see below. |
| `channels.bluebubbles.groupPolicy` | `channels.imessage.groupPolicy` | Same values (`allowlist` / `open` / `disabled`); default `allowlist`. |
| `channels.bluebubbles.groupAllowFrom` | `channels.imessage.groupAllowFrom` | Same. Does not fall back to `allowFrom`an empty `groupAllowFrom` under `groupPolicy: "allowlist"` drops all groups regardless of `allowFrom`. |
| `channels.bluebubbles.groupAllowFrom` | `channels.imessage.groupAllowFrom` | Same. When unset, iMessage falls back to `allowFrom`; an explicitly empty `groupAllowFrom: []` blocks all groups under `groupPolicy: "allowlist"`. |

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 Badge Teach doctor the iMessage fallback contract

When a migrated config leaves channels.imessage.groupAllowFrom unset but keeps senders in allowFrom, this new guidance says groups are admitted via the fallback, and monitor-provider.ts now suppresses the drop-all warning for that case. openclaw doctor still uses extensions/imessage/src/doctor.ts:6 to declare groupAllowFromFallbackToAllowFrom: false, so src/commands/doctor/shared/empty-allowlist-policy.ts:94-108 will continue telling those users that all group messages are silently dropped; simply flipping the flag would also miss the explicit groupAllowFrom: [] block-all case documented here, so the doctor path needs the same unset-vs-empty iMessage semantics.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/replay-history-comments branch from 91500e0 to 69c0765 Compare July 5, 2026 12:15
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed docs Improvements or additions to documentation channel: imessage Channel integration: imessage scripts Repository scripts docker Docker and sandbox tooling channel: qqbot size: XL labels Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete
steipete force-pushed the codex/replay-history-comments branch from 69c0765 to b6e1945 Compare July 5, 2026 12:24
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Replayed only the still-useful contract note from the original 71-file comment stack.

  • Final diff: two comment lines in src/agents/embedded-agent-runner/run/compaction-retry-aggregate-timeout.ts; no runtime behavior change.
  • The note records why retry timeout is aggregated across attempts and why deleting that shared deadline would permit unbounded retry time.
  • Validation: oxfmt, git diff --check, structured review artifacts, and exact-head CI run 28740664293.

This is the bounded canonical remainder; the broad historical stack is not needed for this contract.

@steipete
steipete force-pushed the codex/replay-history-comments branch from b6e1945 to 6b9fc22 Compare July 5, 2026 12:44
@steipete
steipete merged commit a5f0a37 into main Jul 5, 2026
97 checks passed
@steipete
steipete deleted the codex/replay-history-comments branch July 5, 2026 12:54
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant