Skip to content

refactor: share agent-turn execution test defaults - #143166

Merged
steipete merged 1 commit into
mainfrom
codex/test-agent-turn-defaults-01a0750a
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-agent-turn-defaults-01a0750a

Conversation

@steipete

@steipete steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Closes #143165

What Problem This Solves

Agent-turn execution tests repeat twelve identical default fields across several execution scenarios. Keeping those copies aligned adds maintenance cost when the shared execution contract changes. This is part of the maintainer-requested code reduction campaign.

Why This Change Was Made

A single no-argument test-support factory supplies the shared defaults at 26 test sites and in the existing complete-input constructor. Every call allocates fresh callbacks and a fresh pending-task Set. Scenario inputs, custom callbacks and captured sets, field order, media mock boundaries, cases, and assertions are preserved. The prior constructor adoption in #142962 remains intact.

User Impact

No user-visible behavior change. This removes 276 test/support code lines (275 physical lines) across six files; production code is unchanged.

Evidence

  • Original and candidate: 144/144 cases passed across nine native-routed suites, retaining each file's exact case inventory and order.
  • All 20 changed-file gates passed, including core-test types, lint, formatting, architecture guards, and dead-export scans.
  • Independent P2 review completed with no findings.
  • Expanding all 27 factory calls reproduces the original parsed tokens and property order across the six files.
  • The first lint run found the support module over its existing line limit. Reusing the same defaults in its existing constructor removed the remaining duplication; final validation and review cover that refinement. No limit, assertion, or baseline was weakened.

This is local isolated test/type/static proof; no live Gateway was needed for a test-support-only change. The differing run times are not claimed as a performance improvement.

Consolidate identical fixture fields while preserving fresh callbacks and pending-task sets, scenario data, and all existing assertions. Verified 144 baseline and candidate cases, all changed-file gates, and independent P2 review.
@clawsweeper

clawsweeper Bot commented Sep 9, 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. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 9, 2026 14:17
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 10:24 AM ET / 14:24 UTC.

ClawSweeper review

What this changes

Shares a factory for agent-turn test defaults while preserving scenario-specific inputs and leaving production behavior unchanged.

Merge readiness

✅ Ready for maintainer review

Keep open as a useful, narrowly scoped cleanup. The extraction preserves fixture values, allocation isolation, scenario overrides, and assertions; no blocking defect was found. Current main still contains the duplicated defaults.

Priority: P3
Reviewed head: 48b45d5845261ee09ee57fc27a8c32c4a44522b8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving fixture extraction with useful reported validation and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-led test-support PR changes no production owner or user-visible behavior; its reported baseline/candidate suite results and static equivalence checks address the relevant preservation claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-led test-support PR changes no production owner or user-visible behavior; its reported baseline/candidate suite results and static equivalence checks address the relevant preservation claim.
Evidence reviewed 6 items Complete introduced diff: Inspected every introduced hunk against the pinned merge base. The five test files replace identical default blocks without changing cases, assertions, custom callbacks, or captured task sets.
Fresh allocations and preserved constructor: The factory creates its callbacks and pending-task Set inside each invocation. Its twelve fields retain their original values and order; satisfies Partial<AgentTurnParams> supplies contextual typing without making the returned fields optional. The existing complete-input constructor retains its required follow-up run.
Current-main necessity: The fetched main revision still defines the complete-input constructor with inline defaults and has no createAgentTurnExecutionDefaults match in auto-reply. The prior merged constructor refactor therefore does not supersede this extraction.
Findings None None.
Security None None.

How this fits together

OpenClaw’s agent-turn executor takes incoming or queued messages and produces progress events, replies, or failure outcomes. These test fixtures supply its inputs across runtime-selection, progress, and failure scenarios.

flowchart LR
  A[Scenario inputs] --> C[Test execution input]
  B[Fresh shared defaults] --> C
  C --> D[Agent-turn executor]
  E[Mock runtime results and events] --> D
  D --> F[Progress and reply assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -275. Total -275 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 47 322 -275
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 47 322 -275

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #143165
Summary: This PR implements the paired consolidation request; the earlier merged constructor cleanup is related but distinct.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep shared defaults in the existing test-support module, with fresh allocations per invocation and scenario-specific behavior explicit at each call site.

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

Not applicable: this is a test-support cleanup, and the duplicated inputs are directly observable in the base and current-main source.

Is this the best way to solve the issue?

Yes. A small factory in the existing support module removes identical setup while preserving custom scenarios and the previously merged constructor contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This reduces test-fixture maintenance without changing production behavior or adding user-facing capabilities.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-led test-support PR changes no production owner or user-visible behavior; its reported baseline/candidate suite results and static equivalence checks address the relevant preservation claim.

Evidence

What I checked:

  • Complete introduced diff: Inspected every introduced hunk against the pinned merge base. The five test files replace identical default blocks without changing cases, assertions, custom callbacks, or captured task sets. (48b45d584526)
  • Fresh allocations and preserved constructor: The factory creates its callbacks and pending-task Set inside each invocation. Its twelve fields retain their original values and order; satisfies Partial<AgentTurnParams> supplies contextual typing without making the returned fields optional. The existing complete-input constructor retains its required follow-up run. (src/auto-reply/reply/agent-runner-execution.test-support.ts:622, 48b45d584526)
  • Current-main necessity: The fetched main revision still defines the complete-input constructor with inline defaults and has no createAgentTurnExecutionDefaults match in auto-reply. The prior merged constructor refactor therefore does not supersede this extraction. (src/auto-reply/reply/agent-runner-execution.test-support.ts:622, ff612431704a)
  • Related merged work and routing: GitHub confirms refactor(tests): share agent-turn input fixtures #142962 merged at 2444adb. Its patch changes the existing constructor to accept a supplied follow-up run; this PR preserves that contract. Current-main file history also identifies repeated relevant work by Peter Steinberger. Full historical blame encountered an unavailable object, so no source-line introduction attribution is claimed. (src/auto-reply/reply/agent-runner-execution.test-support.ts, 2444adb94a59)
  • Open paired request: The live issue Consolidate repeated agent-turn execution test defaults #143165 requests this exact consolidation and remains open. This PR explicitly owns that work through its closing reference.
  • Validation scope: The captured PR body reports identical 144-case baseline/candidate results across nine suites, twenty passing changed-file gates, and expansion equivalence at all 27 factory calls. These are contributor-reported results, not reviewer executions. Read-only diff checking passed and the checkout remained clean; no tests or target scripts were executed. (48b45d584526)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 90ed448 into main Sep 9, 2026
213 checks passed
@steipete
steipete deleted the codex/test-agent-turn-defaults-01a0750a branch September 9, 2026 14:37
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 9, 2026
…er-ownership-20260909

* origin/main: (147 commits)
  fix(cli): reject blank account selectors before command startup (#143088)
  fix(update): repair young runs after recorded drivers exit (#143136)
  test(telegram): close model callback fixture connections (#143197)
  improve(test): reduce Telegram policy fixture startup overhead (#143192)
  test(ci): stabilize systemd manager shim timing (#143134)
  fix(test): retire chat preview Escape listeners during teardown (#143191)
  test(memory-wiki): share visibility test callbacks (#143181)
  fix(ci): accept native iOS keychain filenames (#142968)
  fix(ci): show publication observations in FRV status (#143171)
  fix(github): point the stuck-FAQ auto-response at a live anchor (#143194)
  docs: correct verified accuracy defects in CLI, tools, and automation pages (#143179)
  refactor(tests): remove duplicate Mistral cache-cost test (#143172)
  fix(doctor): complete canonical model-reference migration (#142284)
  fix(ci): reject stale and empty timing sample cohorts (#143182)
  fix(ui): remove first-reply confetti from chat (#143167)
  docs: split help/faq into 13 topic pages (#143150)
  refactor(docs): require caller-owned route indexes (#143164)
  fix(android): distinguish connection status from chat readiness (#143128)
  refactor: share agent-turn execution test defaults (#143166)
  fix(cli): print immutable-config refusals without crash framing (#143140)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Consolidate identical fixture fields while preserving fresh callbacks and pending-task sets, scenario data, and all existing assertions. Verified 144 baseline and candidate cases, all changed-file gates, and independent P2 review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

Consolidate repeated agent-turn execution test defaults

1 participant