Skip to content

test(agents): reject unsuccessful live replay completions - #207724

Merged
vincentkoc merged 2 commits into
mainfrom
test-live-replay-success-oracle-20261129
Nov 29, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
test-live-replay-success-oracle-20261129

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

All three Anthropic replay acceptance cases can pass when a completion resolves with an error and empty content. The two text cases return early; the tool-call case only checks that an array length is nonnegative.

User Impact

The cases now require a successful terminal result before accepting the replay. Successful empty responses retain their existing tolerance, and all three cases remain.

Why This Change Was Made

The completion API can resolve error and aborted messages. Accept only its successful terminal reasons: stop, length and toolUse. Preserve sanitizer call-count and exact transcript checks.

Evidence

  • Offline controls ran the actual three case bodies with a mocked completion and forbidden fetch: the original accepted error responses; the fix rejected all three error and all three aborted responses.
  • With the fix, all three cases passed for successful empty responses and for successful text responses. Those offline controls made no provider requests.
  • The normal live route retained all three natural skips with live execution disabled. Targeted format, lint, agent-root typecheck and diff checks passed.
  • On signed integration bcd228b341ce3c1589cd10d34a61d4deb7a662a2, the repository live-test wrapper ran all three cases against Anthropic with Node 24.22.1. Regular text replay, omitted-reasoning replay and tool-call history all passed. The native Vitest report recorded 3 passed, 0 skipped and 0 failed.
  • Independent source review confirmed the successful terminal set against the SDK StopReason contract.
  • Local ClawSweeper reviewed the complete committed range 501ee91..3e4e8d4 with no findings.

@vincentkoc vincentkoc self-assigned this Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR requires successful completion statuses in all three Anthropic replay acceptance cases.

Example: A replay completion resolves with stopReason "error" and content [].

  • Before: The text cases return early and the tool-history case passes its nonnegative-length assertion.
  • After: The completion-status assertion fails.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported; validation rests on reported offline controls, with no live provider run or independent execution in this review.
Proof confidence 🦐 gold shrimp (3/6) There is no shipped behavior change; the body reports mocked controls exercising the three case bodies, with live execution disabled and no provider request.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Replay validation can report success even when the provider rejects or aborts the completion.
Reason: The maintainer-authored change repairs a concrete acceptance-test defect while preserving the suite's established scope.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR narrowly fixes false-positive replay acceptance checks, with no introduced correctness findings.

Reviewed head: 3e4e8d4470fefedf95e5557197b56ae89f646213

Before merge

None.

Findings

None.

Agent review details

How this fits together

The opt-in Anthropic replay suite submits synthetic conversation histories through the completion runtime and checks transcript preservation and provider acceptance.

flowchart LR
  A[Synthetic replay histories] --> B[Transcript sanitizer]
  B --> C[Completion runtime]
  C --> D[Anthropic provider]
  D --> E[Assistant completion]
  E --> F[Successful status assertion]
Loading

Technical review

Best possible solution:

Retain the direct status assertions in the existing replay cases and preserve successful empty-response tolerance.

Do we have a high-confidence way to reproduce the issue?

Source establishes that resolved error messages with empty content pass the original cases; the PR reports matching offline controls, which were not rerun during this read-only review.

Is this the best way to solve the issue?

The assertions enforce the completion contract at the existing acceptance boundary without adding helpers, changing provider behavior, or weakening transcript checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8d901228ac6e.

Provenance checked

  • Successful empty-response tolerance keeps the original intent (e1061a8: Tolerate provider drift in release checks by allowing responses without visible text.)
  • Tool-history replay acceptance keeps the original intent (191b7cb: Preserve Anthropic replay tool results and verify provider acceptance; replacing the nonnegative-length assertion strengthens that intent.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit e1061a8 adds src/agents/pi-embedded-runner.anthropic-tool-replay.live.test.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e1061a8b46bc; files: src/agents/pi-embedded-runner.anthropic-tool-replay.live.test.ts)
  • Peter Steinberger: Raw commit 94555a5 adds src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 94555a5898eb; files: src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 1 +1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 28, 2026, 3:37 PM ET / 20:37 UTC.

* commit 'ba0a7a5fac3e2f1b642d05502273b98dc75adf4f': (556 commits)
  test(agents): fix provider header filtering coverage (#207732)
  refactor: remove the bundled GBrain adapter (#207924)
  improve(ui): show optional run limits beside the automation schedule (#201283)
  test(onboarding): inspect recorded output for credential leaks (#207872)
  perf(exec): reduce host memory sampler allocations (#207927)
  test(mcp-relay): isolate the Connected apps fallback locale (#207923)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  fix: show when worktree cleanup stopped or will retry (#207883)
  fix: show approval destinations only when the forwarding mode uses them (#207885)
  fix: keep inherited tools when changing agent settings (#207884)
  feat: let Knowledge add someone's email or other alias to a page without rewriting it (#207881)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  ...
@vincentkoc
vincentkoc marked this pull request as ready for review November 29, 2026 04:05
@vincentkoc
vincentkoc merged commit 9171e0d into main Nov 29, 2026
177 of 178 checks passed
@vincentkoc
vincentkoc deleted the test-live-replay-success-oracle-20261129 branch November 29, 2026 04:16
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit '99b4afc696081eda8aefd8e91250c112f53a8a73': (564 commits)
  test(ios): verify send-at-tap feedback and work grouping (#207913)
  test(agents): reject unsuccessful live replay completions (#207724)
  fix(cron): keep a started cron turn running when its job is edited (#207947)
  improve(ui): put waiting for a free agent under automation timing (#201282)
  chore(ui): refresh control ui locales (#207514)
  fix: distinguish unresolved delivery failures from delivery history (#207897)
  test(doctor): require security check in proxy ordering assertion (#207912)
  fix: keep update rollback tests in sync with shipped workers (#207822)
  test(agents): fix provider header filtering coverage (#207732)
  refactor: remove the bundled GBrain adapter (#207924)
  improve(ui): show optional run limits beside the automation schedule (#201283)
  test(onboarding): inspect recorded output for credential leaks (#207872)
  perf(exec): reduce host memory sampler allocations (#207927)
  test(mcp-relay): isolate the Connected apps fallback locale (#207923)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit '1b246c09b0c1d41ed0f090f07fc50381decba90d': (574 commits)
  fix: stop the manual handoff UI test from hanging after completion (#207945)
  fix: surface favorites and recommended models in picker search (#201450)
  fix: show the saved quota reset when chat skips its only model (#207210)
  fix: avoid reloading unchanged plugins after Gateway boot (#207949)
  fix: keep Task progress double-clicks from changing the window (#207937)
  fix(doctor): continue repairs past retained conflicting exec approvals (#207951)
  test(reply): make account isolation assertion decisive (#207793)
  fix: keep task progress compact when reopening Details (#207943)
  fix(ui): restore the saved reading position after an empty search (#207673)
  fix: remove four Memory Wiki settings that had no effect (#207882)
  test(ios): verify send-at-tap feedback and work grouping (#207913)
  test(agents): reject unsuccessful live replay completions (#207724)
  fix(cron): keep a started cron turn running when its job is edited (#207947)
  improve(ui): put waiting for a free agent under automation timing (#201282)
  chore(ui): refresh control ui locales (#207514)
  fix: distinguish unresolved delivery failures from delivery history (#207897)
  test(doctor): require security check in proxy ordering assertion (#207912)
  fix: keep update rollback tests in sync with shipped workers (#207822)
  test(agents): fix provider header filtering coverage (#207732)
  refactor: remove the bundled GBrain adapter (#207924)
  ...
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
(cherry picked from commit 9171e0d)

Pinned companion audit found no required follow-up.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant