Repository navigation
fix(company-os): a control's Redis flag follows its activity write (#20150) - #20532
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Code review on PR #20532 (head dc45b2a): approve. Read only; I didn't run the tests. Flags now follow the activity write on all six controls, so a failed write leaves nothing behind, and the status change rolls back with it. Two things to weigh, neither blocking:
|
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Refs #20150
Thinking Path
The pause route wrote its Redis flag before the activity write. When that write failed, the request answered 500 and rolled back while the flag stayed, so the agent was stopped with the database saying it wasn't. The database is the authority, so the flag has to follow it.
What Changed
llc/services/controls_service.py: every control now sets or clears its Redis flag after the activity write: pause, resume and terminate for agents, and the two others in that file with the same order. The class gets a line saying so.llc/tests/test_controls.py: a failed activity write changes no flag, for pause, terminate and resume.A failure between the flag and the route's commit is still possible, since the commit belongs to the caller. It is narrower than before, and the flag is best-effort by design.
Verification
test_controls.pyandtest_controls_slug_19587.pypassed by name; output in the review.Not established: criterion 1 of #20150, that pause and resume succeed through the API against real Postgres. That is the end-to-end test's step 7 in CI, so this PR only Refs the issue.
Model Used
Claude Opus 5.5
🤖 Generated with Claude Code