Repository navigation
fix: match answered questions to originating responsibility run - #95
Open
shanmukhdatta wants to merge 2 commits into
Open
shanmukhdatta wants to merge 2 commits into
shanmukhdatta wants to merge 2 commits into
Conversation
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.
Bug: the wrong background run can consume a person's answer
One responsibility can have multiple concurrent runs (each from a separate event). When a person answers a question from an older run,
resumePersonQuestioncurrently pickslistRuns()[0], the latest run. If it happens to be waiting for a different question, the reply is delivered as the newest run's continuation instead of the one that asked, leaving the original suspended. This is a data-integrity issue for asynchronous agent workflows.Change
person_questionrun with a saved AG-UI continuation whoserunIdequals the saved question's run ID.resumeWaitingas a concurrent resumption; fall back to a separate answer instead of silently discarding the reply.Regression coverage
server/tests/approvals-question-resume-correlation.test.tsadds five tests: matching an older run when newer runs wait, refusing a mismatched waiting run, single-run legacy fallback, ambiguous legacy runs, and a concurrent-resume race. Existing single-run tests remain supported.Validation
Tests are added but not executed here: this execution environment lacks Bun and the full repository dependencies. Please run from
openbot/:bun test server/tests/approvals-question-resume-correlation.test.tsand the existing database integration test
server/tests/approvals-question-resume.integration.test.ts.Focused change: one service file plus targeted tests, no new dependencies.