Skip to content

refactor(agents): consolidate generation and runtime fixtures - #128339

Merged
steipete merged 1 commit into
mainfrom
codex/land-aug23-agent-runtime
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/land-aug23-agent-runtime

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Image, video, and music tools duplicated foreground and detached generation lifecycle policy, while adjacent MCP, runner-memory, and queue tests repeated large fixture blocks.

Why This Change Was Made

One agent-owned media generation task now handles admission, cancellation, completion, failure, wake delivery, and transcript outcomes for all three tools. The exact adjacent regression fixtures are consolidated without changing their cases. The extension-runner cleanup is intentionally excluded from this PR.

AI-assisted maintainer cleanup. I reviewed the final code, proof, and exact landing diff.

User Impact

Media generation keeps the same model-visible schemas and outcomes through a smaller canonical lifecycle. Contributors get substantially smaller MCP, memory, and queue regression fixtures.

Evidence

  • Production net LOC: -193; tests net LOC: -1289; total net -1482 across exactly ten files.
  • Current-main base: b977ccb21e2b4b8bff05729548ea1b1558a74a33; exact head: 560aef262e4db8c41d75ab61a655f867631a66fd.
  • Exact diff SHA-256: dd85450f408206c7358de4327d1090f0122b1d45f2f7aa2e87650b4f0f62bd50.
  • Fresh combined owner proof: 470/470 passed; assertion-safety ratchet passes without a baseline edit.
  • Production typing, touched agent test shards, typed lint, formatting, and diff checks passed.
  • Current-main MCP timeout/security and runner-memory terminal expectations remain intact.
  • Independent verification confirmed cancellation placement, provider/SSRF inputs, detached/foreground lifecycle, wake delivery, authority/privacy, and model-visible schemas are preserved.
  • Mandatory exact-source autoreview: secret scan clean; isolated Codex review reported no actionable findings (0.94 patch-correctness confidence).

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 19:00
@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 Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 3:48 PM ET / 19:48 UTC.

ClawSweeper review

What this changes

The PR centralizes image, video, and music generation lifecycle handling and consolidates repeated MCP, memory, and queue test fixtures.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding: the shared helper preserves the prior create, detach-or-foreground, completion, and failure sequence across all three media tools. This maintainer PR still needs a current merge result and completed exact-head checks before landing.

Priority: P3
Reviewed head: 560aef262e4db8c41d75ab61a655f867631a66fd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation preserves the reviewed lifecycle contracts and focused coverage; only normal exact-head landing verification remains.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; the PR body records focused owner-test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; the PR body records focused owner-test evidence.
Evidence reviewed 5 items Lifecycle comparison: The shared helper retains the former task creation, detach decision, start notification, foreground completion, and failure handling sequence.
Sibling caller coverage: Image, music, and video all pass their existing provider job, request metadata, and notification callback through the shared lifecycle.
Behavior tests retained: Focused tests still cover detached start, accepted-task continuation, preparation abort, foreground failure, task progress, and completion wake delivery.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/agents/tools/media-generate-background.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs src/agents/tools/media-generate-background.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128339-BXFthy/target$ node scripts/run-vitest.mjs src/agents/tools/media-generate-background.test.ts
node scripts/run-vitest.mjs src/agents/tools/media-generate-background.test.ts
[test] starting test/vitest/vitest.agents-tools.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128339-BXFthy/target

 ✓  agents-tools  src/agents/tools/media-generate-background.test.ts (17 tests) 41ms

 Test Files  1 passed (1)
      Tests  17 passed (17)
   Start at  19:49:41
   Duration  14.84s (transform 11.84s, setup 990ms, import 13.44s, tests 41ms, environment 0ms)

[test] passed 1 Vitest shard in 20.96s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128339-BXFthy/target$ node scripts/run-vitest.mjs src/agents/tools/media-generate-background.test.ts



































Assertions:

  • PASS expect_output: passed

How this fits together

Media-generation tools admit an agent request, run a provider-specific job, then either return immediately or complete a detached task and wake the requester. The new helper owns the common lifecycle while callers retain tool-specific generation work and metadata.

flowchart LR
A[Image, video, music tools] --> B[Shared task lifecycle]
B --> C{Foreground or detached}
C --> D[Tool-specific provider job]
D --> E[Completion, failure, wake delivery]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch behind current main and its supplied check rollup is incomplete; obtain a current merge result and completed exact-head checks before landing.
  • Complete next step (P2) - Confirm the clean current merge result and completed exact-head CI; no mechanical repair or product decision is outstanding.
Agent review details

Security

None.

PR surface

Source -193, Tests -1289. Total -1482 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 266 459 -193
Tests 5 711 2000 -1289
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 977 2459 -1482

Review metrics

Metric Value Why it matters
Production versus test LOC production +266/-459 (net -193); tests +711/-2,000 (net -1,289) One canonical lifecycle helper replaces three duplicated sequences; fixture consolidation retains distinct behavior cases.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single lifecycle owner once GitHub confirms a clean current merge result and completed exact-head checks, preserving tool-specific provider jobs and behavior tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the single lifecycle owner once GitHub confirms a clean current merge result and completed exact-head checks, preserving tool-specific provider jobs and behavior tests.

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

Not applicable: this PR refactors an established lifecycle rather than reporting a separate bug.

Is this the best way to solve the issue?

Yes: centralizing the repeated lifecycle at its existing owner is preferable to retaining three parallel implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bd7fb1d5976c.

Labels

Label justifications:

  • P3: This is a maintenance refactor without a reported user-facing defect.
  • 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-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; the PR body records focused owner-test evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Blame ties the existing lifecycle facade to 3d75c27, and the reviewed refactor head has the same author. (role: introduced the shared lifecycle facade and authored the current refactor; confidence: high; commits: 3d75c27103b0, 560aef262e4d; files: src/agents/tools/media-generate-background-shared.ts, src/agents/tools/media-generate-background.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the current merge result and completed required checks on the exact head before landing.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-23T19:06:17.578Z sha 560aef2 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit e4bf242 into main Aug 23, 2026
303 checks passed
@steipete
steipete deleted the codex/land-aug23-agent-runtime branch August 23, 2026 20:43
@steipete

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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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