Skip to content

fix(commitments): isolate extraction batches by agent#104426

Merged
steipete merged 2 commits into
mainfrom
codex/fix-commitment-agent-batching
Jul 11, 2026
Merged

fix(commitments): isolate extraction batches by agent#104426
steipete merged 2 commits into
mainfrom
codex/fix-commitment-agent-batching

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #104425

What Problem This Solves

Fixes an issue where operators using commitment extraction with multiple agents could have one agent's conversation included in an extraction prompt executed and persisted under another agent's identity when turns completed in the same debounce window.

Why This Change Was Made

The background drain now selects up to the configured batch limit from the first queued agent only, preserving other agents' queue order. Terminal model or authentication failures remain scoped to the failing agent and re-arm the drain when unaffected agents still have queued work.

User Impact

Commitment extraction prompts, provider credentials, workspaces, extractor session files, and terminal-failure cooldowns no longer cross agent boundaries. Commitments remain opt-in.

Evidence

  • Blacksmith Testbox through Crabbox tbx_01kx8dd1pzazvc53t9d73rwgwx: corepack pnpm test src/commitments/runtime.test.ts — 14/14 passed.
  • Same Testbox: corepack pnpm check:changed — passed core and core-test typechecks, changed-file lint, import-cycle, database-first, and guard checks.
  • Same Testbox: targeted oxfmt --check — passed.
  • Structured Codex autoreview (gpt-5.5, high): first pass found the timer re-arm gap; fixed and re-proven. Final pass: no accepted/actionable findings.
  • Regression coverage asserts interleaved agents produce homogeneous batches and a timer-fired terminal failure for one agent still drains the other agent.

AI-assisted: yes. The implementation and proof were inspected and understood by the maintainer agent.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 11, 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: 21a3627178

ℹ️ 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".

Comment thread CHANGELOG.md Outdated

### Fixes

- **Commitment extraction agent isolation:** partition background extraction batches by agent so prompts, provider credentials, extractor sessions, and terminal-failure cooldowns never cross agent boundaries.

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 Remove the normal-fix changelog entry

For a normal code fix, this CHANGELOG.md edit trips the repo's release-owned changelog gate: scripts/pr-lib/common.sh keeps changelogs optional for changed files, and scripts/pr-lib/gates.sh exits on any root changelog update unless OPENCLAW_ALLOW_ROOT_CHANGELOG_PR=1 is set for explicit release automation or maintainer release closeout. Put this release-note text in the commit/PR body instead so standard prepare/merge runs do not fail.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 21a3627178839d00142496fa747889469e9a5e21, but the PR head is now fd1d2767a4161f2e373b680a2575dbf3012582c8. 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof:

  • Focused regression: corepack pnpm test src/commitments/runtime.test.ts — 14/14 passed on Blacksmith Testbox through Crabbox tbx_01kx8dd1pzazvc53t9d73rwgwx.
  • Changed-surface gate: env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed — passed on the same Testbox.
  • Formatting: targeted oxfmt --check passed.
  • Structured autoreview: Codex gpt-5.5, high reasoning; accepted and fixed the terminal-failure timer re-arm finding; final run clean.
  • Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/29150663788 — success.
  • Repo-native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 104426 — passed at fd1d2767a4161f2e373b680a2575dbf3012582c8.

Known proof gaps: none for the changed queue/runtime contract.

@steipete
steipete merged commit 5a26748 into main Jul 11, 2026
101 checks passed
@steipete
steipete deleted the codex/fix-commitment-agent-batching branch July 11, 2026 11:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* fix(commitments): isolate extraction batches by agent

* chore: leave release notes to release workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commitment extraction batches can mix agent transcripts

1 participant