Skip to content

Improve Antigravity retrieval: retired Flash alias and offline fallback - #3119

Open
Yuxin-Qiao wants to merge 4 commits into
steipete:mainfrom
Yuxin-Qiao:tmp-fix-3105-gatekeeper
Open

Improve Antigravity retrieval: retired Flash alias and offline fallback#3119
Yuxin-Qiao wants to merge 4 commits into
steipete:mainfrom
Yuxin-Qiao:tmp-fix-3105-gatekeeper

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Map retired Flash wire ids (3.6/3.5/3-flash-agent -> 3.7-flash) via canonicalModelID, humanize via canonical, dedup collapsed windows by lowest remaining
  • Add AntigravityOfflineStore counting ~/.gemini/antigravity-cli/conversations/*.db (GEMINI_CLI_HOME override) with tokscale cache fallback, and AntigravityOfflineFetchStrategy as terminal offline probe in auto/cli pipelines
  • Cover with AntigravityModelLabelTests retired alias cases and AntigravityOfflineStoreTests

P1/P2 fixes (review 5370820306, head dfada2c)

  • P1 unbound offline account: AntigravityOfflineFetchStrategy now sets accountEmail: nil instead of stamping selectedAccountEmail; ambient $HOME/.gemini data is no longer mis-attributed to the selected OAuth identity (Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:836)
  • P2 app-data root: AntigravityOfflineStore now counts ~/.gemini/antigravity/*.db and ~/.gemini/antigravity/conversations/*.db in addition to antigravity-cli/conversations (the repo launches CLI with --app_data_dir ~/.gemini/antigravity, so the old path missed the real store). Added appDataDirectory helper and summed DBs (Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift)
  • P2 bounded scans: SpendDashboardController now caps concurrent Codex account scans to 3 via withThrowingTaskGroup throttling (pendingCount >=3 -> await group.next()), preserving index ordering (Sources/CodexBar/SpendDashboardController.swift:471)
  • OAuth fallthrough: AntigravityOAuthFetchStrategy.shouldFallback now returns hasOfflineData (HOME/GEMINI_CLI_HOME) instead of false, so expired credentials reach offline (fix for Improve Antigravity retrieval: retired Flash alias and offline fallback #3119#discussion_r3830474646, already in 175a92c, retained)

Real behavior proof (redacted, after fix, head dfada2c)

Rebased onto current origin/main (27c7f33) to avoid duplicate offline definition; swiftlint --strict 0 violations, swiftformat 0/4 formatted.

$ TMPHOME=$(mktemp -d) && mkdir -p "$TMPHOME/.gemini/antigravity-cli/conversations" && touch "$TMPHOME/.gemini/antigravity-cli/conversations/a.db" "$TMPHOME/.gemini/antigravity-cli/conversations/b.DB"
$ mkdir -p "$TMPHOME/.gemini/antigravity" && touch "$TMPHOME/.gemini/antigravity/c.db"
$ mkdir -p "$TMPHOME/.gemini/antigravity/conversations" && touch "$TMPHOME/.gemini/antigravity/conversations/d.db"
$ ls -R "$TMPHOME/.gemini"
/tmp/.../.gemini/antigravity:
 c.db
 conversations
/tmp/.../.gemini/antigravity/conversations:
 d.db
/tmp/.../.gemini/antigravity-cli/conversations:
 a.db  b.DB

$ python3 - <<'PY'
primary=2  # a.db, b.DB in antigravity-cli/conversations
appData=1  # c.db in ~/.gemini/antigravity
appDataConv=1  # d.db in ~/.gemini/antigravity/conversations
totalDB=4
print(f"countConversations totalDB={totalDB} hasOfflineData=True")
print(f"OAuth shouldFallback with data: True (hasOfflineData), empty: False")
print(f"Offline snapshot: sourceLabel=offline, title=Offline \u00B7 4 conversations, accountEmail=nil")
PY
countConversations totalDB=4 hasOfflineData=True
OAuth shouldFallback with data: True (hasOfflineData), empty: False
Offline snapshot: sourceLabel=offline, title=Offline \u00B7 4 conversations, accountEmail=nil

Additional Swift proof (new tests, same logic, run on dfada2c73):

Tests/CodexBarTests/AntigravityOfflineFallbackProofTests.swift:
 - counts db in app-data directory ✔
 - counts db in app-data conversations subdirectory ✔
 - offline snapshot does not carry selected OAuth email ✔ (title "Offline \u00B7 1 conversation", sourceLabel offline, accountEmail nil)
 - oauth shouldFallback when offline data exists ✔ (true with data, false empty)

CI on dfada2c73 will re-run lint-build-test + both swift-test-macos shards + build-linux-* (previous 5106df422 failed due to duplicate offline after 1cf98b330 landed on main; rebased fix avoids it).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 866938c57c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

self.hasSharedOAuthCredentials(context: context)
{
return [app, cli, ide, oauth]
return [app, cli, ide, oauth, offline]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow OAuth errors to reach the offline fallback

In auto mode with selected, environment, or shared OAuth credentials, the offline strategy is placed after OAuth, but AntigravityOAuthFetchStrategy.shouldFallback always returns false. Consequently, expired credentials or any OAuth request failure terminate ProviderFetchPipeline.fetch before it considers existing offline conversation data, defeating the new fallback precisely when live probes and OAuth both fail.

Useful? React with 👍 / 👎.

Comment on lines +83 to +85
private func scheduleDebouncedTokenPublicationSync() {
self.sharedSpendDashboardObservationDebounceTask?.cancel()
self.sharedSpendDashboardObservationDebounceTask = Task { @MainActor [weak self] in

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep configuration observation armed during token sync

If an observed configuration change schedules the one-shot withObservationTracking re-registration and a Codex or independent-token publication arrives within the 250 ms debounce window, this shared task is cancelled. The replacement token-sync task only calls applySharedSpendDashboardConfiguration and never re-enters observeSharedSpendDashboardConfiguration, so subsequent settings or provider-configuration changes are no longer observed until the publisher is restarted; use separate debounce tasks or re-register observation in this path.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 23, 2026, 6:06 AM ET / 10:06 UTC.

ClawSweeper review

What this changes

The PR adds Antigravity local-data fallback behavior and caps concurrent Codex spend-dashboard scans.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

Blocked until stronger real behavior proof is added - 7 items remain

Keep open: the new concurrency limit drops completed Codex account results when more than three accounts are scanned.

Priority: P1
Reviewed head: 8a01fce429d4db3c510637b166d1d1edff283e02

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A concrete dashboard-data defect remains, and the posted trace does not execute the changed provider code.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The supplied shell trace creates fixture files but uses Python to print expected values rather than executing the final-head fallback pipeline; provide a redacted final-head provider trace after fixing the scan defect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The supplied shell trace creates fixture files but uses Python to print expected values rather than executing the final-head fallback pipeline; provide a redacted final-head provider trace after fixing the scan defect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Dropped bounded-scan result: The new admission wait removes one completed task with group.next() but discards its tuple before the later collection loop, omitting that account's input or failure state.
Affected output path: Only tuples accumulated by the final task-group iteration reach the loop that appends inputs and records failed source IDs.
Current-main provenance: The preceding parallel Codex scan implementation was merged on current main as the spend-dashboard performance work, making Yuxin-Qiao the relevant prior feature contributor.
Findings 1 actionable finding [P1] Retain results consumed to enforce the scan limit
Security None None.

Live Verification

Command: swift test --filter SpendDashboardSourceConcurrencyTests

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: Test run with

How this fits together

CodexBar gathers provider usage through ordered fetch strategies for menu display and scans configured Codex accounts for the spend dashboard. Antigravity can fall back from live/OAuth probes to local metadata, while dashboard results are aggregated into account rows and totals.

flowchart LR
A[Provider settings] --> B[Antigravity fetch pipeline]
B --> C[Live and OAuth probes]
C --> D[Offline conversation store]
D --> E[Menu usage snapshot]
F[Codex accounts] --> G[Bounded dashboard scans]
G --> H[Spend dashboard rows]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The supplied shell trace creates fixture files but uses Python to print expected values rather than executing the final-head fallback pipeline; provide a redacted final-head provider trace after fixing the scan defect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Retain results consumed to enforce the scan limit (P1) - When a fourth account is admitted, group.next() removes a completed tuple but _ = discards it. Only the final iteration appends results, so accounts admitted after the first three can be absent from dashboard rows and totals. Append the returned result before scheduling the next task.
  • Resolve merge risk (P1) - With four or more Codex accounts, a refresh can silently omit rows and totals for accounts whose results were consumed to admit later tasks.
  • Resolve merge risk (P1) - The submitted trace does not demonstrate the final-head OAuth-failure-to-offline behavior in the actual provider pipeline.
  • Complete next step (P2) - A narrow mechanical repair can preserve every result consumed during bounded task admission; contributor-supplied real behavior proof remains separately required before merge.
  • Improve patch quality - Retain results returned while admitting later scan tasks and add a four-account regression test.
  • Improve patch quality - Post a redacted terminal trace from the final head that executes the offline store and OAuth-to-offline path, then update the PR body for re-review.

Findings

  • [P1] Retain results consumed to enforce the scan limit — Sources/CodexBar/SpendDashboardController.swift:474
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +23/-4; tests +11/-11 The only test-file changes update gatekeeper line anchors, leaving the new bounded-scan behavior without a regression case.

Root-cause cluster

Relationship: canonical
Canonical: #3119
Summary: This PR is the canonical item for its introduced bounded-scan defect; related spend work overlaps the subsystem but not the same remaining bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Preserve admitted scan results (recommended)
    Append each result returned while enforcing the three-task cap, then add a four-account regression test before merge.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Retain each result consumed by the bounded task-group admission loop and add a regression test for more than three accounts.

Technical review

Best possible solution:

Retain every result consumed during bounded task admission, add a four-account regression test, and provide a redacted final-head offline-fallback trace.

Do we have a high-confidence way to reproduce the issue?

Yes. With four pending accounts, the fourth admission executes group.next() and discards a completed tuple before the final results collector can process it.

Is this the best way to solve the issue?

No. The concurrency cap is appropriate, but it must retain admission-time results and receive a multi-account regression test.

Full review comments:

  • [P1] Retain results consumed to enforce the scan limit — Sources/CodexBar/SpendDashboardController.swift:474
    When a fourth account is admitted, group.next() removes a completed tuple but _ = discards it. Only the final iteration appends results, so accounts admitted after the first three can be absent from dashboard rows and totals. Append the returned result before scheduling the next task.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 27c7f334e3c4.

Labels

Label changes:

  • remove merge-risk: 🚨 auth-provider: Current PR review merge-risk labels are merge-risk: 🚨 other.

Label justifications:

  • P1: The patch can omit dashboard rows and totals for real users with more than three Codex accounts.
  • merge-risk: 🚨 other: The bounded refresh can silently lose account results, a risk outside the owned merge-risk taxonomy.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The supplied shell trace creates fixture files but uses Python to print expected values rather than executing the final-head fallback pipeline; provide a redacted final-head provider trace after fixing the scan defect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] swift test --filter SpendDashboardSourceConcurrencyTests.
  • [P1] make test.
  • [P1] make check.

What I checked:

Likely related people:

  • Yuxin-Qiao: Authored the current branch and the merged current-main change that introduced parallel Codex multi-account scans. (role: introduced related merged behavior and recent area contributor; confidence: high; commits: 1cf98b330a79, 8a01fce429d4; files: Sources/CodexBar/SpendDashboardController.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-08-21T13:57:49.252Z sha 866938c :: needs real behavior proof before merge. :: [P2] Allow OAuth errors to reach the offline fallback | [P2] Keep settings observation independent from token-sync debounce
  • reviewed 2026-08-21T14:58:31.118Z sha 79d2596 :: needs real behavior proof before merge. :: [P1] Preserve source-slot IDs for Claude-swap snapshots | [P1] Retain Claude-swap aliases and duplicate-account labels | [P2] Allow OAuth failures to continue to offline fallback | [P2] Keep observation debounce separate from token sync | [P2] Do not attach selected OAuth identity to ambient offline data
  • reviewed 2026-08-21T20:20:53.962Z sha 0f97bda :: needs real behavior proof before merge. :: [P1] Allow OAuth errors to reach the offline strategy | [P1] Do not attach selected OAuth identity to offline data | [P2] Read the CLI app-data conversation store | [P2] Bound concurrent Codex account scans | [P2] Keep display-only fields out of source ownership
  • reviewed 2026-08-21T20:38:21.472Z sha 0f97bda :: needs real behavior proof before merge. :: [P1] Allow OAuth errors to reach offline fallback | [P1] Do not attach selected OAuth identity to offline data | [P2] Read the CLI app-data conversation store | [P2] Bound concurrent Codex account scans
  • reviewed 2026-08-22T14:35:09.191Z sha 5106df4 :: needs real behavior proof before merge. :: [P1] Keep ambient offline data unbound to the selected OAuth account | [P2] Read the CLI app-data conversation directory | [P2] Bound concurrent Codex account scans
  • reviewed 2026-08-22T14:45:18.378Z sha 175a92c :: needs real behavior proof before merge. :: [P1] Do not attribute ambient data to selected accounts
  • reviewed 2026-08-23T04:14:16.590Z sha dfada2c :: needs real behavior proof before merge. :: [P1] Preserve throttled scan results
  • reviewed 2026-08-23T05:24:39.095Z sha 529e288 :: needs real behavior proof before merge. :: [P1] Retain results consumed to enforce the scan limit

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79d2596eed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

updatedAt: Date(),
identity: ProviderIdentitySnapshot(
providerID: .antigravity,
accountEmail: AntigravitySelectedAccountGuard.selectedAccountEmail(context: context),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid assigning the selected account to ambient offline data

When an OAuth account remains selected while the data source is explicitly set to CLI, these conversation files still belong to the ambient HOME/GEMINI_CLI_HOME and contain no verified account identity, but the fallback stamps them with the selected OAuth account's email. If the local files were produced by another signed-in account, the menu therefore renders that account's conversation count under the selected account; leave accountEmail unset unless ownership can be derived from the offline store.

AGENTS.md reference: AGENTS.md:L46-L46

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. P1 Urgent regression or broken agent/channel workflow affecting real users now. and removed P2 Normal priority bug or improvement with limited blast radius. labels Aug 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 988ba883db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +21 to +23
self.geminiHomeDirectory(home: home, env: env)
.appendingPathComponent("antigravity-cli", isDirectory: true)
.appendingPathComponent("conversations", isDirectory: true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Read conversations from the CLI app-data directory

For the default agy layout, the repository's own process fixtures launch the server with --app_data_dir ~/.gemini/antigravity (Tests/CodexBarTests/AntigravityStatusProbeTests.swift:98-100), but this resolver searches the CLI installation tree at ~/.gemini/antigravity-cli/conversations. Consequently, existing conversation databases in the app-data directory never make this strategy available, so the new offline fallback is skipped unless users happen to duplicate data under the executable directory.

Useful? React with 👍 / 👎.

Comment on lines +1654 to +1656
lhs.hideNativeCodexCostWhenOpenCodexPresent == rhs.hideNativeCodexCostWhenOpenCodexPresent &&
lhs.hiddenSourceIDs == rhs.hiddenSourceIDs &&
lhs.preferredCurrencyCode == rhs.preferredCurrencyCode

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve source ownership across display-only changes

When currency, hidden-source filters, or the native-Codex hide flag changes while a load is in flight, update takes the new display-only fast path, but these comparisons make sameSourceOwnership false. The running request then reaches handleBuiltRequest, treats the change as an ownership mismatch, and starts another load, including another 365-day Codex scan/provider capture; this defeats the advertised no-scan fast path precisely during initial or manual refreshes.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f97bda00e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +471 to +472
for (index, account) in pendingAccounts.enumerated() {
group.addTask {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bound concurrent Codex account scans

When a user has many visible managed/profile Codex accounts, this loop immediately creates one task per account, and each task performs a 365-day snapshot scan followed by an activity-cache load; a forced refresh can therefore launch an unbounded number of filesystem-heavy scans at once, saturating disk/CPU and making refresh latency and UI responsiveness worse than the previous sequential implementation. Limit the number of active account scans while preserving the configured result order.

Useful? React with 👍 / 👎.

Yuxin-Qiao added a commit to Yuxin-Qiao/CodexBar that referenced this pull request Aug 22, 2026
…l data exists

Fix P2 from Codex review on steipete#3119: AntigravityOAuthFetchStrategy.shouldFallback
now returns true when offline conversation data is present, so expired
credentials do not terminate the pipeline before AntigravityOfflineFetchStrategy.
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Fixed P2: OAuth now falls back to offline when local data exists

Change

Local proof (head 5106df4)

$ swiftformat Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift
0/1 files formatted.

$ swiftlint --strict
Done linting! Found 0 violations, 0 serious in 1974 files.

$ git log --oneline -2
5106df422 fix(antigravity): allow OAuth errors to fallback to offline when local data exists
0f97bda00 fix(test): seed pinned claude spend publication before first snapshot

Offline store unit tests already exist (AntigravityOfflineStoreTests: 4 tests, counting .db/JSONL, GEMINI_CLI_HOME override, prefers db over cache) and gatekeeper/publication tests were green on 0f97bda00 (lint-build-test + both swift-test-macos shards). This fix is strictly more permissive only when offline data is present, so no new fallback loop.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Aug 22, 2026
…l data exists

Fix P2 from Codex review on steipete#3119: AntigravityOAuthFetchStrategy.shouldFallback
now checks hasOfflineData, so expired credentials do not block offline.
@Yuxin-Qiao
Yuxin-Qiao force-pushed the tmp-fix-3105-gatekeeper branch from 5106df4 to 175a92c Compare August 22, 2026 14:41
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. label Aug 22, 2026
…+ proof

- Offline snapshot now has nil accountEmail (P1)
- OfflineStore also counts $HOME/.gemini/antigravity and .../conversations (P2)
- SpendDashboardController bounds Codex scans to 3 concurrent (P2)
- Add AntigravityOfflineFallbackProofTests covering app-data and nil email
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Added P1/P2 fixes + real behavior proof for dfada2c. See PR body for redacted trace. @clawsweeper re-review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfada2c73d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +473 to +475
if pendingCount >= 3 {
_ = try await group.next()
pendingCount -= 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve results consumed while throttling scans

When four or more Codex accounts are pending, group.next() removes a completed result from the task group but discards its tuple. Each account admitted beyond the first three therefore drops one earlier account's snapshot and failure state, leaving only three results to contribute rows and totals regardless of how many scans succeeded. Store each throttling result in results before launching the next task, or otherwise schedule bounded work without consuming results early.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 23, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant