3.8 KiB
3.8 KiB
Case: parallel-workers-claim-conflict-through-bundled-cli
Test Type
This is a forward-test and a multi-agent negative-path validation.
The goal is to verify that two workers using the same bundled inbox skill can exercise a real claim conflict through the SQLite-backed inbox instead of simulating the outcome.
Purpose
Validate that all of the following can be true at the same time:
- multiple workers can use the same
skills/inbox/bundle against one shared DB - one worker can successfully claim the thread
- a competing worker can observe and attempt to claim that same thread
- the competing worker receives the expected
lease_conflictcontract - the thread remains owned by the original worker
Preconditions
- skill path exists:
SKILL_PATH=skills/inbox - bundled CLI executable exists:
SKILL_PATH/assets/inbox - use an empty temporary directory
TMPDIR - test database path is
TMPDIR/coord.db
Agent Topology
leaderworker-aworker-b
Inputs
Leader Prompt
Use $inbox at SKILL_PATH to act as leader on SQLite DB TMPDIR/coord.db. Only coordinate through the bundled inbox CLI from the skill. Workflow: 1) initialize the DB, 2) send exactly one task assigned to worker-a, 3) stop after confirming the thread exists and report the thread id. Do not use ordinary chat to coordinate with the workers.
Worker A Prompt
Use $inbox at SKILL_PATH to act as worker-a on SQLite DB TMPDIR/coord.db. Only coordinate through the bundled inbox CLI from the skill. Workflow: 1) wait for pending work assigned to worker-a, 2) fetch it, 3) claim it, 4) stop after confirming the claim succeeded and report the thread id and lease result. Do not use ordinary chat to coordinate with the other agents.
Worker B Prompt
Use $inbox at SKILL_PATH to act as worker-b on SQLite DB TMPDIR/coord.db. Only coordinate through the bundled inbox CLI from the skill. This is a conflict test. Workflow: 1) wait until there is a thread assigned to worker-a visible through inbox inspection, 2) resolve its thread id, 3) attempt to claim that thread as worker-b, 4) stop after reporting the exact error contract you observed. Do not use ordinary chat to coordinate with the other agents.
Execution Parameters
- use the shared execution contract from README.md
- use the shared timeout defaults from README.md
- do not override the default cleanup policy
Execution Steps
- Inject the same
skills/inbox/skill into all three real agents - Point all three agents at the same database path
TMPDIR/coord.db - Launch
leader,worker-a, andworker-bin parallel - Wait for all agents to finish
- Resolve
THREAD_IDfrom the agent outputs or inbox history - Independently run the validation commands from the main thread
Validation Commands
SKILL_PATH/assets/inbox --db TMPDIR/coord.db --json show --thread THREAD_ID
SKILL_PATH/assets/inbox --db TMPDIR/coord.db --json list --assigned-to worker-a
Expected Outcomes
leadersuccessfully runsinitleadersuccessfully creates one thread forworker-aworker-asuccessfullyclaims that threadworker-battemptsclaim --agent worker-b --thread THREAD_IDworker-breceives exit code20and JSON error codelease_conflict- the final thread remains assigned to
worker-a
Assertions
showcontains a worker-sideeventmessage with summarythread claimed- the final thread status is still
claimedorin_progress, not transferred toworker-b list --assigned-to worker-astill returns the thread- no agent reports successful ownership transfer to
worker-b
Cleanup
- use the default cleanup policy from README.md
- if the run fails, retain
TMPDIRandcoord.dbfor replay and manual inspection