Skip to content

fix(sync): do not unstage GCS blobs after Cloud Tasks enqueue - #9252

Merged
kodjima33 merged 2 commits into
mainfrom
fix/sync-v2-post-enqueue-unstage
Jul 8, 2026
Merged

kodjima33 merged 2 commits into
mainfrom
fix/sync-v2-post-enqueue-unstage

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Merge order & dependencies

PR Dependencies
9250 None — merge first (unblocks CI)
9252 None — parallel with #9253, #9254
9253 None — parallel with #9252, #9254
9254 None — parallel with #9252, #9253; #9255 should merge after this
9255 Merge after #9254 (registers teardown tests). Merge after #9250 recommended.
9256 Independent code PR; PR6b prod deploy after merge. Related #9255 not blocking.
9257 Draft. Merge after #9255 (workflow contract CI).
9258 Draft. Independent; merge after wave 1.
9260 Draft. Independent; merge after wave 1.
9261 Draft. Merge after wave 1; PR10c proxy routing follow-up optional.

Summary

  • Gate _delete_staged_blobs_async so post-enqueue local cleanup failures do not delete staged blobs while a Cloud Task is still pending.
  • Add regression test and workflow_contracts.json invariant for enqueued jobs retaining staged blobs until handler completion.

Test plan

cd backend && .venv/bin/python -m pytest tests/unit/test_sync_cloud_tasks.py tests/unit/test_sync_v2.py -v -k post_enqueue
# 2 passed
cd backend && .venv/bin/python scripts/check_workflow_contracts.py
# Workflow contract checks passed.

Merge with a regular merge (no squash).

Closes #9235

Made with Cursor

Review in cubic

Git-on-my-level and others added 2 commits July 7, 2026 21:25
Gate _delete_staged_blobs_async on dispatch failure only and isolate
post-enqueue local cleanup so shutil.rmtree errors cannot unstage blobs
the handler still needs.

Closes #9235

Verification: cd backend && python3 -m pytest tests/unit/test_sync_cloud_tasks.py tests/unit/test_sync_v2.py -v -k post_enqueue
  cd backend && python3 scripts/check_workflow_contracts.py
Co-authored-by: Cursor <[email protected]>
Router import in the new regression test exceeds the fast-unit CPU guard.

Co-authored-by: Cursor <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backend bug fix conf 5/5: gate blob unstaging so enqueued Cloud Tasks retain staged GCS blobs, test+contract, CI green

@kodjima33
kodjima33 merged commit 0bff4d9 into main Jul 8, 2026
20 checks passed
@kodjima33
kodjima33 deleted the fix/sync-v2-post-enqueue-unstage branch July 8, 2026 14:34
Git-on-my-level added a commit that referenced this pull request Jul 9, 2026
## Merge order & dependencies

| PR | Dependencies |
|----|--------------|
| 9250 | None — **merge first** (unblocks CI) |
| 9252 | None — parallel with #9253, #9254 |
| 9253 | None — parallel with #9252, #9254 |
| 9254 | None — parallel with #9252, #9253; **#9255 should merge after
this** |
| 9255 | Merge after #9254 (registers teardown tests). Merge after #9250
recommended. |
| 9256 | Independent code PR; **PR6b prod deploy** after merge. Related
#9255 not blocking. |
| 9257 | **Draft.** Merge after #9255 (workflow contract CI). |
| 9258 | **Draft.** Independent; merge after wave 1. |
| 9260 | **Draft.** Independent; merge after wave 1. |
| 9261 | **Draft.** Merge after wave 1; **PR10c** proxy routing
follow-up optional. |


## Summary
- Register `listen_pusher_pipeline` in `workflow_contracts.json`
including PR4 teardown test.
- Run `check_workflow_contracts.py` from pre-push and
`backend-checks.yml` static-contracts; extend detect-changes.

Related: #9194

## Test plan
```bash
cd backend && .venv/bin/python scripts/check_workflow_contracts.py
cd backend && .venv/bin/python -m pytest tests/unit/test_workflow_contracts.py -v
# 5 passed
```

Merge with a **regular merge** (no squash).

Closes #9238

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/9255?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit that referenced this pull request Jul 9, 2026
## Merge order & dependencies

| PR | Dependencies |
|----|--------------|
| 9250 | None — **merge first** (unblocks CI) |
| 9252 | None — parallel with #9253, #9254 |
| 9253 | None — parallel with #9252, #9254 |
| 9254 | None — parallel with #9252, #9253; **#9255 should merge after
this** |
| 9255 | Merge after #9254 (registers teardown tests). Merge after #9250
recommended. |
| 9256 | Independent code PR; **PR6b prod deploy** after merge. Related
#9255 not blocking. |
| 9257 | **Draft.** Merge after #9255 (workflow contract CI). |
| 9258 | **Draft.** Independent; merge after wave 1. |
| 9260 | **Draft.** Independent; merge after wave 1. |
| 9261 | **Draft.** Merge after wave 1; **PR10c** proxy routing
follow-up optional. |


## Summary
- Wire `MCP_OAUTH_CLIENTS_JSON` / `MCP_OAUTH_CLAUDE_*` into
`runtime_env.yaml`, Helm secrets, and prod backend-listen values.
- Extend `smoke_mcp_chatgpt_review.py` authorize checks, add
`check_mcp_oauth_deploy_contract.py`, and gate `pre-deploy-check.sh`.
- Remove stale `("oauth_client_id", "omi")` automation fallback in
`MemoryExportService.swift`.

**Deploy follow-up (PR6b):** run backend-listen prod deploy +
`smoke_mcp` after merge (requires deploy credentials; not done in this
PR).

## Test plan
```bash
cd backend && .venv/bin/python scripts/check_mcp_oauth_deploy_contract.py
cd backend && .venv/bin/python -m pytest tests/unit/test_mcp_oauth.py -v -k claude
# 1 passed
```

Merge with a **regular merge** (no squash).

Closes #9149
Closes #8537

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/9256?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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.

Sync v2: post-enqueue cleanup deletes staged GCS blobs while Cloud Task is enqueued

2 participants