[Fix] Fast mode can continue after its conversation lock expires - #1515
Closed
roomote-roomote[bot] wants to merge 11 commits into
Closed
[Fix] Fast mode can continue after its conversation lock expires#1515roomote-roomote[bot] wants to merge 11 commits into
roomote-roomote[bot] wants to merge 11 commits into
Conversation
Contributor
|
No code issues found. See task
Reviewed 3afc15c |
Contributor
Author
|
Freshness/readiness pass completed at
No code issues remain in the automated review and all existing review threads are resolved. The branch is mergeable; the remaining blocked state is the draft/review decision, not failing CI. |
…wal-fail-closed-0xlbn6sro4gpp
…d-0xlbn6sro4gpp' into fix/fast-lock-renewal-fail-closed-0xlbn6sro4gpp
…d-0xlbn6sro4gpp' into fix/fast-lock-renewal-fail-closed-0xlbn6sro4gpp
…d-0xlbn6sro4gpp' into fix/fast-lock-renewal-fail-closed-0xlbn6sro4gpp
…wal-fail-closed-0xlbn6sro4gpp
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.
Why this PR exists
What changed
Fast conversation locks now abort an active turn when renewal cannot be confirmed before the last confirmed Redis lease expires. Successful acquisitions and renewals start their deadline from confirmation, so slow Redis responses still receive the full lease.
Ownership cancellation covers Slack and Discord task preparation, kickoff, and queue handoff. Signal-guarded runs remain non-runnable during asynchronous activation preparation; the final synchronous ownership check dispatches one atomic Redis commit, while cancellation cleanup, commit, and competing dequeue serialize in Redis so only one side wins.
The branch includes
developthroughcf993348while preserving current image and model forwarding, all-repositories handling, native task-card hooks, queued-lock retries, and retry settlement behavior.Why this change was made
Persistent renewal failures previously allowed an expired Fast turn to continue after another worker could acquire the same conversation, risking duplicate replies or task launches.
Impact
Transient Redis failures remain tolerated while the confirmed lease is valid. Once ownership is lost, stale Fast work stops without canceling a task that the controller already claimed legitimately.
How it was tested
pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/cloud-agents exec vitest run src/server/fast-agent/__tests__/fast-agent-turn-lock.test.ts src/server/fast-agent/__tests__/fast-agent-task-launcher.test.ts src/server/fast-agent/__tests__/fast-agent-service.test.ts src/server/__tests__/task-run-queue.test.ts src/server/__tests__/enqueue-task.test.ts(230 passed)pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/api exec vitest run src/handlers/discord/__tests__/task-orchestration.test.ts src/handlers/discord/__tests__/fast-agent.test.ts(27 passed)pnpm lint,pnpm check-types,pnpm knip,pnpm build, andpnpm lint:pre-pushpass.pnpm testgate reaches a pre-existingdevelopfailure inpackages/db/src/lib/__tests__/brain.test.ts: the whole DB suite reports three recent recording gaps instead of one. The test passes in isolation, and a cleanorigin/developworktree reproduces the same full-suite failure.Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locallypnpm changeset