Skip to content

Commitment extraction batches can mix agent transcripts #104425

Description

@steipete

Summary

The module-global commitment extraction queue can combine completed turns from different agents into one extractor prompt. The extractor then runs under the first queued agent's model, credentials, workspace, session key, and extractor transcript.

Reproduction

  1. Enable commitments extraction.
  2. Complete turns for two agents within the extraction debounce window.
  3. Drain the background queue with both turns present.
  4. Observe one extractor batch containing both agent IDs while the embedded run uses only the first agent identity.

Expected behavior

Every extraction batch contains items for exactly one agent. Terminal model or authentication failure for one agent must not discard or stall another agent's queued work.

Actual behavior

The drain splices a global FIFO prefix without agent grouping. Mixed prompt content executes and persists under the first agent. Terminal failure cooldown and purge are also attributed only to the first agent.

Impact

Commitments are opt-in and operate within the current single-operator trust model, but cross-agent transcript and credential scoping is incorrect and blocks safe multi-tenant use.

Evidence

Current source path: src/commitments/runtime.ts. A focused regression test can reproduce mixed-agent batches using interleaved queue entries.

Metadata

Metadata

Assignees

Labels

maintainerMaintainer-authored PR

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions