Repository navigation
fix: prevent starters from requeuing unfinished agent work - #27
Open
ahmad-ajmal wants to merge 2 commits into
Open
ahmad-ajmal wants to merge 2 commits into
ahmad-ajmal wants to merge 2 commits into
Conversation
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24.
An agent could call
request-triagefor the record it was already working on, queue a successor, and move the record'sagentTaskaway from the original result. Repeating that operation caused additional bridge runs and hid the first answer.This change refuses another request while the current task is unfinished, keeping the record attached to its original work. Asking again after completion, failure, or cancellation still creates a new occurrence.
Changes
request-triagein all six starters. Unfinished tasks return HTTP 409 withalready_queuedand the current task ID; refusals create no record, task, or event writes.Validation
submitted,working, andinput-requiredrefusals, retained result display, and retries after all three terminal states.a2appCLI. The request failed, the original task completed, its record pointer was preserved, and the next bridge pass delivered zero tasks.Live browser coverage used PocketBase; the other five starters have automated regression coverage. Ruby tests ran in a disposable Ruby 3.3 container. The Go race detector was unavailable on the test host.
Screenshots
Captures from the live PocketBase end to end tests.
Original result after a forced requeue attempt
Fresh real Pi run
Waiting, progress, input required, and retry screenshots
Queued task
Working task after requeue refusal
Input required
Original result retained
Controlled failure with Ask again
Retry queued through the UI
Compatibility
Custom Rust runners must change their return type from
Result<Value, String>toResult<Value, OperationError>. Ordinary string failures can convert throughFrom<String>and retain HTTP 500 behavior.Base branch
Targets
ahmad/pocketbase-agent-queue(#25), which includes #21.