[Feat] Add automation recommendations to setup - #1321
Conversation
|
1 issue outstanding. See task
Reviewed fb947b7 |
|
Fixed and pushed in
|
17745a2 to
c34be69
Compare
| recommendationApplicationState(batch) !== 'applied' || | ||
| !recommendation?.enabled || | ||
| recommendation.lastRunTaskId || | ||
| recommendation.initialRunClaimedAt || |
There was a problem hiding this comment.
A worker restart/crash after the claim transaction commits but before runAutomationNow/runCustomAutomationNow is called now leaves initialRunClaimedAt permanently set. BullMQ retries then return at this guard, and later apply attempts cannot recover it, so the enabled recommendation never receives its promised initial run. Keep post-launch claims terminal to avoid duplicates, but give genuinely pre-launch claims a recoverable state (or make dispatch idempotent).
There was a problem hiding this comment.
This remains unresolved. A crash after markAutomationRecommendationInitialRunDispatchAttempted commits but before runAutomationNow / runCustomAutomationNow is invoked leaves both claim fields set. The worker returned normally for any earlier fresh-claim retry, so BullMQ marks the job complete; no later job invokes this recovery path, and the dispatch-marked claim is never reclaimable. The initial run is still lost. Use a durable retry/outbox state or an idempotent dispatch record that can safely be retried after this boundary.
There was a problem hiding this comment.
Reopening: the current head still persists initialRunDispatchAttemptedAt before invoking the runner, with no recovery path for a crash in that interval. The prior lost-initial-run finding remains applicable.
What changed
schedule.modevalues and Cookbook activation to use the sharedALL_REPOSITORIESsentinel.Why this change was made
Admins should be able to opt into useful recurring repository work while configuring Roomote, without generation itself launching a paid run. The review fixes ensure enabled recommendations actually schedule and Cookbook recommendations can create their automation rows.
Impact
New setups can review and enable ranked recommendations after repository selection, while admins who leave recommendations unfinished can continue from Home. Web/type checks and focused recommendation/setup tests pass. The full local test command still exposes an unrelated
@roomote/compute-providersfailure inworker-release-github-auth.test.tsinvolving unavailable GitHub installation lookup mocks; no recommendation tests fail.