Repository navigation
refactor: share agent-turn execution test defaults - #143166
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 10:24 AM ET / 14:24 UTC. ClawSweeper reviewWhat this changesShares 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -275. Total -275 across 6 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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) ...
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.
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
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.