Skip to content

fix cloud queue idle recovery#2250

Merged
tatoalo merged 1 commit into
mainfrom
fix/cloud-queue-idle-recovery
May 21, 2026
Merged

fix cloud queue idle recovery#2250
tatoalo merged 1 commit into
mainfrom
fix/cloud-queue-idle-recovery

Conversation

@tatoalo
Copy link
Copy Markdown
Contributor

@tatoalo tatoalo commented May 20, 2026

Problem

defensive hardening of the idle-recovery path

Changes

  • coalesce deferred cloud queue flushes and skip idle recovery while a flush is already scheduled or dispatching

@tatoalo tatoalo self-assigned this May 20, 2026
@tatoalo tatoalo marked this pull request as ready for review May 20, 2026 15:22
@tatoalo tatoalo requested a review from a team May 20, 2026 15:22
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/sessions/service/cloudRunIdleTracker.ts:122-134
The JSDoc for `evaluateIdle` still references "`becameIdle`" — a name that no longer exists — and describes the semantics as "flipped the run from not-idle to idle." In practice, `shouldCacheToStore` is `true` whenever the scan path determines `idle === true`, which includes repeated calls while the store hasn't propagated `agentIdleForRunId` yet (e.g., after `markIdle` set the scan state to idle but the live flag is still unset). The description should reflect the actual semantics.

```suggestion
  /**
   * Returns idleness for this exact run. Walks only events added since the
   * previous call so repeated invocations are O(delta), not O(N).
   *
   * The fast path hits `agentIdleForRunId` (the live signal set by the
   * `turn_complete` handler). The scan is a fallback for sessions
   * recreated from logs where the live flag was never set because the
   * no-delta dedup guard skipped reprocessing.
   *
   * `shouldCacheToStore` is true when idleness was determined via the scan
   * path (not the `agentIdleForRunId` fast path). Callers use it to write
   * `agentIdleForRunId` back to the store, avoiding a redundant write when
   * the live flag is already set.
   */
```

Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/cloud-queue..." | Re-trigger Greptile

@tatoalo tatoalo force-pushed the fix/cloud-queue-idle-recovery branch from e9aec5c to 66dc0bf Compare May 20, 2026 15:32
@tatoalo tatoalo merged commit 3e94820 into main May 21, 2026
15 checks passed
@tatoalo tatoalo deleted the fix/cloud-queue-idle-recovery branch May 21, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants